diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-11-21 00:15:05 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-11-21 03:21:23 +0100 |
commit | f0f75dfa344c42ca6f6d49155e4f6d97b955bf4f (patch) | |
tree | 0917b3248aeb0e4e59e2b7b272b3d429ad032a8a /libavformat | |
parent | 01923bab98506b1e98b4cbf08419364ce6ffea6d (diff) | |
download | ffmpeg-f0f75dfa344c42ca6f6d49155e4f6d97b955bf4f.tar.gz |
avformat/utils: inject audio skip side data before the side data merge code
This ensures that its handled the same way as other side data
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/utils.c | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/libavformat/utils.c b/libavformat/utils.c index bae23a10b5..ddaeb3bf87 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -1398,6 +1398,18 @@ static int read_frame_internal(AVFormatContext *s, AVPacket *pkt) if (!got_packet && s->parse_queue) ret = read_from_packet_buffer(&s->parse_queue, &s->parse_queue_end, pkt); + if (ret >= 0) { + AVStream *st = s->streams[pkt->stream_index]; + if (st->skip_samples) { + uint8_t *p = av_packet_new_side_data(pkt, AV_PKT_DATA_SKIP_SAMPLES, 10); + if (p) { + AV_WL32(p, st->skip_samples); + av_log(s, AV_LOG_DEBUG, "demuxer injecting skip %d\n", st->skip_samples); + } + st->skip_samples = 0; + } + } + if(ret >= 0 && !(s->flags & AVFMT_FLAG_KEEP_SIDE_DATA)) av_packet_merge_side_data(pkt); @@ -1490,15 +1502,6 @@ int av_read_frame(AVFormatContext *s, AVPacket *pkt) return_packet: st = s->streams[pkt->stream_index]; - if (st->skip_samples) { - uint8_t *p = av_packet_new_side_data(pkt, AV_PKT_DATA_SKIP_SAMPLES, 10); - if (p) { - AV_WL32(p, st->skip_samples); - av_log(s, AV_LOG_DEBUG, "demuxer injecting skip %d\n", st->skip_samples); - } - st->skip_samples = 0; - } - if ((s->iformat->flags & AVFMT_GENERIC_INDEX) && pkt->flags & AV_PKT_FLAG_KEY) { ff_reduce_index(s, st->index); av_add_index_entry(st, pkt->pos, pkt->dts, 0, 0, AVINDEX_KEYFRAME); |