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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer
2015-04-15 00:06:17 +02:00
parent c658269cd1
commit b50a4ca179
3 changed files with 193 additions and 193 deletions

View File

@@ -1223,7 +1223,7 @@ static int parse_packet(AVFormatContext *s, AVPacket *pkt, int stream_index)
}
/* 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->sample_rate > 0) {
out_pkt.duration =