From: <bi...@ke...> - 2007-12-18 10:05:37
|
CVS Root: /cvs/gstreamer Module: gst-ffmpeg Changes by: bilboed Date: Tue Dec 18 2007 10:05:42 UTC Log message: * 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. Modified files: . : ChangeLog ext/ffmpeg : gstffmpegdemux.c Links: http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-ffmpeg/ChangeLog.diff?r1=1.419&r2=1.420 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-ffmpeg/ext/ffmpeg/gstffmpegdemux.c.diff?r1=1.83&r2=1.84 ====Begin Diffs==== Index: ChangeLog =================================================================== RCS file: /cvs/gstreamer/gst-ffmpeg/ChangeLog,v retrieving revision 1.419 retrieving revision 1.420 diff -u -d -r1.419 -r1.420 --- ChangeLog 18 Dec 2007 09:31:39 -0000 1.419 +++ ChangeLog 18 Dec 2007 10:05:28 -0000 1.420 @@ -1,3 +1,9 @@ +2007-12-18 Edward Hervey <edw...@co...> + + * 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> * Makefile.am: Index: gstffmpegdemux.c RCS file: /cvs/gstreamer/gst-ffmpeg/ext/ffmpeg/gstffmpegdemux.c,v retrieving revision 1.83 retrieving revision 1.84 diff -u -d -r1.83 -r1.84 --- gstffmpegdemux.c 17 Dec 2007 20:31:35 -0000 1.83 +++ gstffmpegdemux.c 18 Dec 2007 10:05:28 -0000 1.84 @@ -1233,12 +1233,10 @@ else 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); - /* we can ignore not linked */ - if (ret == GST_FLOW_NOT_LINKED) - goto done; - if (ret != GST_FLOW_OK) + if ((ret = gst_ffmpegdemux_aggregated_flow (demux)) != GST_FLOW_OK) goto no_buffer; /* copy the data from packet into the target buffer @@ -1314,26 +1312,28 @@ demux->running = FALSE; gst_pad_pause_task (demux->sinkpad); - if (ret == GST_FLOW_UNEXPECTED) { - if (demux->segment.flags & GST_SEEK_FLAG_SEGMENT) { - gint64 stop; + if (GST_FLOW_IS_FATAL (ret) || ret == GST_FLOW_NOT_LINKED) { + if (ret == GST_FLOW_UNEXPECTED) { + if (demux->segment.flags & GST_SEEK_FLAG_SEGMENT) { + gint64 stop; - if ((stop = demux->segment.stop) == -1) - stop = demux->segment.duration; + if ((stop = demux->segment.stop) == -1) + stop = demux->segment.duration; - GST_LOG_OBJECT (demux, "posting segment done"); - gst_element_post_message (GST_ELEMENT (demux), - gst_message_new_segment_done (GST_OBJECT (demux), - demux->segment.format, stop)); + GST_LOG_OBJECT (demux, "posting segment done"); + gst_element_post_message (GST_ELEMENT (demux), + gst_message_new_segment_done (GST_OBJECT (demux), + demux->segment.format, stop)); + } else { + GST_LOG_OBJECT (demux, "pushing eos"); + gst_ffmpegdemux_push_event (demux, gst_event_new_eos ()); + } } else { - GST_LOG_OBJECT (demux, "pushing eos"); + GST_ELEMENT_ERROR (demux, STREAM, FAILED, + ("Internal data stream error."), + ("streaming stopped, reason %s", gst_flow_get_name (ret))); gst_ffmpegdemux_push_event (demux, gst_event_new_eos ()); } - } else if (GST_FLOW_IS_FATAL (ret)) { - GST_ELEMENT_ERROR (demux, STREAM, FAILED, - ("Internal data stream error."), - ("streaming stopped, reason %s", gst_flow_get_name (ret))); - gst_ffmpegdemux_push_event (demux, gst_event_new_eos ()); } return; } @@ -1352,7 +1352,7 @@ if (demux->flushing) ret = GST_FLOW_WRONG_STATE; else - ret = GST_FLOW_UNEXPECTED; + ret = GST_FLOW_ERROR; GST_OBJECT_UNLOCK (demux); goto pause; |