[MPlayer-cvslog] r32476 - trunk/libmpcodecs/ad_ffmpeg.c

reimar subversion at mplayerhq.hu
Sat Oct 9 19:52:35 CEST 2010


Author: reimar
Date: Sat Oct  9 19:52:35 2010
New Revision: 32476

Log:
Avoid printing AAC with SBR warning on every decode call, instead print
it only after every decoder reconfiguration.

Modified:
   trunk/libmpcodecs/ad_ffmpeg.c

Modified: trunk/libmpcodecs/ad_ffmpeg.c
==============================================================================
--- trunk/libmpcodecs/ad_ffmpeg.c	Sat Oct  9 17:55:09 2010	(r32475)
+++ trunk/libmpcodecs/ad_ffmpeg.c	Sat Oct  9 19:52:35 2010	(r32476)
@@ -55,6 +55,7 @@ static int preinit(sh_audio_t *sh)
 
 static int setup_format(sh_audio_t *sh_audio, const AVCodecContext *lavc_context)
 {
+    int broken_srate = 0;
     int samplerate    = lavc_context->sample_rate;
     int sample_format = sh_audio->sample_format;
     switch (lavc_context->sample_fmt) {
@@ -71,8 +72,7 @@ static int setup_format(sh_audio_t *sh_a
 
         if (lavc_context->codec_id == CODEC_ID_AAC &&
             samplerate == 2*sh_audio->wf->nSamplesPerSec) {
-            mp_msg(MSGT_DECAUDIO, MSGL_WARN,
-                   "Ignoring broken container sample rate for AAC with SBR\n");
+            broken_srate = 1;
         } else if (sh_audio->wf->nSamplesPerSec)
             samplerate=sh_audio->wf->nSamplesPerSec;
     }
@@ -83,6 +83,9 @@ static int setup_format(sh_audio_t *sh_a
         sh_audio->samplerate=samplerate;
         sh_audio->sample_format = sample_format;
         sh_audio->samplesize=af_fmt2bits(sh_audio->sample_format)/ 8;
+        if (broken_srate)
+            mp_msg(MSGT_DECAUDIO, MSGL_WARN,
+                   "Ignoring broken container sample rate for AAC with SBR\n");
         return 1;
     }
     return 0;


More information about the MPlayer-cvslog mailing list