[FFmpeg-cvslog] avcodec/utils: fix packet duration of frames with discarded paddings
Marton Balint
git at videolan.org
Mon Mar 28 23:45:48 CEST 2016
ffmpeg | branch: master | Marton Balint <cus at passwd.hu> | Sun Mar 20 14:48:08 2016 +0100| [99f2a59c2f298c2a8c0d1058759fd0ae81bc8c2e] | committer: Marton Balint
avcodec/utils: fix packet duration of frames with discarded paddings
Reviewed-by: Hendrik Leppkes <h.leppkes at gmail.com>
Signed-off-by: Marton Balint <cus at passwd.hu>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=99f2a59c2f298c2a8c0d1058759fd0ae81bc8c2e
---
libavcodec/utils.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index c625bbc..073c6fa 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -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");
}
More information about the ffmpeg-cvslog
mailing list