[FFmpeg-devel] [PATCH] dvbsubdec: set width/height from display def if not set.

Reimar Döffinger Reimar.Doeffinger at gmx.de
Mon Aug 27 18:00:32 CEST 2012


This fixes playback of DVB subtitles in
http://samples.ffmpeg.org/ffmpeg-bugs/trac/ticket1065/Test1.wtv
in MPlayer.
FFplay is not affected since it assumes that the subtitles
are scaled to match the video - but this usually isn't the
case after rescaling the video and stream-copying subtitles.

Signed-off-by: Reimar Döffinger <Reimar.Doeffinger at gmx.de>
---
 libavcodec/dvbsubdec.c |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/libavcodec/dvbsubdec.c b/libavcodec/dvbsubdec.c
index ef90f73..955925a 100644
--- a/libavcodec/dvbsubdec.c
+++ b/libavcodec/dvbsubdec.c
@@ -1343,6 +1343,10 @@ static void dvbsub_parse_display_definition_segment(AVCodecContext *avctx,
     display_def->y       = 0;
     display_def->width   = bytestream_get_be16(&buf) + 1;
     display_def->height  = bytestream_get_be16(&buf) + 1;
+    if (!avctx->width || !avctx->height) {
+        avctx->width  = display_def->width;
+        avctx->height = display_def->height;
+    }
 
     if (buf_size < 13)
         return;
-- 
1.7.10.4



More information about the ffmpeg-devel mailing list