diff options
author | Sebastian Dröge <sebastian@centricular.com> | 2014-01-25 17:44:14 +0100 |
---|---|---|
committer | Sebastian Dröge <sebastian@centricular.com> | 2014-01-25 17:44:57 +0100 |
commit | 1bf4edf7218f6bd65d4d04d35749eb0264e382e5 (patch) | |
tree | eea1b21282720683013b7007443ed6761f167f6c | |
parent | 8b4ef3e1e563d712ae37e371bc33f81121944201 (diff) |
omx: Don't handle FLUSHING and NOT_LINKED as errors
Also don't stop the task on NOT_LINKED. We're not a demuxer.
-rw-r--r-- | omx/gstomxaudioenc.c | 9 | ||||
-rw-r--r-- | omx/gstomxvideodec.c | 9 | ||||
-rw-r--r-- | omx/gstomxvideoenc.c | 9 |
3 files changed, 21 insertions, 6 deletions
diff --git a/omx/gstomxaudioenc.c b/omx/gstomxaudioenc.c index 538902c..2c99664 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 bb2542d..bf44b3d 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 82dbf54..a85e815 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; } |