summaryrefslogtreecommitdiffstats
path: root/gst/wavparse
diff options
context:
space:
mode:
authorWim Taymans <wim.taymans@gmail.com>2007-05-02 18:25:09 +0000
committerWim Taymans <wim.taymans@gmail.com>2007-05-02 18:25:09 +0000
commit6991907036b3688b7d4537cdefafbc48baecce58 (patch)
tree9284c079a29077c29e9a5adb8d99f54fa60d28be /gst/wavparse
parent09b83eac480f10b0000f64494aa221e7d2669167 (diff)
gst/wavparse/gstwavparse.c: Only set DISCONT when there actually is a discont or when we just started.
Original commit message from CVS: * gst/wavparse/gstwavparse.c: (gst_wavparse_perform_seek), (gst_wavparse_stream_headers), (gst_wavparse_stream_data): Only set DISCONT when there actually is a discont or when we just started.
Diffstat (limited to 'gst/wavparse')
-rw-r--r--gst/wavparse/gstwavparse.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/gst/wavparse/gstwavparse.c b/gst/wavparse/gstwavparse.c
index 81c62c19..bc7a48b1 100644
--- a/gst/wavparse/gstwavparse.c
+++ b/gst/wavparse/gstwavparse.c
@@ -736,6 +736,7 @@ gst_wavparse_perform_seek (GstWavParse * wav, GstEvent * event)
gboolean flush;
gboolean update;
GstSegment seeksegment = { 0, };
+ gint64 last_stop;
if (event) {
GstFormat fmt;
@@ -793,6 +794,11 @@ gst_wavparse_perform_seek (GstWavParse * wav, GstEvent * event)
* with the above flush/pause code */
GST_PAD_STREAM_LOCK (wav->sinkpad);
+ /* save current position */
+ last_stop = wav->segment.last_stop;
+
+ GST_DEBUG_OBJECT (wav, "stopped streaming at %" G_GINT64_FORMAT, last_stop);
+
/* copy segment, we need this because we still need the old
* segment when we close the current segment. */
memcpy (&seeksegment, &wav->segment, sizeof (GstSegment));
@@ -907,8 +913,11 @@ gst_wavparse_perform_seek (GstWavParse * wav, GstEvent * event)
wav->segment.format, wav->segment.last_stop, stop,
wav->segment.last_stop);
- /* mark discont */
- wav->discont = TRUE;
+ /* mark discont if we are going to stream from another position. */
+ if (last_stop != wav->segment.last_stop) {
+ GST_DEBUG_OBJECT (wav, "mark DISCONT, we did a seek to another position");
+ wav->discont = TRUE;
+ }
/* and start the streaming task again */
wav->segment_running = TRUE;
@@ -1286,6 +1295,9 @@ gst_wavparse_stream_headers (GstWavParse * wav)
event_p = &wav->seek_event;
gst_event_replace (event_p, NULL);
+ /* we just started, we are discont */
+ wav->discont = TRUE;
+
wav->state = GST_WAVPARSE_DATA;
return GST_FLOW_OK;
@@ -1564,6 +1576,7 @@ iterate_adapter:
gst_segment_set_last_stop (&wav->segment, GST_FORMAT_TIME, next_timestamp);
if (wav->discont) {
+ GST_DEBUG_OBJECT (wav, "marking DISCONT");
GST_BUFFER_FLAG_SET (buf, GST_BUFFER_FLAG_DISCONT);
wav->discont = FALSE;
} else if (wav->vbr) {