aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/dvbsubdec.c
diff options
context:
space:
mode:
authorReimar Döffinger <Reimar.Doeffinger@gmx.de>2012-08-27 17:57:11 +0200
committerReimar Döffinger <Reimar.Doeffinger@gmx.de>2012-08-31 19:58:09 +0200
commitfe79fc2ea55b65141f3d664583d1caaf25d70ae5 (patch)
treea6f4bf4757360f73147755863ffb7cd4e7e92c44 /libavcodec/dvbsubdec.c
parentdddd006cabcead012ad88a0ec027578cd2963031 (diff)
downloadffmpeg-fe79fc2ea55b65141f3d664583d1caaf25d70ae5.tar.gz
dvbsubdec: set width/height from display def if not set.
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@gmx.de>
Diffstat (limited to 'libavcodec/dvbsubdec.c')
-rw-r--r--libavcodec/dvbsubdec.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libavcodec/dvbsubdec.c b/libavcodec/dvbsubdec.c
index ef90f73c1a..955925a619 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;