summaryrefslogtreecommitdiff
path: root/libavformat
diff options
context:
space:
mode:
authorClément Bœsch <ubitux@gmail.com>2013-01-01 16:15:39 +0100
committerClément Bœsch <ubitux@gmail.com>2013-01-01 16:20:10 +0100
commitc14f8a52b0aa40bdb9a6c6e692b3b0cef6c5cf3e (patch)
tree36ce536a355da5d7ab85257e692acfacd7b898dc /libavformat
parent8d398f40b4a18fec8467c8b074344e4e24853c46 (diff)
lavf/mov: fix timecode track reference usage.
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/mov.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/libavformat/mov.c b/libavformat/mov.c
index 97edcd3347..2d733264e6 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -3128,7 +3128,7 @@ static int mov_read_header(AVFormatContext *s)
{
MOVContext *mov = s->priv_data;
AVIOContext *pb = s->pb;
- int i, err;
+ int i, j, err;
MOVAtom atom = { AV_RL32("root") };
mov->fc = s;
@@ -3165,9 +3165,13 @@ static int mov_read_header(AVFormatContext *s)
MOVStreamContext *sc = st->priv_data;
if (sc->timecode_track > 0) {
AVDictionaryEntry *tcr;
- int tmcd_st_id = sc->timecode_track - 1;
+ int tmcd_st_id = -1;
- if (tmcd_st_id < 0 || tmcd_st_id >= s->nb_streams)
+ for (j = 0; j < s->nb_streams; j++)
+ if (s->streams[j]->id == sc->timecode_track)
+ tmcd_st_id = j;
+
+ if (tmcd_st_id < 0)
continue;
tcr = av_dict_get(s->streams[tmcd_st_id]->metadata, "timecode", NULL, 0);
if (tcr)