rendered paste bodyIndex: gstaudioconvert.c
===================================================================
RCS file: /cvs/gstreamer/gst-plugins-base/gst/audioconvert/gstaudioconvert.c,v
retrieving revision 1.120
diff -u -p -r1.120 gstaudioconvert.c
--- gstaudioconvert.c 31 Oct 2007 17:54:48 -0000 1.120
+++ gstaudioconvert.c 19 Feb 2008 14:14:35 -0000
@@ -977,10 +977,23 @@ gst_audio_convert_transform (GstBaseTran
src = GST_BUFFER_DATA (inbuf);
dst = GST_BUFFER_DATA (outbuf);
- /* and convert the samples */
- if (!(res = audio_convert_convert (&this->ctx, src, dst,
- samples, gst_buffer_is_writable (inbuf))))
- goto convert_error;
+ if (!GST_BUFFER_FLAG_IS_SET (inbuf, GST_BUFFER_FLAG_GAP)) {
+ /* and convert the samples */
+ if (!(res = audio_convert_convert (&this->ctx, src, dst,
+ samples, gst_buffer_is_writable (inbuf))))
+ goto convert_error;
+ }
+ else {
+ /* FIXME: need to handle the case where noiseshaping is used
+ * what about the gap-flag then?
+ if (G_UNLIKELY(ctx->ns != NOISE_SHAPING_NONE)) {
+ ctx->quantize (ctx, src, dst, samples);
+ }
+ else {
+ */
+ memset (dst, 0, outsize);
+ GST_BUFFER_FLAG_SET (outbuf, GST_BUFFER_FLAG_GAP);
+ }
GST_BUFFER_SIZE (outbuf) = outsize;