aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/matroskaenc.c
diff options
context:
space:
mode:
authorJames Almer <jamrial@gmail.com>2016-10-03 19:20:11 -0300
committerJames Almer <jamrial@gmail.com>2016-10-06 17:05:03 -0300
commit87ce2595de2c307d7b9c28d9a11b38eee5f1a38d (patch)
treea5ef8ca2d4611346139d9c642b5e79abc43e8eb9 /libavformat/matroskaenc.c
parent79248795d4af6ef4782c528e872dfcc9bbd46d68 (diff)
downloadffmpeg-87ce2595de2c307d7b9c28d9a11b38eee5f1a38d.tar.gz
avformat/matroskaenc: write a CRC32 element on Tracks
Implements part of ticket #4347 Tested-by: Dave Rice <dave@dericed.com> Tested-by: Jerome Martinez <jerome@mediaarea.net> Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libavformat/matroskaenc.c')
-rw-r--r--libavformat/matroskaenc.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/libavformat/matroskaenc.c b/libavformat/matroskaenc.c
index 5009ebc6fc..b3a3b941b1 100644
--- a/libavformat/matroskaenc.c
+++ b/libavformat/matroskaenc.c
@@ -1242,7 +1242,7 @@ static int mkv_write_track(AVFormatContext *s, MatroskaMuxContext *mkv,
static int mkv_write_tracks(AVFormatContext *s)
{
MatroskaMuxContext *mkv = s->priv_data;
- AVIOContext *pb = s->pb;
+ AVIOContext *dyn_cp, *pb = s->pb;
ebml_master tracks;
int i, ret, default_stream_exists = 0;
@@ -1250,17 +1250,20 @@ static int mkv_write_tracks(AVFormatContext *s)
if (ret < 0)
return ret;
- tracks = start_ebml_master(pb, MATROSKA_ID_TRACKS, 0);
+ ret = start_ebml_master_crc32(pb, &dyn_cp, &tracks, MATROSKA_ID_TRACKS, 0);
+ if (ret < 0)
+ return ret;
+
for (i = 0; i < s->nb_streams; i++) {
AVStream *st = s->streams[i];
default_stream_exists |= st->disposition & AV_DISPOSITION_DEFAULT;
}
for (i = 0; i < s->nb_streams; i++) {
- ret = mkv_write_track(s, mkv, i, pb, default_stream_exists);
+ ret = mkv_write_track(s, mkv, i, dyn_cp, default_stream_exists);
if (ret < 0)
return ret;
}
- end_ebml_master(pb, tracks);
+ end_ebml_master_crc32(pb, &dyn_cp, mkv, tracks);
return 0;
}