From 0d00cf38c609262239a5f6da5fc7b21016278ec9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sigbj=C3=B8rn=20Skj=C3=A6ret?= Date: Sat, 18 Dec 2004 16:20:42 +0000 Subject: [PATCH] =?UTF-8?q?fixes=20transcoding=20to=20vorbis=20with=20ffmp?= =?UTF-8?q?eg=20on=20big=20endian=20machines=20patch=20by=20(Sigbj=C3=B8rn?= =?UTF-8?q?=20Skj=C3=A6ret=20{sskjer-1=20broadpark=20no})?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Originally committed as revision 3759 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavcodec/oggvorbis.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libavcodec/oggvorbis.c b/libavcodec/oggvorbis.c index 803de20632..8358411964 100644 --- a/libavcodec/oggvorbis.c +++ b/libavcodec/oggvorbis.c @@ -102,18 +102,18 @@ static int oggvorbis_encode_frame(AVCodecContext *avccontext, 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; } }