diff options
author | Anton Khirnov <anton@khirnov.net> | 2011-04-05 00:29:21 +0400 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2011-04-07 20:11:24 +0400 |
commit | 9181976348cac563977a0450c90f27ad72018f1d (patch) | |
tree | f543ae9201f78208cbd95f036ec4a4f6ce142ba3 /libavformat | |
parent | 9f5ddd1e460a7e25b838286d36bf3fbe17baaa76 (diff) |
matroskaenc: don't write an empty Cues element.
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/matroskaenc.c | 9 |
1 files changed, 6 insertions, 3 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 |