summaryrefslogtreecommitdiff
path: root/libavcodec/utils.c
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2016-03-19 21:45:24 +0100
committerAnton Khirnov <anton@khirnov.net>2016-06-21 19:54:42 +0200
commit32c8359093d1ff4f45ed19518b449b3ac3769d27 (patch)
tree59886a4e26a0931902e6f6bb14a0319d111a7383 /libavcodec/utils.c
parentac7bfd69678f3966e38debdb27f4bde94dc0345c (diff)
lavc: export the timestamps when decoding in AVFrame.pts
Currently it's exported as AVFrame.pkt_pts, which is also the only use for that field. The reason it is done like this is that lavc used to export various codec-specific "timing" information in AVFrame.pts, which is not done anymore. Since it is confusing to the callers to have a separate field which is used only for decoder timestamps and nothing else, deprecate pkt_pts and use just AVFrame.pts everywhere.
Diffstat (limited to 'libavcodec/utils.c')
-rw-r--r--libavcodec/utils.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index 8f8efecbea..bc1beee462 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -551,11 +551,21 @@ int ff_decode_frame_props(AVCodecContext *avctx, AVFrame *frame)
frame->reordered_opaque = avctx->reordered_opaque;
if (!pkt) {
+#if FF_API_PKT_PTS
+FF_DISABLE_DEPRECATION_WARNINGS
frame->pkt_pts = AV_NOPTS_VALUE;
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif
+ frame->pts = AV_NOPTS_VALUE;
return 0;
}
+#if FF_API_PKT_PTS
+FF_DISABLE_DEPRECATION_WARNINGS
frame->pkt_pts = pkt->pts;
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif
+ frame->pts = pkt->pts;
for (i = 0; i < FF_ARRAY_ELEMS(sd); i++) {
int size;