summaryrefslogtreecommitdiffstats
path: root/ext/timidity
diff options
context:
space:
mode:
authorTim-Philipp Müller <tim@centricular.net>2007-06-08 16:49:41 +0000
committerTim-Philipp Müller <tim@centricular.net>2007-06-08 16:49:41 +0000
commit0f7d9f156a06d0226b1a2b3b70e2786b9bf71e2b (patch)
tree5624e999e5b670a36c270a07c523d6132d52ec1f /ext/timidity
parent5210165feb20efb9ce1243a1aae003ff43c40ba7 (diff)
downloadgst-plugins-bad-0f7d9f156a06d0226b1a2b3b70e2786b9bf71e2b.tar.gz
gst-plugins-bad-0f7d9f156a06d0226b1a2b3b70e2786b9bf71e2b.tar.bz2
gst-plugins-bad-0f7d9f156a06d0226b1a2b3b70e2786b9bf71e2b.zip
When driving the pipeline, also post an error when we get a not-linked flow return from downstream.
Original commit message from CVS: * ext/timidity/gsttimidity.c: (gst_timidity_loop): * ext/timidity/gstwildmidi.c: (gst_wildmidi_loop): * gst/tta/gstttaparse.c: (gst_tta_parse_loop): When driving the pipeline, also post an error when we get a not-linked flow return from downstream.
Diffstat (limited to 'ext/timidity')
-rw-r--r--ext/timidity/gsttimidity.c23
-rw-r--r--ext/timidity/gstwildmidi.c23
2 files changed, 30 insertions, 16 deletions
diff --git a/ext/timidity/gsttimidity.c b/ext/timidity/gsttimidity.c
index 8b8ed316..06541f2e 100644
--- a/ext/timidity/gsttimidity.c
+++ b/ext/timidity/gsttimidity.c
@@ -697,18 +697,25 @@ gst_timidity_loop (GstPad * sinkpad)
gst_buffer_set_caps (out, timidity->out_caps);
ret = gst_pad_push (timidity->srcpad, out);
- if (ret == GST_FLOW_OK)
- return;
+ if (GST_FLOW_IS_FATAL (ret) || ret == GST_FLOW_NOT_LINKED)
+ goto error;
+
+ return;
- if (GST_FLOW_IS_FATAL (ret)) {
+paused:
+ {
+ GST_DEBUG_OBJECT (timidity, "pausing task");
+ gst_pad_pause_task (timidity->sinkpad);
+ return;
+ }
+error:
+ {
GST_ELEMENT_ERROR (timidity, STREAM, FAILED,
- ("Internal data stream error XXX"),
+ ("Internal data stream error"),
("Streaming stopped, reason %s", gst_flow_get_name (ret)));
+ gst_pad_push_event (timidity->srcpad, gst_event_new_eos ());
+ goto paused;
}
-
-paused:
- GST_LOG_OBJECT (timidity, "pausing task");
- gst_pad_pause_task (timidity->sinkpad);
}
static GstStateChangeReturn
diff --git a/ext/timidity/gstwildmidi.c b/ext/timidity/gstwildmidi.c
index 9d830298..2ef80db1 100644
--- a/ext/timidity/gstwildmidi.c
+++ b/ext/timidity/gstwildmidi.c
@@ -672,18 +672,25 @@ gst_wildmidi_loop (GstPad * sinkpad)
gst_buffer_set_caps (out, wildmidi->out_caps);
ret = gst_pad_push (wildmidi->srcpad, out);
- if (ret == GST_FLOW_OK)
- return;
+ if (GST_FLOW_IS_FATAL (ret) || ret == GST_FLOW_NOT_LINKED)
+ goto error;
+
+ return;
- if (GST_FLOW_IS_FATAL (ret)) {
+paused:
+ {
+ GST_DEBUG_OBJECT (wildmidi, "pausing task");
+ gst_pad_pause_task (wildmidi->sinkpad);
+ return;
+ }
+error:
+ {
GST_ELEMENT_ERROR (wildmidi, STREAM, FAILED,
- ("Internal data stream error XXX"),
+ ("Internal data stream error"),
("Streaming stopped, reason %s", gst_flow_get_name (ret)));
+ gst_pad_push_event (wildmidi->srcpad, gst_event_new_eos ());
+ goto paused;
}
-
-paused:
- GST_LOG_OBJECT (wildmidi, "pausing task");
- gst_pad_pause_task (wildmidi->sinkpad);
}
static GstStateChangeReturn