diff options
author | Carl Eugen Hoyos <cehoyos@ag.or.at> | 2013-08-01 16:20:58 +0200 |
---|---|---|
committer | Carl Eugen Hoyos <cehoyos@ag.or.at> | 2013-08-01 16:20:58 +0200 |
commit | bb7f71d9b6aedf8e83061e326f09843fd21fcbce (patch) | |
tree | 7721ff64ea9e42c6516abe84b830899019750ba4 /libavformat/movenc.c | |
parent | 9408d990c46c1993259058e7d70c417d1030bb10 (diff) | |
download | ffmpeg-bb7f71d9b6aedf8e83061e326f09843fd21fcbce.tar.gz |
lavf/movenc: Write total number of tracks as part of metadata.
Fixes ticket #2157.
Diffstat (limited to 'libavformat/movenc.c')
-rw-r--r-- | libavformat/movenc.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/libavformat/movenc.c b/libavformat/movenc.c index 42ec3f23e7..e9f5b47582 100644 --- a/libavformat/movenc.c +++ b/libavformat/movenc.c @@ -2022,6 +2022,10 @@ static int mov_write_trkn_tag(AVIOContext *pb, MOVMuxContext *mov, AVDictionaryEntry *t = av_dict_get(s->metadata, "track", NULL, 0); int size = 0, track = t ? atoi(t->value) : 0; if (track) { + int tracks = 0; + char *slash = strchr(t->value, '/'); + if (slash) + tracks = atoi(slash + 1); avio_wb32(pb, 32); /* size */ ffio_wfourcc(pb, "trkn"); avio_wb32(pb, 24); /* size */ @@ -2030,7 +2034,7 @@ static int mov_write_trkn_tag(AVIOContext *pb, MOVMuxContext *mov, avio_wb32(pb, 0); avio_wb16(pb, 0); // empty avio_wb16(pb, track); // track number - avio_wb16(pb, 0); // total track number + avio_wb16(pb, tracks); // total track number avio_wb16(pb, 0); // empty size = 32; } |