diff --git a/omx/gstomxaudioenc.c b/omx/gstomxaudioenc.c index 538902cab7..2c99664b52 100644 --- a/omx/gstomxaudioenc.c +++ b/omx/gstomxaudioenc.c @@ -534,15 +534,20 @@ flow_error: gst_pad_push_event (GST_AUDIO_ENCODER_SRC_PAD (self), gst_event_new_eos ()); gst_pad_pause_task (GST_AUDIO_ENCODER_SRC_PAD (self)); - } else if (flow_ret == GST_FLOW_NOT_LINKED || flow_ret < GST_FLOW_EOS) { + self->started = FALSE; + } else if (flow_ret < GST_FLOW_EOS) { GST_ELEMENT_ERROR (self, STREAM, FAILED, ("Internal data stream error."), ("stream stopped, reason %s", gst_flow_get_name (flow_ret))); gst_pad_push_event (GST_AUDIO_ENCODER_SRC_PAD (self), gst_event_new_eos ()); gst_pad_pause_task (GST_AUDIO_ENCODER_SRC_PAD (self)); + self->started = FALSE; + } else if (flow_ret == GST_FLOW_FLUSHING) { + GST_DEBUG_OBJECT (self, "Flushing -- stopping task"); + gst_pad_pause_task (GST_AUDIO_ENCODER_SRC_PAD (self)); + self->started = FALSE; } - self->started = FALSE; GST_AUDIO_ENCODER_STREAM_UNLOCK (self); return; } diff --git a/omx/gstomxvideodec.c b/omx/gstomxvideodec.c index bb2542dfab..bf44b3d255 100644 --- a/omx/gstomxvideodec.c +++ b/omx/gstomxvideodec.c @@ -2177,7 +2177,8 @@ flow_error: gst_pad_push_event (GST_VIDEO_DECODER_SRC_PAD (self), gst_event_new_eos ()); gst_pad_pause_task (GST_VIDEO_DECODER_SRC_PAD (self)); - } else if (flow_ret == GST_FLOW_NOT_LINKED || flow_ret < GST_FLOW_EOS) { + self->started = FALSE; + } else if (flow_ret < GST_FLOW_EOS) { GST_ELEMENT_ERROR (self, STREAM, FAILED, ("Internal data stream error."), ("stream stopped, reason %s", gst_flow_get_name (flow_ret))); @@ -2185,8 +2186,12 @@ flow_error: 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->started = FALSE; + } else if (flow_ret == GST_FLOW_FLUSHING) { + GST_DEBUG_OBJECT (self, "Flushing -- stopping task"); + gst_pad_pause_task (GST_VIDEO_DECODER_SRC_PAD (self)); + self->started = FALSE; } - self->started = FALSE; GST_VIDEO_DECODER_STREAM_UNLOCK (self); return; } diff --git a/omx/gstomxvideoenc.c b/omx/gstomxvideoenc.c index 82dbf54d49..a85e815579 100644 --- a/omx/gstomxvideoenc.c +++ b/omx/gstomxvideoenc.c @@ -928,15 +928,20 @@ flow_error: gst_pad_push_event (GST_VIDEO_ENCODER_SRC_PAD (self), gst_event_new_eos ()); gst_pad_pause_task (GST_VIDEO_ENCODER_SRC_PAD (self)); - } else if (flow_ret == GST_FLOW_NOT_LINKED || flow_ret < GST_FLOW_EOS) { + self->started = FALSE; + } else if (flow_ret < GST_FLOW_EOS) { GST_ELEMENT_ERROR (self, STREAM, FAILED, ("Internal data stream error."), ("stream stopped, reason %s", gst_flow_get_name (flow_ret))); gst_pad_push_event (GST_VIDEO_ENCODER_SRC_PAD (self), gst_event_new_eos ()); gst_pad_pause_task (GST_VIDEO_ENCODER_SRC_PAD (self)); + self->started = FALSE; + } else if (flow_ret == GST_FLOW_FLUSHING) { + GST_DEBUG_OBJECT (self, "Flushing -- stopping task"); + gst_pad_pause_task (GST_VIDEO_ENCODER_SRC_PAD (self)); + self->started = FALSE; } - self->started = FALSE; GST_VIDEO_ENCODER_STREAM_UNLOCK (self); return; }