mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2026-02-08 02:39:57 +00:00
avformat/demux: don't overwrite packet durations with parser ones if unset
Prevents loss of values taken from the demuxer when the underlying parser doesn't set durations. Signed-off-by: James Almer <jamrial@gmail.com>
This commit is contained in:
parent
3fc7e39eb8
commit
b613eebe78
1 changed files with 1 additions and 1 deletions
|
|
@ -1265,7 +1265,7 @@ static int parse_packet(AVFormatContext *s, AVPacket *pkt,
|
|||
/* set the duration */
|
||||
out_pkt->duration = (sti->parser->flags & PARSER_FLAG_COMPLETE_FRAMES) ? pkt->duration : 0;
|
||||
if (st->codecpar->codec_type == AVMEDIA_TYPE_AUDIO) {
|
||||
if (sti->avctx->sample_rate > 0) {
|
||||
if (sti->avctx->sample_rate > 0 && sti->parser->duration > 0) {
|
||||
out_pkt->duration =
|
||||
av_rescale_q_rnd(sti->parser->duration,
|
||||
(AVRational) { 1, sti->avctx->sample_rate },
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue