summaryrefslogtreecommitdiff
path: root/libavcodec/mediacodecdec.c
diff options
context:
space:
mode:
authorHendrik Leppkes <h.leppkes@gmail.com>2016-10-07 12:55:50 +0200
committerHendrik Leppkes <h.leppkes@gmail.com>2016-10-07 13:03:36 +0200
commit3f9137c57d2344d7613f134128235c18edcede95 (patch)
treecc4bfcc63bd6080c74d5cb526f286a1f4c96d4df /libavcodec/mediacodecdec.c
parent04a3577263782cd6d70722d4ae18d75fee03dbc4 (diff)
parent32c8359093d1ff4f45ed19518b449b3ac3769d27 (diff)
Merge commit '32c8359093d1ff4f45ed19518b449b3ac3769d27'
* commit '32c8359093d1ff4f45ed19518b449b3ac3769d27': lavc: export the timestamps when decoding in AVFrame.pts Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
Diffstat (limited to 'libavcodec/mediacodecdec.c')
-rw-r--r--libavcodec/mediacodecdec.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/libavcodec/mediacodecdec.c b/libavcodec/mediacodecdec.c
index 223942b3bd..6683de7751 100644
--- a/libavcodec/mediacodecdec.c
+++ b/libavcodec/mediacodecdec.c
@@ -202,12 +202,17 @@ static int mediacodec_wrap_hw_buffer(AVCodecContext *avctx,
frame->format = avctx->pix_fmt;
if (avctx->pkt_timebase.num && avctx->pkt_timebase.den) {
- frame->pkt_pts = av_rescale_q(info->presentationTimeUs,
+ frame->pts = av_rescale_q(info->presentationTimeUs,
av_make_q(1, 1000000),
avctx->pkt_timebase);
} else {
- frame->pkt_pts = info->presentationTimeUs;
+ frame->pts = info->presentationTimeUs;
}
+#if FF_API_PKT_PTS
+FF_DISABLE_DEPRECATION_WARNINGS
+ frame->pkt_pts = frame->pts;
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif
frame->pkt_dts = AV_NOPTS_VALUE;
buffer = av_mallocz(sizeof(AVMediaCodecBuffer));
@@ -278,7 +283,12 @@ static int mediacodec_wrap_sw_buffer(AVCodecContext *avctx,
* on the last avpacket received which is not in sync with the frame:
* * N avpackets can be pushed before 1 frame is actually returned
* * 0-sized avpackets are pushed to flush remaining frames at EOS */
+ frame->pts = info->presentationTimeUs;
+#if FF_API_PKT_PTS
+FF_DISABLE_DEPRECATION_WARNINGS
frame->pkt_pts = info->presentationTimeUs;
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif
frame->pkt_dts = AV_NOPTS_VALUE;
av_log(avctx, AV_LOG_DEBUG,