summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: c539897)
raw | patch | inline | side by side (parent: c539897)
author | Wim Taymans <wim.taymans@gmail.com> | |
Tue, 13 Feb 2007 15:34:15 +0000 (15:34 +0000) | ||
committer | Wim Taymans <wim.taymans@gmail.com> | |
Tue, 13 Feb 2007 15:34:15 +0000 (15:34 +0000) |
Original commit message from CVS:
* docs/design/part-seeking.txt:
Some small update.
* gst/gstsegment.c: (gst_segment_set_seek):
Revert old bogus change that should make seeking work again.
* docs/design/part-seeking.txt:
Some small update.
* gst/gstsegment.c: (gst_segment_set_seek):
Revert old bogus change that should make seeking work again.
ChangeLog | patch | blob | history | |
docs/design/part-seeking.txt | patch | blob | history | |
gst/gstsegment.c | patch | blob | history |
diff --git a/ChangeLog b/ChangeLog
index e2b90f154938687783d7ea8f84da891a81ca3d01..759ddde2e091132cc868f1e2baae127be21dfe85 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
+2007-02-13 Wim Taymans,,, <wim@fluendo.com>
+
+ * docs/design/part-seeking.txt:
+ Some small update.
+
+ * gst/gstsegment.c: (gst_segment_set_seek):
+ Revert old bogus change that should make seeking work again.
+
2007-02-13 Stefan Kost <ensonic@users.sf.net>
* docs/random/ensonic/dynlink.txt:
index 9ffcd559320e2472ea4a4d2a5620bbcc076a9f9d..9e3ae407854f5a14a2bec1b7f176b6211fcdbbc8 100644 (file)
the message, the application can reconnect the pipeline or issue other
seek events in the pipeline. Since the message is posted as early as
possible in the pipeline, the application has some time to issue a new
-seek to make the transition seemless. Typically the allowed delay is
+seek to make the transition seamless. Typically the allowed delay is
defined by the buffer sizes of the sinks as well as the size of any
queues in the pipeline.
diff --git a/gst/gstsegment.c b/gst/gstsegment.c
index 450b2b9f32d88ab3c1116c4230cc9cde5b25149c..c8842bdabe848d7dec5ec856f60677ba2e4830d1 100644 (file)
--- a/gst/gstsegment.c
+++ b/gst/gstsegment.c
* @start: the seek start value
* @stop_type: the seek method
* @stop: the seek stop value
- * @update: boolean holding whether start or stop were updated.
+ * @update: boolean holding whether last_stop was updated.
*
* Update the segment structure with the field values of a seek event (see
* gst_event_new_seek()).
* The applied rate of the segment will be set to 1.0 by default.
* If the caller can apply a rate change, it should update @segment
* rate and applied_rate after calling this function.
+ *
+ * @update will be set to TRUE if a seek should be performed to the segment
+ * last_stop field. This field can be FALSE if, for example, only the @rate
+ * has been changed but not the playback position.
*/
void
gst_segment_set_seek (GstSegment * segment, gdouble rate,
GstSeekType stop_type, gint64 stop, gboolean * update)
{
gboolean update_stop, update_start;
+ gint64 last_stop;
g_return_if_fail (rate != 0.0);
g_return_if_fail (segment != NULL);
else
g_return_if_fail (segment->format == format);
- update_stop = update_start = TRUE;
+ update_start = update_stop = TRUE;
/* start is never invalid */
switch (start_type) {
/* start holds desired position, map -1 to the start */
if (start == -1)
start = 0;
- if (start == segment->start)
- update_start = FALSE;
break;
case GST_SEEK_TYPE_CUR:
/* add start to currently configure segment */
- if (start == 0)
- update_start = FALSE;
start = segment->start + start;
break;
case GST_SEEK_TYPE_END:
if (segment->duration != -1) {
/* add start to total length */
- if (start == 0)
- update_start = FALSE;
start = segment->duration + start;
} else {
/* no update if duration unknown */
/* stop holds required value */
break;
case GST_SEEK_TYPE_CUR:
- if (segment->stop != -1) {
- if (stop == 0)
- update_stop = FALSE;
+ if (segment->stop != -1)
stop = segment->stop + stop;
- } else {
+ else
stop = -1;
- update_stop = FALSE;
- }
break;
case GST_SEEK_TYPE_END:
- if (segment->duration != -1) {
- if (stop == 0)
- update_stop = FALSE;
+ if (segment->duration != -1)
stop = segment->duration + stop;
- } else {
+ else {
stop = segment->stop;
update_stop = FALSE;
}
segment->applied_rate = 1.0;
segment->flags = flags;
segment->start = start;
+ last_stop = segment->last_stop;
if (update_start && rate > 0.0) {
- segment->last_stop = start;
+ last_stop = start;
}
if (update_stop && rate < 0.0) {
if (stop != -1)
- segment->last_stop = stop;
+ last_stop = stop;
else {
if (segment->duration != -1)
- segment->last_stop = segment->duration;
+ last_stop = segment->duration;
else
- segment->last_stop = 0;
+ last_stop = 0;
}
}
+ /* set update arg to reflect update of last_stop */
+ if (update)
+ *update = last_stop != segment->last_stop;
+
+ /* update new position */
+ if (last_stop != segment->last_stop)
+ segment->last_stop = last_stop;
+
segment->time = start;
segment->stop = stop;
-
- if (update)
- *update = update_start || update_stop;
}
/**