mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2024-12-26 17:32:06 +00:00
avcodec/utils: fix packet duration of frames with discarded paddings
Reviewed-by: Hendrik Leppkes <h.leppkes@gmail.com> Signed-off-by: Marton Balint <cus@passwd.hu>
This commit is contained in:
parent
cd76eb8f4a
commit
99f2a59c2f
@ -2337,8 +2337,7 @@ int attribute_align_arg avcodec_decode_audio4(AVCodecContext *avctx,
|
||||
int64_t diff_ts = av_rescale_q(frame->nb_samples - discard_padding,
|
||||
(AVRational){1, avctx->sample_rate},
|
||||
avctx->pkt_timebase);
|
||||
if (av_frame_get_pkt_duration(frame) >= diff_ts)
|
||||
av_frame_set_pkt_duration(frame, av_frame_get_pkt_duration(frame) - diff_ts);
|
||||
av_frame_set_pkt_duration(frame, diff_ts);
|
||||
} else {
|
||||
av_log(avctx, AV_LOG_WARNING, "Could not update timestamps for discarded samples.\n");
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user