libopencore-amrdec: allow sampling rates other than 8khz
authorMichael Niedermayer <michaelni@gmx.at>
Fri, 2 Nov 2012 22:46:47 +0000 (23:46 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Fri, 2 Nov 2012 22:47:58 +0000 (23:47 +0100)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/libopencore-amr.c

index 2a7d252..8dac0c1 100644 (file)
@@ -31,7 +31,8 @@ static void amr_decode_fix_avctx(AVCodecContext *avctx)
 {
     const int is_amr_wb = 1 + (avctx->codec_id == AV_CODEC_ID_AMR_WB);
 
-    avctx->sample_rate = 8000 * is_amr_wb;
+    if (!avctx->sample_rate)
+        avctx->sample_rate = 8000 * is_amr_wb;
 
     if (avctx->channels > 1) {
         av_log_missing_feature(avctx, "multi-channel AMR", 0);