changeset 31009:591ab361a131

Add workaround for aac-sbr-ffaac-slow.mkv playing to slow with FFmpeg AAC decoder due to wrong sample rate in container.
author reimar
date Tue, 20 Apr 2010 20:22:49 +0000
parents 23af929986ec
children b7040d298579
files libmpcodecs/ad_ffmpeg.c
diffstat 1 files changed, 5 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/libmpcodecs/ad_ffmpeg.c	Tue Apr 20 14:47:31 2010 +0000
+++ b/libmpcodecs/ad_ffmpeg.c	Tue Apr 20 20:22:49 2010 +0000
@@ -146,6 +146,11 @@
   if(sh_audio->wf){
       // If the decoder uses the wrong number of channels all is lost anyway.
       // sh_audio->channels=sh_audio->wf->nChannels;
+      if (lavc_context->codec_id == CODEC_ID_AAC &&
+          sh_audio->samplerate == 2*sh_audio->wf->nSamplesPerSec) {
+          mp_msg(MSGT_DECAUDIO, MSGL_WARN,
+                 "Ignoring broken container sample rate for ACC with SBR\n");
+      } else
       if (sh_audio->wf->nSamplesPerSec)
       sh_audio->samplerate=sh_audio->wf->nSamplesPerSec;
       if (sh_audio->wf->nAvgBytesPerSec)