diff options
author | Wim Taymans <wim.taymans@gmail.com> | 2004-10-01 16:15:23 +0000 |
---|---|---|
committer | Wim Taymans <wim.taymans@gmail.com> | 2004-10-01 16:15:23 +0000 |
commit | 73854c25ffa76d0802502bbb56d564b9f65e08f9 (patch) | |
tree | 44dbdae1c4f95c578d677937ef944b757c826311 /ext/speex | |
parent | 51dacde4f8b554cf5b0553197064cd0817c156e6 (diff) |
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.
Diffstat (limited to 'ext/speex')
-rw-r--r-- | ext/speex/gstspeexdec.c | 15 |
1 files changed, 8 insertions, 7 deletions
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]; } |