]> git.sesse.net Git - ffmpeg/commitdiff
avcodec/utils: fix packet duration of frames with discarded paddings
authorMarton Balint <cus@passwd.hu>
Sun, 20 Mar 2016 13:48:08 +0000 (14:48 +0100)
committerMarton Balint <cus@passwd.hu>
Mon, 28 Mar 2016 21:40:12 +0000 (23:40 +0200)
Reviewed-by: Hendrik Leppkes <h.leppkes@gmail.com>
Signed-off-by: Marton Balint <cus@passwd.hu>
libavcodec/utils.c

index c625bbcc3becc670f8ec9646573c88edb003e8e4..073c6fa1a444e447de0248868cef158ebad3fef0 100644 (file)
@@ -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");
                 }