[MPlayer-dev-eng] [PATCH]samplerate of ffmpeg aac decoder

qwen dux qwendu at gmail.com
Mon May 3 12:45:54 CEST 2010


HI,
    I found the samplerate detected error when it lower 32000.
--- libmpcodecs/ad_ffmpeg.c     (revision 31128)
+++ libmpcodecs/ad_ffmpeg.c     (working copy)
@@ -134,6 +134,9 @@
   sh_audio->channels=lavc_context->channels;
   sh_audio->samplerate=lavc_context->sample_rate;
   sh_audio->i_bps=lavc_context->bit_rate/8;
+  if(lavc_context->codec_id == CODEC_ID_AAC){
+      if(sh_audio->samplerate<=24000) sh_audio->samplerate*=2;
+  }
   switch (lavc_context->sample_fmt) {
       case SAMPLE_FMT_U8:  sh_audio->sample_format = AF_FORMAT_U8;
break;
       case SAMPLE_FMT_S16: sh_audio->sample_format = AF_FORMAT_S16_NE;
break;



More information about the MPlayer-dev-eng mailing list