1
0
mirror of https://github.com/mpv-player/mpv synced 2024-12-14 10:55:43 +00:00

Trust the demuxer instead of the decoder for samplerate detection.

Fixes the ffmp3_bad_rate_detection.avi sample.
patch by qwen dux qwendu__at__gmail__.__com


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@17996 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
diego 2006-03-30 08:47:09 +00:00
parent bf25812a43
commit dd32d03f3e

View File

@ -109,15 +109,14 @@ static int init(sh_audio_t *sh_audio)
x=decode_audio(sh_audio,sh_audio->a_buffer,1,sh_audio->a_buffer_size);
if(x>0) sh_audio->a_buffer_len=x;
#if 1
sh_audio->channels=lavc_context->channels;
sh_audio->samplerate=lavc_context->sample_rate;
sh_audio->i_bps=lavc_context->bit_rate/8;
#else
if(sh_audio->wf){
sh_audio->channels=sh_audio->wf->nChannels;
sh_audio->samplerate=sh_audio->wf->nSamplesPerSec;
sh_audio->i_bps=sh_audio->wf->nAvgBytesPerSec;
#endif
}
sh_audio->samplesize=2;
return 1;
}