diff options
author | Takashi Mochizuki <mochi@da2.so-net.ne.jp> | 2011-02-13 09:18:45 +0900 |
---|---|---|
committer | Mans Rullgard <mans@mansr.com> | 2011-02-13 01:16:30 +0000 |
commit | 44b11207248c6ca6edb7d3469c0fbdca45dbfa70 (patch) | |
tree | 02baef5c42b472c5c8bfaf89564f83fd041aa481 /libavformat/movenc.c | |
parent | 47d62c965b7bcf4715127fbf9bffab7b4c5c88b7 (diff) | |
download | ffmpeg-44b11207248c6ca6edb7d3469c0fbdca45dbfa70.tar.gz |
movenc: Force first sample as SYNC
Signed-off-by: Mans Rullgard <mans@mansr.com>
Diffstat (limited to 'libavformat/movenc.c')
-rw-r--r-- | libavformat/movenc.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libavformat/movenc.c b/libavformat/movenc.c index 0949d29457..5e6e3a6521 100644 --- a/libavformat/movenc.c +++ b/libavformat/movenc.c @@ -1981,7 +1981,8 @@ int ff_mov_write_packet(AVFormatContext *s, AVPacket *pkt) trk->cluster[trk->entry].cts = pkt->pts - pkt->dts; trk->cluster[trk->entry].flags = 0; if (pkt->flags & AV_PKT_FLAG_KEY) { - if (mov->mode == MODE_MOV && enc->codec_id == CODEC_ID_MPEG2VIDEO) { + if (mov->mode == MODE_MOV && enc->codec_id == CODEC_ID_MPEG2VIDEO && + trk->entry > 0) { // force sync sample for the first key frame mov_parse_mpeg2_frame(pkt, &trk->cluster[trk->entry].flags); if (trk->cluster[trk->entry].flags & MOV_PARTIAL_SYNC_SAMPLE) trk->flags |= MOV_TRACK_STPS; |