From 73854c25ffa76d0802502bbb56d564b9f65e08f9 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Fri, 1 Oct 2004 16:15:23 +0000 Subject: ext/speex/gstspeexdec.c: Small cleanups. Original commit message from CVS: * ext/speex/gstspeexdec.c: (gst_speex_dec_class_init), (speex_dec_get_formats), (speex_dec_convert), (speex_dec_src_query), (speex_dec_src_event), (speex_dec_event), (speex_dec_chain), (gst_speexdec_get_property), (gst_speexdec_set_property): Small cleanups. --- ext/speex/gstspeexdec.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'ext') diff --git a/ext/speex/gstspeexdec.c b/ext/speex/gstspeexdec.c index da246aab..ef795dcf 100644 --- a/ext/speex/gstspeexdec.c +++ b/ext/speex/gstspeexdec.c @@ -484,14 +484,15 @@ speex_dec_chain (GstPad * pad, GstData * data) ret = speex_decode (dec->state, &dec->bits, dec->output); if (ret == -1) { - /* FIXME emit warning */ + /* uh? end of stream */ + GST_WARNING_OBJECT (dec, "Unexpected end of stream found"); break; } else if (ret == -2) { - /* FIXME emit warning */ + GST_WARNING_OBJECT (dec, "Decoding error: corrupted stream?"); break; } if (speex_bits_remaining (&dec->bits) < 0) { - fprintf (stderr, "Decoding overflow: corrupted stream?\n"); + GST_WARNING_OBJECT (dec, "Decoding overflow: corrupted stream?"); break; } if (dec->header->nb_channels == 2) @@ -503,10 +504,10 @@ speex_dec_chain (GstPad * pad, GstData * data) /*PCM saturation (just in case) */ for (i = 0; i < dec->frame_size * dec->header->nb_channels; i++) { - if (dec->output[i] > 32000.0) - out_data[i] = 32000; - else if (dec->output[i] < -32000.0) - out_data[i] = -32000; + if (dec->output[i] > 32767.0) + out_data[i] = 32767; + else if (dec->output[i] < -32768.0) + out_data[i] = -32768; else out_data[i] = (gint16) dec->output[i]; } -- cgit