diff options
author | Sigbjørn Skjæret <cisc@broadpark.no> | 2004-12-18 16:20:42 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2004-12-18 16:20:42 +0000 |
commit | 0d00cf38c609262239a5f6da5fc7b21016278ec9 (patch) | |
tree | 6d91fb0d3b3efd465891857bfd73d405b5b353af | |
parent | 5175b9376f733735322a0272e94bd996ac157dea (diff) | |
download | ffmpeg-0d00cf38c609262239a5f6da5fc7b21016278ec9.tar.gz |
fixes transcoding to vorbis with ffmpeg on big endian machines patch by (Sigbjørn Skjæret {sskjer-1 broadpark no})
Originally committed as revision 3759 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r-- | libavcodec/oggvorbis.c | 8 |
1 files 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; } } |