From c1f730ab426636b5fea1dc657d2278950ace5de6 Mon Sep 17 00:00:00 2001 From: Matthias Kretz Date: Fri, 23 Nov 2007 18:06:26 +0100 Subject: fix one warning; remove unused variable; make float->int conversion a bit more accurate (compared to oggdec); fix one debug printf --- src/libxineadec/xine_vorbis_decoder.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/src/libxineadec/xine_vorbis_decoder.c b/src/libxineadec/xine_vorbis_decoder.c index c7b1e5761..297d16349 100644 --- a/src/libxineadec/xine_vorbis_decoder.c +++ b/src/libxineadec/xine_vorbis_decoder.c @@ -160,7 +160,7 @@ static void vorbis_decode_data (audio_decoder_t *this_gen, buf_element_t *buf) { if( (res = vorbis_synthesis_headerin(&this->vi,&this->vc,&this->op)) < 0 ){ /* error case; not a vorbis header */ xine_log(this->stream->xine, XINE_LOG_MSG, "libvorbis: this bitstream does not contain vorbis audio data. Following first 64 bytes (return: %d).\n", res); - xine_hexdump(this->op.packet, this->op.bytes < 64 ? this->op.bytes : 64); + xine_hexdump((char *)this->op.packet, this->op.bytes < 64 ? this->op.bytes : 64); return; } @@ -221,7 +221,6 @@ static void vorbis_decode_data (audio_decoder_t *this_gen, buf_element_t *buf) { */ int i,j; - int clipflag=0; int bout=(samplesconvsize?samples:this->convsize); audio_buffer_t *audio_buffer; @@ -233,15 +232,13 @@ static void vorbis_decode_data (audio_decoder_t *this_gen, buf_element_t *buf) { ogg_int16_t *ptr=audio_buffer->mem+i; float *mono=pcm[i]; for(j=0;j32767){ val=32767; - clipflag=1; - } - if(val<-32768){ + } else if(val<-32768){ val=-32768; - clipflag=1; } *ptr=val; ptr+=this->vi.channels; @@ -259,8 +256,9 @@ static void vorbis_decode_data (audio_decoder_t *this_gen, buf_element_t *buf) { /* tell libvorbis how many samples we actually consumed */ vorbis_synthesis_read(&this->vd,bout); } - } - lprintf("output not open\n"); + } else { + lprintf("output not open\n"); + } } static void vorbis_dispose (audio_decoder_t *this_gen) { -- cgit v1.2.3