mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-11 09:55:36 +00:00
gst/wavparse/gstwavparse.c: Don't push EOS from the chain function, the element driving the pipeline is responsible f...
Original commit message from CVS: * gst/wavparse/gstwavparse.c: (gst_wavparse_loop), (gst_wavparse_chain): Don't push EOS from the chain function, the element driving the pipeline is responsible for this. The bug this was meant to fix seems to be queue not forwarding EOS in all cases (see #476514).
This commit is contained in:
parent
80dc806b65
commit
233644df33
2 changed files with 41 additions and 42 deletions
|
@ -1,3 +1,12 @@
|
|||
2007-09-14 Sebastian Dröge <slomo@circular-chaos.org>
|
||||
|
||||
* gst/wavparse/gstwavparse.c: (gst_wavparse_loop),
|
||||
(gst_wavparse_chain):
|
||||
Don't push EOS from the chain function, the element
|
||||
driving the pipeline is responsible for this. The bug
|
||||
this was meant to fix seems to be queue not forwarding
|
||||
EOS in all cases (see #476514).
|
||||
|
||||
2007-09-13 Wim Taymans <wim.taymans@gmail.com>
|
||||
|
||||
* gst/level/gstlevel.c: (gst_level_class_init), (gst_level_start),
|
||||
|
|
|
@ -1702,43 +1702,6 @@ push_error:
|
|||
}
|
||||
}
|
||||
|
||||
static void
|
||||
gst_wavparse_perform_eos (GstWavParse * wav, GstFlowReturn ret)
|
||||
{
|
||||
if (GST_FLOW_IS_FATAL (ret) || ret == GST_FLOW_NOT_LINKED) {
|
||||
if (ret == GST_FLOW_UNEXPECTED) {
|
||||
/* add pad before we perform EOS */
|
||||
if (G_UNLIKELY (wav->first)) {
|
||||
wav->first = FALSE;
|
||||
gst_wavparse_add_src_pad (wav, NULL);
|
||||
}
|
||||
/* perform EOS logic */
|
||||
if (wav->segment.flags & GST_SEEK_FLAG_SEGMENT) {
|
||||
GstClockTime stop;
|
||||
|
||||
if ((stop = wav->segment.stop) == -1)
|
||||
stop = wav->segment.duration;
|
||||
|
||||
gst_element_post_message (GST_ELEMENT_CAST (wav),
|
||||
gst_message_new_segment_done (GST_OBJECT_CAST (wav),
|
||||
wav->segment.format, stop));
|
||||
} else {
|
||||
if (wav->srcpad != NULL)
|
||||
gst_pad_push_event (wav->srcpad, gst_event_new_eos ());
|
||||
}
|
||||
} else {
|
||||
/* for fatal errors we post an error message, post the error
|
||||
* first so the app knows about the error first. */
|
||||
GST_ELEMENT_ERROR (wav, STREAM, FAILED,
|
||||
(_("Internal data flow error.")),
|
||||
("streaming task paused, reason %s (%d)", gst_flow_get_name (ret),
|
||||
ret));
|
||||
if (wav->srcpad != NULL)
|
||||
gst_pad_push_event (wav->srcpad, gst_event_new_eos ());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
gst_wavparse_loop (GstPad * pad)
|
||||
{
|
||||
|
@ -1783,7 +1746,37 @@ pause:
|
|||
wav->segment_running = FALSE;
|
||||
gst_pad_pause_task (pad);
|
||||
|
||||
gst_wavparse_perform_eos (wav, ret);
|
||||
if (GST_FLOW_IS_FATAL (ret) || ret == GST_FLOW_NOT_LINKED) {
|
||||
if (ret == GST_FLOW_UNEXPECTED) {
|
||||
/* add pad before we perform EOS */
|
||||
if (G_UNLIKELY (wav->first)) {
|
||||
wav->first = FALSE;
|
||||
gst_wavparse_add_src_pad (wav, NULL);
|
||||
}
|
||||
/* perform EOS logic */
|
||||
if (wav->segment.flags & GST_SEEK_FLAG_SEGMENT) {
|
||||
GstClockTime stop;
|
||||
|
||||
if ((stop = wav->segment.stop) == -1)
|
||||
stop = wav->segment.duration;
|
||||
|
||||
gst_element_post_message (GST_ELEMENT_CAST (wav),
|
||||
gst_message_new_segment_done (GST_OBJECT_CAST (wav),
|
||||
wav->segment.format, stop));
|
||||
} else {
|
||||
if (wav->srcpad != NULL)
|
||||
gst_pad_push_event (wav->srcpad, gst_event_new_eos ());
|
||||
}
|
||||
} else {
|
||||
/* for fatal errors we post an error message, post the error
|
||||
* first so the app knows about the error first. */
|
||||
GST_ELEMENT_ERROR (wav, STREAM, FAILED,
|
||||
(_("Internal data flow error.")),
|
||||
("streaming task paused, reason %s (%d)", reason, ret));
|
||||
if (wav->srcpad != NULL)
|
||||
gst_pad_push_event (wav->srcpad, gst_event_new_eos ());
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -1822,14 +1815,11 @@ gst_wavparse_chain (GstPad * pad, GstBuffer * buf)
|
|||
/* fall-through */
|
||||
case GST_WAVPARSE_DATA:
|
||||
if ((ret = gst_wavparse_stream_data (wav)) != GST_FLOW_OK)
|
||||
goto eos;
|
||||
goto done;
|
||||
break;
|
||||
default:
|
||||
g_assert_not_reached ();
|
||||
}
|
||||
eos:
|
||||
gst_wavparse_perform_eos (wav, ret);
|
||||
/* fallthrough */
|
||||
done:
|
||||
return ret;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue