diff options
author | Anton Khirnov <anton@khirnov.net> | 2011-04-04 22:29:21 +0200 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2011-04-07 18:11:24 +0200 |
commit | 9181976348cac563977a0450c90f27ad72018f1d (patch) | |
tree | f543ae9201f78208cbd95f036ec4a4f6ce142ba3 | |
parent | 9f5ddd1e460a7e25b838286d36bf3fbe17baaa76 (diff) | |
download | ffmpeg-9181976348cac563977a0450c90f27ad72018f1d.tar.gz |
matroskaenc: don't write an empty Cues element.
-rw-r--r-- | libavformat/matroskaenc.c | 9 | ||||
-rw-r--r-- | tests/ref/acodec/pcm | 8 |
2 files changed, 10 insertions, 7 deletions
diff --git a/libavformat/matroskaenc.c b/libavformat/matroskaenc.c index e28ac42a75..c0427f9854 100644 --- a/libavformat/matroskaenc.c +++ b/libavformat/matroskaenc.c @@ -1140,10 +1140,13 @@ static int mkv_write_trailer(AVFormatContext *s) } if (pb->seekable) { - cuespos = mkv_write_cues(pb, mkv->cues, s->nb_streams); + if (mkv->cues->num_entries) { + cuespos = mkv_write_cues(pb, mkv->cues, s->nb_streams); + + ret = mkv_add_seekhead_entry(mkv->main_seekhead, MATROSKA_ID_CUES, cuespos); + if (ret < 0) return ret; + } - ret = mkv_add_seekhead_entry(mkv->main_seekhead, MATROSKA_ID_CUES , cuespos); - if (ret < 0) return ret; mkv_write_seekhead(pb, mkv->main_seekhead); // update the duration diff --git a/tests/ref/acodec/pcm b/tests/ref/acodec/pcm index 1d876e4aca..033f8bc8c6 100644 --- a/tests/ref/acodec/pcm +++ b/tests/ref/acodec/pcm @@ -22,12 +22,12 @@ stddev: 0.00 PSNR:999.99 MAXDIFF: 0 bytes: 1058400/ 1058400 1058444 ./tests/data/acodec/pcm_s16le.wav 95e54b261530a1bcf6de6fe3b21dc5f6 *./tests/data/pcm.acodec.out.wav stddev: 0.00 PSNR:999.99 MAXDIFF: 0 bytes: 1058400/ 1058400 -352a6bcf51d0f3ca4bf27c423a3d4d14 *./tests/data/acodec/pcm_s16be.mkv - 1060650 ./tests/data/acodec/pcm_s16be.mkv +af717ca95eaca310772eb1238c745d1b *./tests/data/acodec/pcm_s16be.mkv +1060638 ./tests/data/acodec/pcm_s16be.mkv 95e54b261530a1bcf6de6fe3b21dc5f6 *./tests/data/pcm.acodec.out.wav stddev: 0.00 PSNR:999.99 MAXDIFF: 0 bytes: 1058400/ 1058400 -2c089d83b2699c02c9358415e00a9707 *./tests/data/acodec/pcm_s16le.mkv - 1060650 ./tests/data/acodec/pcm_s16le.mkv +c4f51bf32fad2f7af8ea5beedb56168b *./tests/data/acodec/pcm_s16le.mkv +1060638 ./tests/data/acodec/pcm_s16le.mkv 95e54b261530a1bcf6de6fe3b21dc5f6 *./tests/data/pcm.acodec.out.wav stddev: 0.00 PSNR:999.99 MAXDIFF: 0 bytes: 1058400/ 1058400 07ffe7ffb78f3648b6524debdde5aec1 *./tests/data/acodec/pcm_s24be.mov |