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, 4 insertions(+), 4 deletions(-)

diff --git a/libavcodec/mmaldec.c b/libavcodec/mmaldec.c
index f4bf921..345edc1 100644
--- a/libavcodec/mmaldec.c
+++ b/libavcodec/mmaldec.c
@@ -326,6 +326,8 @@ static av_cold int ffmmal_init_decoder(AVCodecContext 
*avctx)
     MMAL_COMPONENT_T *decoder;
     int ret = 0;
 
+    avctx->internal->sets_pkt_dts = 1;
+
     bcm_host_init();
 
     if (mmal_vc_init()) {
@@ -621,10 +623,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;
-- 
2.5.1

_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to