Commit b50a4ca1 authored by Michael Niedermayer's avatar Michael Niedermayer

avformat/utils: Preserve packet duration when parsing is done only for headers

Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent c658269c
...@@ -1223,7 +1223,7 @@ static int parse_packet(AVFormatContext *s, AVPacket *pkt, int stream_index) ...@@ -1223,7 +1223,7 @@ static int parse_packet(AVFormatContext *s, AVPacket *pkt, int stream_index)
} }
/* set the duration */ /* set the duration */
out_pkt.duration = 0; out_pkt.duration = (st->parser->flags & PARSER_FLAG_COMPLETE_FRAMES) ? pkt->duration : 0;
if (st->codec->codec_type == AVMEDIA_TYPE_AUDIO) { if (st->codec->codec_type == AVMEDIA_TYPE_AUDIO) {
if (st->codec->sample_rate > 0) { if (st->codec->sample_rate > 0) {
out_pkt.duration = out_pkt.duration =
......
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment