alac : fix case where bits_per_sample is not set.
authorBaptiste Coudurier <baptiste.coudurier@smartjog.com>
Mon, 8 Sep 2008 19:05:46 +0000 (19:05 +0000)
committerJai Menon <jmenon86@gmail.com>
Mon, 8 Sep 2008 19:05:46 +0000 (19:05 +0000)
Patch by Baptiste

Originally committed as revision 15275 to svn://svn.ffmpeg.org/ffmpeg/trunk

libavcodec/alac.c

index 9c5f621..8cf1ccc 100644 (file)
@@ -597,7 +597,7 @@ static av_cold int alac_decode_init(AVCodecContext * avctx)
     alac->context_initialized = 0;
 
     alac->numchannels = alac->avctx->channels;
-    alac->bytespersample = (avctx->bits_per_coded_sample / 8) * alac->numchannels;
+    alac->bytespersample = 2 * alac->numchannels;
     avctx->sample_fmt = SAMPLE_FMT_S16;
 
     return 0;