summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWim Taymans <wim.taymans@gmail.com>2006-04-05 08:36:55 +0000
committerWim Taymans <wim.taymans@gmail.com>2006-04-05 08:36:55 +0000
commit57d1f628c8ccf54da2f2ecf647b4e8d882d183c0 (patch)
tree694b98ce45c1470f4cda6c168f1aff7d3169af46
parentab45a8ca343c326ed3609c80ea491bee6accdc96 (diff)
downloadgst-plugins-bad-57d1f628c8ccf54da2f2ecf647b4e8d882d183c0.tar.gz
gst-plugins-bad-57d1f628c8ccf54da2f2ecf647b4e8d882d183c0.tar.bz2
gst-plugins-bad-57d1f628c8ccf54da2f2ecf647b4e8d882d183c0.zip
gst/qtdemux/qtdemux.c: Use duration as segment stop position if none is explicitly configured.
Original commit message from CVS: * 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.
-rw-r--r--ChangeLog9
m---------common0
-rw-r--r--gst/qtdemux/qtdemux.c34
3 files changed, 33 insertions, 10 deletions
diff --git a/ChangeLog b/ChangeLog
index ba756a6c..af32ee9b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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;
}