summaryrefslogtreecommitdiff
path: root/libavcodec/mediacodecdec_common.c
diff options
context:
space:
mode:
authorAman Gupta <aman@tmm1.net>2019-09-05 11:10:03 -0700
committerAman Gupta <aman@tmm1.net>2019-09-09 13:24:58 -0700
commit425be35c2648cf1aa9a155a016c8c222a24160c7 (patch)
tree25e8460d82c305a98086a087cd42bd86b85c79a0 /libavcodec/mediacodecdec_common.c
parent558265d4bc1aa3c6569e6eeea23127b030b23501 (diff)
downloadffmpeg-425be35c2648cf1aa9a155a016c8c222a24160c7.tar.gz
avcodec/mediacodecdec_common: warn when PTS is missing
MediaCodec decoders require PTS for proper operation. Signed-off-by: Aman Gupta <aman@tmm1.net> Signed-off-by: Matthieu Bouron <matthieu.bouron@gmail.com>
Diffstat (limited to 'libavcodec/mediacodecdec_common.c')
-rw-r--r--libavcodec/mediacodecdec_common.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/libavcodec/mediacodecdec_common.c b/libavcodec/mediacodecdec_common.c
index 1656cd6664..26870c956d 100644
--- a/libavcodec/mediacodecdec_common.c
+++ b/libavcodec/mediacodecdec_common.c
@@ -612,7 +612,11 @@ int ff_mediacodec_dec_send(AVCodecContext *avctx, MediaCodecDecContext *s,
}
pts = pkt->pts;
- if (pts != AV_NOPTS_VALUE && avctx->pkt_timebase.num && avctx->pkt_timebase.den) {
+ if (pts == AV_NOPTS_VALUE) {
+ av_log(avctx, AV_LOG_WARNING, "Input packet is missing PTS\n");
+ pts = 0;
+ }
+ if (pts && avctx->pkt_timebase.num && avctx->pkt_timebase.den) {
pts = av_rescale_q(pts, avctx->pkt_timebase, AV_TIME_BASE_Q);
}