changeset 2393:0433866b1075 libavcodec

fixes transcoding to vorbis with ffmpeg on big endian machines patch by (Sigbjrn Skjret {sskjer-1 broadpark no})
author michael
date Sat, 18 Dec 2004 16:20:42 +0000
parents 299f2d85d27d
children 776e37360171
files oggvorbis.c
diffstat 1 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/oggvorbis.c	Sat Dec 18 03:49:07 2004 +0000
+++ b/oggvorbis.c	Sat Dec 18 16:20:42 2004 +0000
@@ -102,18 +102,18 @@
     OggVorbisContext *context = avccontext->priv_data ;
     float **buffer ;
     ogg_packet op ;
-    signed char *audio = data ;
+    signed short *audio = data ;
     int l, samples = data ? OGGVORBIS_FRAME_SIZE : 0;
 
     buffer = vorbis_analysis_buffer(&context->vd, samples) ;
 
     if(context->vi.channels == 1) {
 	for(l = 0 ; l < samples ; l++)
-	    buffer[0][l]=((audio[l*2+1]<<8)|(0x00ff&(int)audio[l*2]))/32768.f;
+	    buffer[0][l]=audio[l]/32768.f;
     } else {
 	for(l = 0 ; l < samples ; l++){
-	    buffer[0][l]=((audio[l*4+1]<<8)|(0x00ff&(int)audio[l*4]))/32768.f;
-	    buffer[1][l]=((audio[l*4+3]<<8)|(0x00ff&(int)audio[l*4+2]))/32768.f;
+	    buffer[0][l]=audio[l*2]/32768.f;
+	    buffer[1][l]=audio[l*2+1]/32768.f;
 	}
     }