Module: ffmpeg
Branch: master
Commit: 44b11207248c6ca6edb7d3469c0fbdca45dbfa70

Author: Takashi Mochizuki <[email protected]>
Date:   Sun Feb 13 09:18:45 2011 +0900

movenc: Force first sample as SYNC

Signed-off-by: Mans Rullgard <[email protected]>

---

 libavformat/movenc.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index 0949d29..5e6e3a6 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;

_______________________________________________
ffmpeg-commits mailing list
[email protected]
https://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-commits

Reply via email to