summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Dröge <slomo@circular-chaos.org>2007-05-02 16:45:43 +0000
committerSebastian Dröge <slomo@circular-chaos.org>2007-05-02 16:45:43 +0000
commiteee3562f09892f0451f5bc791f3a74dee0fbca2e (patch)
tree2c8ecdce710cc8f763df55ca7fb44a9e62621818
parent3d4f86374536fa65311390779ebffbeb7dd158ba (diff)
downloadgst-plugins-bad-eee3562f09892f0451f5bc791f3a74dee0fbca2e.tar.gz
gst-plugins-bad-eee3562f09892f0451f5bc791f3a74dee0fbca2e.tar.bz2
gst-plugins-bad-eee3562f09892f0451f5bc791f3a74dee0fbca2e.zip
ext/wavpack/gstwavpackparse.c: Handle segment seeks in the seek event handler, correctly work with stop position == -...
Original commit message from CVS: * ext/wavpack/gstwavpackparse.c: (gst_wavpack_parse_handle_seek_event): Handle segment seeks in the seek event handler, correctly work with stop position == -1 and instead of stopping the task on seek just pause it.
-rw-r--r--ChangeLog8
-rw-r--r--ext/wavpack/gstwavpackparse.c14
2 files changed, 21 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 360c450d..477465af 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
2007-05-02 Sebastian Dröge <slomo@circular-chaos.org>
+ * ext/wavpack/gstwavpackparse.c:
+ (gst_wavpack_parse_handle_seek_event):
+ Handle segment seeks in the seek event handler, correctly work with
+ stop position == -1 and instead of stopping the task on seek just
+ pause it.
+
+2007-05-02 Sebastian Dröge <slomo@circular-chaos.org>
+
* ext/wavpack/gstwavpackparse.c: (gst_wavpack_parse_loop):
Add handling for segment seeks.
diff --git a/ext/wavpack/gstwavpackparse.c b/ext/wavpack/gstwavpackparse.c
index 65cdcf33..ef869617 100644
--- a/ext/wavpack/gstwavpackparse.c
+++ b/ext/wavpack/gstwavpackparse.c
@@ -527,6 +527,11 @@ gst_wavpack_parse_handle_seek_event (GstWavpackParse * wvparse,
return FALSE;
}
+ /* figure out the last position we need to play. If it's configured (stop !=
+ * -1), use that, else we play until the total duration of the file */
+ if (stop == -1)
+ stop = wvparse->segment.duration;
+
/* convert from time to samples if necessary */
if (format == GST_FORMAT_TIME) {
if (start_type != GST_SEEK_TYPE_NONE)
@@ -567,7 +572,7 @@ gst_wavpack_parse_handle_seek_event (GstWavpackParse * wvparse,
if (flush) {
gst_pad_push_event (wvparse->srcpad, gst_event_new_flush_start ());
} else {
- gst_pad_stop_task (wvparse->sinkpad);
+ gst_pad_pause_task (wvparse->sinkpad);
}
GST_PAD_STREAM_LOCK (wvparse->sinkpad);
@@ -595,6 +600,13 @@ gst_wavpack_parse_handle_seek_event (GstWavpackParse * wvparse,
wvparse->segment = segment;
wvparse->segment.last_stop = chunk_start;
gst_wavpack_parse_send_newsegment (wvparse, FALSE);
+
+ /* if we're doing a segment seek, post a SEGMENT_START message */
+ if (wvparse->segment.flags & GST_SEEK_FLAG_SEGMENT) {
+ gst_element_post_message (GST_ELEMENT_CAST (wvparse),
+ gst_message_new_segment_start (GST_OBJECT_CAST (wvparse),
+ wvparse->segment.format, wvparse->segment.last_stop));
+ }
} else {
GST_DEBUG_OBJECT (wvparse, "seek failed: don't know where to seek to");
}