aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarton Balint <cus@passwd.hu>2016-03-20 14:48:08 +0100
committerMarton Balint <cus@passwd.hu>2016-03-28 23:40:12 +0200
commit99f2a59c2f298c2a8c0d1058759fd0ae81bc8c2e (patch)
treeaa556df1dcdcdd5373b186c5204900af95475653
parentcd76eb8f4adbf4c22b0dee3acaf5d42047b5941b (diff)
downloadffmpeg-99f2a59c2f298c2a8c0d1058759fd0ae81bc8c2e.tar.gz
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>
-rw-r--r--libavcodec/utils.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index c625bbcc3b..073c6fa1a4 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");
}