summaryrefslogtreecommitdiff
path: root/libavformat
diff options
context:
space:
mode:
authorTakashi Mochizuki <mochi@da2.so-net.ne.jp>2011-02-13 09:18:45 +0900
committerMichael Niedermayer <michaelni@gmx.at>2011-02-14 23:58:17 +0100
commit62bacc4e0cfe16509f3b43675f83d1ac9d19ff5b (patch)
treefcf52252881838b3af3ff3aebee3a44a94d1ecef /libavformat
parent6985d7bf873f4698caf3b54473f9aa89fabbd29a (diff)
movenc: Force first sample as SYNC
Signed-off-by: Mans Rullgard <mans@mansr.com> (cherry picked from commit 44b11207248c6ca6edb7d3469c0fbdca45dbfa70)
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/movenc.c3
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;