summaryrefslogtreecommitdiff
path: root/libavcodec
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2015-07-29 17:59:51 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2015-07-29 18:02:07 +0200
commit1fc20af6af3ec31d0ee665557885b6c20c6d3686 (patch)
tree696f9327eaebf6c22dbdf16faad18c4aff96d124 /libavcodec
parentf4ada6dc3ff7a5c4193d2b30151a48de8e219c94 (diff)
avcodec/dvbsubdec: Implement display definition segment fallback from ETSI EN 300 743 V1.3.1
Fixes: subtitles.ts Fixes: Ticket679 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/dvbsubdec.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/libavcodec/dvbsubdec.c b/libavcodec/dvbsubdec.c
index e3b72ab1ff..ce03e12d4a 100644
--- a/libavcodec/dvbsubdec.c
+++ b/libavcodec/dvbsubdec.c
@@ -1606,6 +1606,7 @@ static int dvbsub_decode(AVCodecContext *avctx,
int i;
int ret = 0;
int got_segment = 0;
+ int got_dds = 0;
ff_dlog(avctx, "DVB sub packet:\n");
@@ -1668,9 +1669,15 @@ static int dvbsub_decode(AVCodecContext *avctx,
case DVBSUB_DISPLAYDEFINITION_SEGMENT:
ret = dvbsub_parse_display_definition_segment(avctx, p,
segment_length);
+ got_dds = 1;
break;
case DVBSUB_DISPLAY_SEGMENT:
ret = dvbsub_display_end_segment(avctx, p, segment_length, sub, data_size);
+ if (got_segment == 15 && !got_dds && !avctx->width && !avctx->height) {
+ // Default from ETSI EN 300 743 V1.3.1 (7.2.1)
+ avctx->width = 720;
+ avctx->height = 576;
+ }
got_segment |= 16;
break;
default: