vf_drawtext: select YUV color for drawbox() in case YUV colorspace is used
authorStefano Sabatini <stefasab@gmail.com>
Sat, 24 Dec 2011 15:17:18 +0000 (16:17 +0100)
committerStefano Sabatini <stefasab@gmail.com>
Tue, 3 Jan 2012 23:25:55 +0000 (00:25 +0100)
Fix box alpha rendering when a YUV colorspace is selected, in particular
fix trac ticket #763.
(cherry picked from commit 1858a5c25ee1ccb8089339d20138116a46cc6c77)

libavfilter/vf_drawtext.c

index 912a854..bf43ea9 100644 (file)
@@ -805,7 +805,7 @@ static int draw_text(AVFilterContext *ctx, AVFilterBufferRef *picref,
     /* draw box */
     if (dtext->draw_box)
         drawbox(picref, dtext->x, dtext->y, box_w, box_h,
-                dtext->box_line, dtext->pixel_step, dtext->boxcolor_rgba,
+                dtext->box_line, dtext->pixel_step, dtext->is_packed_rgb ? dtext->boxcolor_rgba : dtext->boxcolor,
                 dtext->hsub, dtext->vsub, dtext->is_packed_rgb, dtext->rgba_map);
 
     if (dtext->shadowx || dtext->shadowy) {