summaryrefslogtreecommitdiffstats
path: root/libmpcodecs
diff options
context:
space:
mode:
authorUoti Urpala <uau@glyph.nonexistent.invalid>2010-03-21 18:45:20 +0200
committerUoti Urpala <uau@glyph.nonexistent.invalid>2010-03-21 18:46:19 +0200
commitfaea4ef439b92972e01cade158ca9bff839e297b (patch)
tree0fba840a04bf5338b1ba3d39e4f2563b524dd8ba /libmpcodecs
parent4a70750f5f825d810029c5733d68c69ecf72b9d0 (diff)
downloadmpv-faea4ef439b92972e01cade158ca9bff839e297b.tar.bz2
mpv-faea4ef439b92972e01cade158ca9bff839e297b.tar.xz
ad_ffmpeg: prefer codec to container samplerate for ffaac
Container-level information can be unreliable for AAC because of SBR handling problems, so use the samplerate value from the codec instead.
Diffstat (limited to 'libmpcodecs')
-rw-r--r--libmpcodecs/ad_ffmpeg.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/libmpcodecs/ad_ffmpeg.c b/libmpcodecs/ad_ffmpeg.c
index b2cd4573bc..c954fb2311 100644
--- a/libmpcodecs/ad_ffmpeg.c
+++ b/libmpcodecs/ad_ffmpeg.c
@@ -142,7 +142,12 @@ static int init(sh_audio_t *sh_audio)
mp_msg(MSGT_DECAUDIO, MSGL_FATAL, "Unsupported sample format\n");
return 0;
}
- if(sh_audio->wf){
+ /* If the audio is AAC the container level data may be unreliable
+ * because of SBR handling problems (possibly half real sample rate at
+ * container level). Default AAC decoding with ad_faad has used codec-level
+ * values for a long time without generating complaints so it should be OK.
+ */
+ if (sh_audio->wf && lavc_context->codec_id != CODEC_ID_AAC) {
// If the decoder uses the wrong number of channels all is lost anyway.
// sh_audio->channels=sh_audio->wf->nChannels;
if (sh_audio->wf->nSamplesPerSec)