From 2b5d45e3f64295db1cac0eae91c4b276bcebb10a Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Tue, 30 Oct 2007 11:13:49 +0000 Subject: [PATCH] gst/mpegaudioparse/gstmpegaudioparse.c: When the element is not driving the streaming thread it is not supposed to em... Original commit message from CVS: * gst/mpegaudioparse/gstmpegaudioparse.c: (gst_mp3parse_emit_frame): When the element is not driving the streaming thread it is not supposed to emit EOS or post SEGMENT done. It is allowed to return UNEXPECTED upstream when it detects EOS. See #491305. --- ChangeLog | 8 ++++++++ gst/mpegaudioparse/gstmpegaudioparse.c | 18 ++++-------------- 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0ff226b702..68fe86c689 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2007-10-30 Wim Taymans + + * gst/mpegaudioparse/gstmpegaudioparse.c: + (gst_mp3parse_emit_frame): + When the element is not driving the streaming thread it is not supposed + to emit EOS or post SEGMENT done. It is allowed to return UNEXPECTED + upstream when it detects EOS. See #491305. + 2007-10-13 Tim-Philipp Müller Patch by: Mark Nauwelaerts diff --git a/gst/mpegaudioparse/gstmpegaudioparse.c b/gst/mpegaudioparse/gstmpegaudioparse.c index 1659cd6f0c..73e3860c31 100644 --- a/gst/mpegaudioparse/gstmpegaudioparse.c +++ b/gst/mpegaudioparse/gstmpegaudioparse.c @@ -623,22 +623,12 @@ gst_mp3parse_emit_frame (GstMPEGAudioParse * mp3parse, guint size) mp3parse->pending_segment = NULL; ret = gst_pad_push (mp3parse->srcpad, outbuf); } - if (ret == GST_FLOW_UNEXPECTED - && mp3parse->segment.flags & GST_SEEK_FLAG_SEGMENT) { - GstClockTime stop; - GST_LOG_OBJECT (mp3parse, "Sending segment done"); - - if ((stop = mp3parse->segment.stop) == -1) - stop = mp3parse->segment.duration; - - gst_element_post_message (GST_ELEMENT_CAST (mp3parse), - gst_message_new_segment_done (GST_OBJECT_CAST (mp3parse), - mp3parse->segment.format, stop)); - } else if (GST_CLOCK_TIME_IS_VALID (mp3parse->segment.stop) + /* return unexpected when we run off the end of the segment */ + if (GST_CLOCK_TIME_IS_VALID (mp3parse->segment.stop) && mp3parse->next_ts >= mp3parse->segment.stop) { - GST_DEBUG_OBJECT (mp3parse, "Sending EOS"); - gst_pad_push_event (mp3parse->srcpad, gst_event_new_eos ()); + GST_DEBUG_OBJECT (mp3parse, "returning unexpected"); + ret = GST_FLOW_UNEXPECTED; } return ret; }