# HG changeset patch # User diego # Date 1242754316 0 # Node ID 5c929c37e1a008a62a15f490ceaa92ed2884bdb7 # Parent 09b3564c17e53d46da96e990b5b68a0ac956c649 Move AMR-WB-specific code to the AMR-WB section of the file. Fixes compilation when AMR-NB #includes are not available on the system. diff -r 09b3564c17e5 -r 5c929c37e1a0 libamr.c --- a/libamr.c Tue May 19 17:30:27 2009 +0000 +++ b/libamr.c Tue May 19 17:31:56 2009 +0000 @@ -57,6 +57,22 @@ #include "avcodec.h" +static void amr_decode_fix_avctx(AVCodecContext *avctx) +{ + const int is_amr_wb = 1 + (avctx->codec_id == CODEC_ID_AMR_WB); + + if (!avctx->sample_rate) + avctx->sample_rate = 8000 * is_amr_wb; + + if (!avctx->channels) + avctx->channels = 1; + + avctx->frame_size = 160 * is_amr_wb; + avctx->sample_fmt = SAMPLE_FMT_S16; +} + +#if CONFIG_LIBAMR_NB + #include #include @@ -90,22 +106,6 @@ return -1; } -static void amr_decode_fix_avctx(AVCodecContext *avctx) -{ - const int is_amr_wb = 1 + (avctx->codec_id == CODEC_ID_AMR_WB); - - if (!avctx->sample_rate) - avctx->sample_rate = 8000 * is_amr_wb; - - if (!avctx->channels) - avctx->channels = 1; - - avctx->frame_size = 160 * is_amr_wb; - avctx->sample_fmt = SAMPLE_FMT_S16; -} - -#if CONFIG_LIBAMR_NB - typedef struct AMRContext { int frameCount; void *decState;