From f75f860ff3791f47db3eb52602f0c5e6b9f35748 Mon Sep 17 00:00:00 2001 From: Thiago Santos Date: Wed, 2 Jul 2014 00:27:12 -0300 Subject: [PATCH] vtdec: ignore the dropped flag if buffer was received Apparently there is some issue with VT that makes it mark the dropped flag even though the buffer was decoded. https://bugzilla.gnome.org/show_bug.cgi?id=728435 --- sys/applemedia/vtdec.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/sys/applemedia/vtdec.c b/sys/applemedia/vtdec.c index 734b45cf2f..3d381b49c0 100644 --- a/sys/applemedia/vtdec.c +++ b/sys/applemedia/vtdec.c @@ -512,16 +512,21 @@ gst_vtdec_session_output_callback (void *decompression_output_ref_con, GstBuffer *buf; GstVideoCodecState *state; - GST_LOG_OBJECT (vtdec, "got output frame %p %d", frame, - frame->decode_frame_number); + GST_LOG_OBJECT (vtdec, "got output frame %p %d and VT buffer %p", frame, + frame->decode_frame_number, image_buffer); if (status != noErr) { GST_ERROR_OBJECT (vtdec, "Error decoding frame %d", status); goto drop; } - if (info_flags & kVTDecodeInfo_FrameDropped) + if (image_buffer == NULL) { + if (info_flags & kVTDecodeInfo_FrameDropped) + GST_DEBUG_OBJECT (vtdec, "Frame dropped by video toolbox"); + else + GST_DEBUG_OBJECT (vtdec, "Decoded frame is NULL"); goto drop; + } /* FIXME: use gst_video_decoder_allocate_output_buffer */ state = gst_video_decoder_get_output_state (GST_VIDEO_DECODER (vtdec));