From 6991907036b3688b7d4537cdefafbc48baecce58 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Wed, 2 May 2007 18:25:09 +0000 Subject: [PATCH] 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. --- ChangeLog | 7 +++++++ gst/wavparse/gstwavparse.c | 17 +++++++++++++++-- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index fb6a18b..157166f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2007-05-02 Wim Taymans + + * 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. + 2007-05-02 Sebastian Dröge * ext/flac/gstflac.c: (plugin_init): diff --git a/gst/wavparse/gstwavparse.c b/gst/wavparse/gstwavparse.c index 81c62c1..bc7a48b 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) { -- 2.7.4