mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-09 08:55:33 +00:00
docs/design/part-seeking.txt: Some small update.
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.
This commit is contained in:
parent
c53989742b
commit
5b6258fa8d
3 changed files with 33 additions and 26 deletions
|
@ -1,3 +1,11 @@
|
||||||
|
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>
|
2007-02-13 Stefan Kost <ensonic@users.sf.net>
|
||||||
|
|
||||||
* docs/random/ensonic/dynlink.txt:
|
* docs/random/ensonic/dynlink.txt:
|
||||||
|
|
|
@ -30,7 +30,7 @@ earliest element in the pipeline, typically a demuxer. After receiving
|
||||||
the message, the application can reconnect the pipeline or issue other
|
the message, the application can reconnect the pipeline or issue other
|
||||||
seek events in the pipeline. Since the message is posted as early as
|
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
|
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
|
defined by the buffer sizes of the sinks as well as the size of any
|
||||||
queues in the pipeline.
|
queues in the pipeline.
|
||||||
|
|
||||||
|
|
|
@ -230,7 +230,7 @@ gst_segment_set_last_stop (GstSegment * segment, GstFormat format,
|
||||||
* @start: the seek start value
|
* @start: the seek start value
|
||||||
* @stop_type: the seek method
|
* @stop_type: the seek method
|
||||||
* @stop: the seek stop value
|
* @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
|
* Update the segment structure with the field values of a seek event (see
|
||||||
* gst_event_new_seek()).
|
* gst_event_new_seek()).
|
||||||
|
@ -255,6 +255,10 @@ gst_segment_set_last_stop (GstSegment * segment, GstFormat format,
|
||||||
* The applied rate of the segment will be set to 1.0 by default.
|
* 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
|
* If the caller can apply a rate change, it should update @segment
|
||||||
* rate and applied_rate after calling this function.
|
* 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
|
void
|
||||||
gst_segment_set_seek (GstSegment * segment, gdouble rate,
|
gst_segment_set_seek (GstSegment * segment, gdouble rate,
|
||||||
|
@ -263,6 +267,7 @@ gst_segment_set_seek (GstSegment * segment, gdouble rate,
|
||||||
GstSeekType stop_type, gint64 stop, gboolean * update)
|
GstSeekType stop_type, gint64 stop, gboolean * update)
|
||||||
{
|
{
|
||||||
gboolean update_stop, update_start;
|
gboolean update_stop, update_start;
|
||||||
|
gint64 last_stop;
|
||||||
|
|
||||||
g_return_if_fail (rate != 0.0);
|
g_return_if_fail (rate != 0.0);
|
||||||
g_return_if_fail (segment != NULL);
|
g_return_if_fail (segment != NULL);
|
||||||
|
@ -272,7 +277,7 @@ gst_segment_set_seek (GstSegment * segment, gdouble rate,
|
||||||
else
|
else
|
||||||
g_return_if_fail (segment->format == format);
|
g_return_if_fail (segment->format == format);
|
||||||
|
|
||||||
update_stop = update_start = TRUE;
|
update_start = update_stop = TRUE;
|
||||||
|
|
||||||
/* start is never invalid */
|
/* start is never invalid */
|
||||||
switch (start_type) {
|
switch (start_type) {
|
||||||
|
@ -285,20 +290,14 @@ gst_segment_set_seek (GstSegment * segment, gdouble rate,
|
||||||
/* start holds desired position, map -1 to the start */
|
/* start holds desired position, map -1 to the start */
|
||||||
if (start == -1)
|
if (start == -1)
|
||||||
start = 0;
|
start = 0;
|
||||||
if (start == segment->start)
|
|
||||||
update_start = FALSE;
|
|
||||||
break;
|
break;
|
||||||
case GST_SEEK_TYPE_CUR:
|
case GST_SEEK_TYPE_CUR:
|
||||||
/* add start to currently configure segment */
|
/* add start to currently configure segment */
|
||||||
if (start == 0)
|
|
||||||
update_start = FALSE;
|
|
||||||
start = segment->start + start;
|
start = segment->start + start;
|
||||||
break;
|
break;
|
||||||
case GST_SEEK_TYPE_END:
|
case GST_SEEK_TYPE_END:
|
||||||
if (segment->duration != -1) {
|
if (segment->duration != -1) {
|
||||||
/* add start to total length */
|
/* add start to total length */
|
||||||
if (start == 0)
|
|
||||||
update_start = FALSE;
|
|
||||||
start = segment->duration + start;
|
start = segment->duration + start;
|
||||||
} else {
|
} else {
|
||||||
/* no update if duration unknown */
|
/* no update if duration unknown */
|
||||||
|
@ -323,21 +322,15 @@ gst_segment_set_seek (GstSegment * segment, gdouble rate,
|
||||||
/* stop holds required value */
|
/* stop holds required value */
|
||||||
break;
|
break;
|
||||||
case GST_SEEK_TYPE_CUR:
|
case GST_SEEK_TYPE_CUR:
|
||||||
if (segment->stop != -1) {
|
if (segment->stop != -1)
|
||||||
if (stop == 0)
|
|
||||||
update_stop = FALSE;
|
|
||||||
stop = segment->stop + stop;
|
stop = segment->stop + stop;
|
||||||
} else {
|
else
|
||||||
stop = -1;
|
stop = -1;
|
||||||
update_stop = FALSE;
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case GST_SEEK_TYPE_END:
|
case GST_SEEK_TYPE_END:
|
||||||
if (segment->duration != -1) {
|
if (segment->duration != -1)
|
||||||
if (stop == 0)
|
|
||||||
update_stop = FALSE;
|
|
||||||
stop = segment->duration + stop;
|
stop = segment->duration + stop;
|
||||||
} else {
|
else {
|
||||||
stop = segment->stop;
|
stop = segment->stop;
|
||||||
update_stop = FALSE;
|
update_stop = FALSE;
|
||||||
}
|
}
|
||||||
|
@ -361,24 +354,30 @@ gst_segment_set_seek (GstSegment * segment, gdouble rate,
|
||||||
segment->applied_rate = 1.0;
|
segment->applied_rate = 1.0;
|
||||||
segment->flags = flags;
|
segment->flags = flags;
|
||||||
segment->start = start;
|
segment->start = start;
|
||||||
|
last_stop = segment->last_stop;
|
||||||
if (update_start && rate > 0.0) {
|
if (update_start && rate > 0.0) {
|
||||||
segment->last_stop = start;
|
last_stop = start;
|
||||||
}
|
}
|
||||||
if (update_stop && rate < 0.0) {
|
if (update_stop && rate < 0.0) {
|
||||||
if (stop != -1)
|
if (stop != -1)
|
||||||
segment->last_stop = stop;
|
last_stop = stop;
|
||||||
else {
|
else {
|
||||||
if (segment->duration != -1)
|
if (segment->duration != -1)
|
||||||
segment->last_stop = segment->duration;
|
last_stop = segment->duration;
|
||||||
else
|
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->time = start;
|
||||||
segment->stop = stop;
|
segment->stop = stop;
|
||||||
|
|
||||||
if (update)
|
|
||||||
*update = update_start || update_stop;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in a new issue