summaryrefslogtreecommitdiffstats
path: root/ext/wavpack/gstwavpackdec.c
diff options
context:
space:
mode:
authorSebastian Dröge <slomo@circular-chaos.org>2007-06-09 15:33:32 +0000
committerSebastian Dröge <slomo@circular-chaos.org>2007-06-09 15:33:32 +0000
commite05417a077e8d85cafe68bd215c6b0fd133b0022 (patch)
treefde3254974bdbbc506b527a78e7a474c115f00d5 /ext/wavpack/gstwavpackdec.c
parent06d12027fa3ea6540724a958b7557adb65137744 (diff)
ext/wavpack/: Improve discont handling by checking if the next Wavpack block has the expected, following block index.
Original commit message from CVS: * ext/wavpack/gstwavpackdec.c: (gst_wavpack_dec_reset), (gst_wavpack_dec_chain): * ext/wavpack/gstwavpackdec.h: * ext/wavpack/gstwavpackparse.c: (gst_wavpack_parse_reset), (gst_wavpack_parse_push_buffer): * ext/wavpack/gstwavpackparse.h: Improve discont handling by checking if the next Wavpack block has the expected, following block index.
Diffstat (limited to 'ext/wavpack/gstwavpackdec.c')
-rw-r--r--ext/wavpack/gstwavpackdec.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/ext/wavpack/gstwavpackdec.c b/ext/wavpack/gstwavpackdec.c
index 5adaf1be..437ba0d0 100644
--- a/ext/wavpack/gstwavpackdec.c
+++ b/ext/wavpack/gstwavpackdec.c
@@ -130,6 +130,7 @@ gst_wavpack_dec_reset (GstWavpackDec * dec)
dec->depth = 0;
gst_segment_init (&dec->segment, GST_FORMAT_UNDEFINED);
+ dec->next_block_index = 0;
}
static void
@@ -362,9 +363,11 @@ gst_wavpack_dec_chain (GstPad * pad, GstBuffer * buf)
/* If we got a DISCONT buffer forward the flag. Nothing else
* has to be done as libwavpack doesn't store state between
* Wavpack blocks */
- if (GST_BUFFER_IS_DISCONT (buf))
+ if (GST_BUFFER_IS_DISCONT (buf) || dec->next_block_index != wph.block_index)
GST_BUFFER_FLAG_SET (outbuf, GST_BUFFER_FLAG_DISCONT);
+ dec->next_block_index = wph.block_index + wph.block_samples;
+
/* decode */
decoded = WavpackUnpackSamples (dec->context,
(int32_t *) GST_BUFFER_DATA (outbuf), wph.block_samples);