summaryrefslogtreecommitdiff
path: root/libavformat/mov.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-03-20 07:05:36 +0000
committerVittorio Giovara <vittorio.giovara@gmail.com>2014-03-31 01:08:18 +0200
commitfce28c3c6d603b7f42a5dbe36bf240d0470469c8 (patch)
tree33bde477f70ed9674f37498146a163e3358495e7 /libavformat/mov.c
parent96138e8c8da4b9397e627c934a33c22988d1192b (diff)
mov: fill in subtitle dimensions after parsing tkhd
Sample-Id: NeroRecodeSample.mp4
Diffstat (limited to 'libavformat/mov.c')
-rw-r--r--libavformat/mov.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/libavformat/mov.c b/libavformat/mov.c
index 6375847b27..8fc096fba4 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -2857,6 +2857,7 @@ static int mov_read_header(AVFormatContext *s)
AVIOContext *pb = s->pb;
int err;
MOVAtom atom = { AV_RL32("root") };
+ int i;
mov->fc = s;
/* .mov and .mp4 aren't streamable anyway (only progressive download if moov is before mdat) */
@@ -2881,8 +2882,19 @@ static int mov_read_header(AVFormatContext *s)
if (pb->seekable && mov->chapter_track > 0)
mov_read_chapters(s);
+ for (i = 0; i < s->nb_streams; i++) {
+ AVStream *st = s->streams[i];
+ MOVStreamContext *sc = st->priv_data;
+
+ if (st->codec->codec_type == AVMEDIA_TYPE_SUBTITLE) {
+ if (st->codec->width <= 0 && st->codec->width <= 0) {
+ st->codec->width = sc->width;
+ st->codec->height = sc->height;
+ }
+ }
+ }
+
if (mov->trex_data) {
- int i;
for (i = 0; i < s->nb_streams; i++) {
AVStream *st = s->streams[i];
MOVStreamContext *sc = st->priv_data;