diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2015-03-10 11:27:03 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2015-03-10 11:28:24 +0100 |
commit | 8d026861f5c2afa3f445e2ffdc67b563b06e2dcb (patch) | |
tree | ddc971bf8cde959f92003e1ef3bb1a91fe23599c /libavformat/movenc.c | |
parent | ebdae73125bd8fb71be72a5d9ae64c6fc7ccc130 (diff) | |
parent | 0c5e380c2c266d2e8a13c000cc527529db837f10 (diff) | |
download | ffmpeg-streaming-8d026861f5c2afa3f445e2ffdc67b563b06e2dcb.zip ffmpeg-streaming-8d026861f5c2afa3f445e2ffdc67b563b06e2dcb.tar.gz |
Merge commit '0c5e380c2c266d2e8a13c000cc527529db837f10'
* commit '0c5e380c2c266d2e8a13c000cc527529db837f10':
movenc: Don't rely on the fragment index for vc1 info gathering
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/movenc.c')
-rw-r--r-- | libavformat/movenc.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/libavformat/movenc.c b/libavformat/movenc.c index 8c869ed..2230cad 100644 --- a/libavformat/movenc.c +++ b/libavformat/movenc.c @@ -3988,7 +3988,7 @@ static int mov_parse_mpeg2_frame(AVPacket *pkt, uint32_t *flags) return 0; } -static void mov_parse_vc1_frame(AVPacket *pkt, MOVTrack *trk, int fragment) +static void mov_parse_vc1_frame(AVPacket *pkt, MOVTrack *trk) { const uint8_t *start, *next, *end = pkt->data + pkt->size; int seq = 0, entry = 0; @@ -4008,10 +4008,13 @@ static void mov_parse_vc1_frame(AVPacket *pkt, MOVTrack *trk, int fragment) break; } } - if (!trk->entry && !fragment) { + if (!trk->entry && trk->vc1_info.first_packet_seen) + trk->vc1_info.first_frag_written = 1; + if (!trk->entry && !trk->vc1_info.first_frag_written) { /* First packet in first fragment */ trk->vc1_info.first_packet_seq = seq; trk->vc1_info.first_packet_entry = entry; + trk->vc1_info.first_packet_seen = 1; } else if ((seq && !trk->vc1_info.packet_seq) || (entry && !trk->vc1_info.packet_entry)) { int i; @@ -4022,7 +4025,7 @@ static void mov_parse_vc1_frame(AVPacket *pkt, MOVTrack *trk, int fragment) trk->vc1_info.packet_seq = 1; if (entry) trk->vc1_info.packet_entry = 1; - if (!fragment) { + if (!trk->vc1_info.first_frag_written) { /* First fragment */ if ((!seq || trk->vc1_info.first_packet_seq) && (!entry || trk->vc1_info.first_packet_entry)) { @@ -4386,7 +4389,7 @@ int ff_mov_write_packet(AVFormatContext *s, AVPacket *pkt) trk->start_cts = pkt->pts - pkt->dts; if (enc->codec_id == AV_CODEC_ID_VC1) { - mov_parse_vc1_frame(pkt, trk, mov->fragments); + mov_parse_vc1_frame(pkt, trk); } else if (pkt->flags & AV_PKT_FLAG_KEY) { if (mov->mode == MODE_MOV && enc->codec_id == AV_CODEC_ID_MPEG2VIDEO && trk->entry > 0) { // force sync sample for the first key frame |