[FFmpeg-devel] Set subtitle type in DVD and XSUB subtitle decoder

Janne Grunau janne-ffmpeg
Sun Jul 26 21:22:41 CEST 2009


On Sun, Jul 26, 2009 at 09:16:32PM +0200, Janne Grunau wrote:
> 
> ${subject}, same change as for the DVB subtitle decoder.
> grep suggest that these two are only remaining subtitle decoders in
> libavcodec.

and in good ffmpeg-devel tradition, I forgot to include the patch. Here
is it:

Janne

diff --git a/libavcodec/dvdsubdec.c b/libavcodec/dvdsubdec.c
index 8abf700..6c0756b 100644
--- a/libavcodec/dvdsubdec.c
+++ b/libavcodec/dvdsubdec.c
@@ -353,6 +353,7 @@ static int decode_dvd_subtitles(AVSubtitle *sub_header,
                 sub_header->rects[0]->y = y1;
                 sub_header->rects[0]->w = w;
                 sub_header->rects[0]->h = h;
+                sub_header->rects[0]->type = SUBTITLE_BITMAP;
                 sub_header->rects[0]->pict.linesize[0] = w;
             }
         }
diff --git a/libavcodec/xsubdec.c b/libavcodec/xsubdec.c
index ccb9bf9..4754987 100644
--- a/libavcodec/xsubdec.c
+++ b/libavcodec/xsubdec.c
@@ -91,6 +91,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size,
     av_freep(&sub->rects[0]->pict.data[0]);
     sub->rects[0]->x = x; sub->rects[0]->y = y;
     sub->rects[0]->w = w; sub->rects[0]->h = h;
+    sub->rects[0]->type = SUBTITLE_BITMAP;
     sub->rects[0]->pict.linesize[0] = w;
     sub->rects[0]->pict.data[0] = av_malloc(w * h);
     sub->rects[0]->nb_colors = 4;



More information about the ffmpeg-devel mailing list