This also drops setting the frame->pts field. This is usually not set by
decoders, so this would be an inconsistency that's at worst a danger to
the API user.
It appears the buffer->dts field is normally not set by the MMAL
decoder, but keep the code for symmetry and in case a MMAL decoder
possibly sets it in the future.
---
libavcodec/mmaldec.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/libavcodec/mmaldec.c b/libavcodec/mmaldec.c
index f4bf921..9ecedbd 100644
--- a/libavcodec/mmaldec.c
+++ b/libavcodec/mmaldec.c
@@ -621,10 +621,8 @@ static int ffmal_copy_frame(AVCodecContext *avctx,
AVFrame *frame,
}
}
- if (buffer->pts != MMAL_TIME_UNKNOWN) {
- frame->pkt_pts = buffer->pts;
- frame->pts = buffer->pts;
- }
+ frame->pkt_pts = buffer->pts == MMAL_TIME_UNKNOWN ? AV_NOPTS_VALUE :
buffer->pts;
+ frame->pkt_dts = buffer->dts == MMAL_TIME_UNKNOWN ? AV_NOPTS_VALUE :
buffer->dts;
done:
return ret;
@@ -791,7 +789,7 @@ AVCodec ff_h264_mmal_decoder = {
.decode = ffmmal_decode,
.flush = ffmmal_flush,
.priv_class = &ffmmaldec_class,
- .capabilities = AV_CODEC_CAP_DELAY,
+ .capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_DECODER_SETS_PKT_DTS,
.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_MMAL,
AV_PIX_FMT_YUV420P,
AV_PIX_FMT_NONE},
--
2.5.1
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel