mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-23 18:21:04 +00:00
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.
This commit is contained in:
parent
589407a077
commit
774866ad62
2 changed files with 24 additions and 4 deletions
|
@ -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)
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue