diff options
-rw-r--r-- | ChangeLog | 9 | ||||
m--------- | common | 0 | ||||
-rw-r--r-- | gst/qtdemux/qtdemux.c | 34 |
3 files changed, 33 insertions, 10 deletions
@@ -1,3 +1,12 @@ +2006-04-05 Wim Taymans <wim@fluendo.com> + + * gst/qtdemux/qtdemux.c: (gst_qtdemux_perform_seek), + (gst_qtdemux_do_seek), (gst_qtdemux_loop_state_movie), + (gst_qtdemux_loop): + Use duration as segment stop position if none is + explicitly configured. + Also perform EOS when we run past the segment stop. + 2006-04-04 Wim Taymans <wim@fluendo.com> * gst/qtdemux/qtdemux.c: (gst_qtdemux_go_back), diff --git a/common b/common -Subproject 6f7101e2227975fa8a134358362dd4b55e326b4 +Subproject cbedff4d5f090d43fdeaa189748a6651f2c6a07 diff --git a/gst/qtdemux/qtdemux.c b/gst/qtdemux/qtdemux.c index 280bf4e0..4637cd23 100644 --- a/gst/qtdemux/qtdemux.c +++ b/gst/qtdemux/qtdemux.c @@ -581,6 +581,11 @@ gst_qtdemux_perform_seek (GstQTDemux * qtdemux, GstSegment * segment) segment->last_stop = min; segment->time = min; } + + /* and we stop at the end */ + if (segment->stop == -1) + segment->stop = segment->duration; + return TRUE; } @@ -687,8 +692,9 @@ gst_qtdemux_do_seek (GstQTDemux * qtdemux, GstPad * pad, GstEvent * event) } /* send the newsegment */ - GST_DEBUG_OBJECT (qtdemux, "Sending newsegment from %" G_GINT64_FORMAT - " to %" G_GINT64_FORMAT, qtdemux->segment.start, stop); + GST_DEBUG_OBJECT (qtdemux, "Sending newsegment from %" GST_TIME_FORMAT + " to %" GST_TIME_FORMAT, GST_TIME_ARGS (qtdemux->segment.start), + GST_TIME_ARGS (qtdemux->segment.stop)); newsegment = gst_event_new_new_segment (FALSE, qtdemux->segment.rate, @@ -952,12 +958,12 @@ gst_qtdemux_loop_state_movie (GstQTDemux * qtdemux) } } } - if (index == -1) { - GST_DEBUG_OBJECT (qtdemux, "No samples left for any streams - EOS"); - gst_pad_event_default (qtdemux->sinkpad, gst_event_new_eos ()); - ret = GST_FLOW_UNEXPECTED; - goto beach; - } + if (index == -1) + goto eos; + + /* check for segment end */ + if (qtdemux->segment.stop != -1 && qtdemux->segment.stop < min_time) + goto eos; stream = qtdemux->streams[index]; @@ -1036,6 +1042,14 @@ gst_qtdemux_loop_state_movie (GstQTDemux * qtdemux) beach: return ret; + + /* special cases */ +eos: + { + GST_DEBUG_OBJECT (qtdemux, "No samples left for any streams - EOS"); + ret = GST_FLOW_UNEXPECTED; + goto beach; + } } static void @@ -1076,7 +1090,7 @@ gst_qtdemux_loop (GstPad * pad) GST_LOG_OBJECT (qtdemux, "pausing task, reason %s", gst_flow_get_name (ret)); qtdemux->segment_running = FALSE; - gst_pad_pause_task (qtdemux->sinkpad); + gst_pad_pause_task (pad); /* fatal errors need special actions */ if (GST_FLOW_IS_FATAL (ret)) { @@ -1108,7 +1122,7 @@ invalid_state: GST_ELEMENT_ERROR (qtdemux, STREAM, FAILED, (NULL), ("streaming stopped, invalid state")); qtdemux->segment_running = FALSE; - gst_pad_pause_task (qtdemux->sinkpad); + gst_pad_pause_task (pad); gst_qtdemux_push_event (qtdemux, gst_event_new_eos ()); goto done; } |