From: Sebastian Dröge Date: Thu, 17 Jul 2014 08:53:30 +0000 (+0200) Subject: androidmedia: Handle queue/release errors non-fatal X-Git-Tag: 1.6.0~1012 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=774866ad62c3a0359705ef106584be3d6b3087e4;p=platform%2Fupstream%2Fgst-plugins-bad.git androidmedia: Handle queue/release errors non-fatal They can happen sometimes as a transient problem, e.g. if there is a problem in the stream. Only handle them as fatal if many of them happen in a row. --- diff --git a/sys/androidmedia/gstamcaudiodec.c b/sys/androidmedia/gstamcaudiodec.c index 034591e..d381eec 100644 --- a/sys/androidmedia/gstamcaudiodec.c +++ b/sys/androidmedia/gstamcaudiodec.c @@ -43,6 +43,16 @@ GST_DEBUG_CATEGORY_STATIC (gst_amc_audio_dec_debug_category); #define GST_CAT_DEFAULT gst_amc_audio_dec_debug_category +#define GST_AUDIO_DECODER_ERROR_FROM_ERROR(el, err) G_STMT_START { \ + gchar *__dbg = g_strdup (err->message); \ + GstAudioDecoder *__dec = GST_AUDIO_DECODER (el); \ + GST_WARNING_OBJECT (el, "error: %s", __dbg); \ + _gst_audio_decoder_error (__dec, 1, \ + err->domain, err->code, \ + NULL, __dbg, __FILE__, GST_FUNCTION, __LINE__); \ + g_clear_error (&err); \ +} G_STMT_END + /* prototypes */ static void gst_amc_audio_dec_finalize (GObject * object); @@ -630,7 +640,7 @@ format_error: } failed_release: { - GST_ELEMENT_ERROR_FROM_ERROR (self, err); + GST_AUDIO_DECODER_ERROR_FROM_ERROR (self, err); gst_pad_push_event (GST_AUDIO_DECODER_SRC_PAD (self), gst_event_new_eos ()); gst_pad_pause_task (GST_AUDIO_DECODER_SRC_PAD (self)); self->downstream_flow_ret = GST_FLOW_ERROR; @@ -1193,7 +1203,7 @@ dequeue_error: } queue_error: { - GST_ELEMENT_ERROR_FROM_ERROR (self, err); + GST_AUDIO_DECODER_ERROR_FROM_ERROR (self, err); if (minfo.data) gst_buffer_unmap (inbuf, &minfo); if (inbuf) diff --git a/sys/androidmedia/gstamcvideodec.c b/sys/androidmedia/gstamcvideodec.c index 00f9b18..a2ac65e 100644 --- a/sys/androidmedia/gstamcvideodec.c +++ b/sys/androidmedia/gstamcvideodec.c @@ -46,6 +46,16 @@ GST_DEBUG_CATEGORY_STATIC (gst_amc_video_dec_debug_category); #define GST_CAT_DEFAULT gst_amc_video_dec_debug_category +#define GST_VIDEO_DECODER_ERROR_FROM_ERROR(el, err) G_STMT_START { \ + gchar *__dbg = g_strdup (err->message); \ + GstVideoDecoder *__dec = GST_VIDEO_DECODER (el); \ + GST_WARNING_OBJECT (el, "error: %s", __dbg); \ + _gst_video_decoder_error (__dec, 1, \ + err->domain, err->code, \ + NULL, __dbg, __FILE__, GST_FUNCTION, __LINE__); \ + g_clear_error (&err); \ +} G_STMT_END + typedef struct _BufferIdentification BufferIdentification; struct _BufferIdentification { @@ -825,7 +835,7 @@ format_error: } failed_release: { - GST_ELEMENT_ERROR_FROM_ERROR (self, err); + GST_VIDEO_DECODER_ERROR_FROM_ERROR (self, err); gst_pad_push_event (GST_VIDEO_DECODER_SRC_PAD (self), gst_event_new_eos ()); gst_pad_pause_task (GST_VIDEO_DECODER_SRC_PAD (self)); self->downstream_flow_ret = GST_FLOW_ERROR; @@ -1304,7 +1314,7 @@ dequeue_error: } queue_error: { - GST_ELEMENT_ERROR_FROM_ERROR (self, err); + GST_VIDEO_DECODER_ERROR_FROM_ERROR (self, err); if (minfo.data) gst_buffer_unmap (frame->input_buffer, &minfo); gst_video_codec_frame_unref (frame);