mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-20 07:16:55 +00:00
ext/ffmpeg/gstffmpegdemux.c: Fix demuxer to stop properly (emit an error message on the bus) if no pads are linked. U...
Original commit message from CVS: * ext/ffmpeg/gstffmpegdemux.c: (gst_ffmpegdemux_loop): Fix demuxer to stop properly (emit an error message on the bus) if no pads are linked. Use aggregated flow return values a bit more.
This commit is contained in:
parent
ecadbbced7
commit
4b12fdb186
2 changed files with 27 additions and 21 deletions
|
@ -1,3 +1,9 @@
|
||||||
|
2007-12-18 Edward Hervey <edward.hervey@collabora.co.uk>
|
||||||
|
|
||||||
|
* ext/ffmpeg/gstffmpegdemux.c: (gst_ffmpegdemux_loop):
|
||||||
|
Fix demuxer to stop properly (emit an error message on the bus) if no
|
||||||
|
pads are linked. Use aggregated flow return values a bit more.
|
||||||
|
|
||||||
2007-12-18 Tim-Philipp Müller <tim at centricular dot net>
|
2007-12-18 Tim-Philipp Müller <tim at centricular dot net>
|
||||||
|
|
||||||
* Makefile.am:
|
* Makefile.am:
|
||||||
|
|
|
@ -1233,12 +1233,10 @@ gst_ffmpegdemux_loop (GstPad * pad)
|
||||||
else
|
else
|
||||||
outsize = pkt.size;
|
outsize = pkt.size;
|
||||||
|
|
||||||
ret = gst_pad_alloc_buffer_and_set_caps (srcpad,
|
stream->last_flow = gst_pad_alloc_buffer_and_set_caps (srcpad,
|
||||||
GST_CLOCK_TIME_NONE, outsize, GST_PAD_CAPS (srcpad), &outbuf);
|
GST_CLOCK_TIME_NONE, outsize, GST_PAD_CAPS (srcpad), &outbuf);
|
||||||
/* we can ignore not linked */
|
|
||||||
if (ret == GST_FLOW_NOT_LINKED)
|
if ((ret = gst_ffmpegdemux_aggregated_flow (demux)) != GST_FLOW_OK)
|
||||||
goto done;
|
|
||||||
if (ret != GST_FLOW_OK)
|
|
||||||
goto no_buffer;
|
goto no_buffer;
|
||||||
|
|
||||||
/* copy the data from packet into the target buffer
|
/* copy the data from packet into the target buffer
|
||||||
|
@ -1314,6 +1312,7 @@ pause:
|
||||||
demux->running = FALSE;
|
demux->running = FALSE;
|
||||||
gst_pad_pause_task (demux->sinkpad);
|
gst_pad_pause_task (demux->sinkpad);
|
||||||
|
|
||||||
|
if (GST_FLOW_IS_FATAL (ret) || ret == GST_FLOW_NOT_LINKED) {
|
||||||
if (ret == GST_FLOW_UNEXPECTED) {
|
if (ret == GST_FLOW_UNEXPECTED) {
|
||||||
if (demux->segment.flags & GST_SEEK_FLAG_SEGMENT) {
|
if (demux->segment.flags & GST_SEEK_FLAG_SEGMENT) {
|
||||||
gint64 stop;
|
gint64 stop;
|
||||||
|
@ -1329,12 +1328,13 @@ pause:
|
||||||
GST_LOG_OBJECT (demux, "pushing eos");
|
GST_LOG_OBJECT (demux, "pushing eos");
|
||||||
gst_ffmpegdemux_push_event (demux, gst_event_new_eos ());
|
gst_ffmpegdemux_push_event (demux, gst_event_new_eos ());
|
||||||
}
|
}
|
||||||
} else if (GST_FLOW_IS_FATAL (ret)) {
|
} else {
|
||||||
GST_ELEMENT_ERROR (demux, STREAM, FAILED,
|
GST_ELEMENT_ERROR (demux, STREAM, FAILED,
|
||||||
("Internal data stream error."),
|
("Internal data stream error."),
|
||||||
("streaming stopped, reason %s", gst_flow_get_name (ret)));
|
("streaming stopped, reason %s", gst_flow_get_name (ret)));
|
||||||
gst_ffmpegdemux_push_event (demux, gst_event_new_eos ());
|
gst_ffmpegdemux_push_event (demux, gst_event_new_eos ());
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
open_failed:
|
open_failed:
|
||||||
|
@ -1352,7 +1352,7 @@ read_failed:
|
||||||
if (demux->flushing)
|
if (demux->flushing)
|
||||||
ret = GST_FLOW_WRONG_STATE;
|
ret = GST_FLOW_WRONG_STATE;
|
||||||
else
|
else
|
||||||
ret = GST_FLOW_UNEXPECTED;
|
ret = GST_FLOW_ERROR;
|
||||||
GST_OBJECT_UNLOCK (demux);
|
GST_OBJECT_UNLOCK (demux);
|
||||||
|
|
||||||
goto pause;
|
goto pause;
|
||||||
|
|
Loading…
Reference in a new issue