Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwm4 <nfxjfg@googlemail.com>2016-10-05 12:35:54 +0300
committerwm4 <nfxjfg@googlemail.com>2016-10-05 12:35:54 +0300
commit40fbf3204208f89a0626f85ce6dd06ca0741583b (patch)
tree359364070fb74f5923cadd7be5f67a4a8d68605e /libavcodec/utils.c
parent5173ffb27f6e3ad25c1b947cda2fb9e196a7918a (diff)
lavc: set best effort timestamp if unset when using new decode API
Some API users (in particular ffmpeg.c) check the best effort timestamp only.
Diffstat (limited to 'libavcodec/utils.c')
-rw-r--r--libavcodec/utils.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index 6f4df93ae6..1239d490d6 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -2870,7 +2870,14 @@ int attribute_align_arg avcodec_receive_frame(AVCodecContext *avctx, AVFrame *fr
if (avctx->codec->receive_frame) {
if (avctx->internal->draining && !(avctx->codec->capabilities & AV_CODEC_CAP_DELAY))
return AVERROR_EOF;
- return avctx->codec->receive_frame(avctx, frame);
+ ret = avctx->codec->receive_frame(avctx, frame);
+ if (ret >= 0) {
+ if (av_frame_get_best_effort_timestamp(frame) == AV_NOPTS_VALUE) {
+ av_frame_set_best_effort_timestamp(frame,
+ guess_correct_pts(avctx, frame->pkt_pts, frame->pkt_dts));
+ }
+ }
+ return ret;
}
// Emulation via old API.