mirror of https://github.com/mpv-player/mpv
in fixup_vorbis_wf() set to 0 bitrates indicated as -1 (unspecified, according to the specs); patch by Andrew Savchenko - Bircoph list ru
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@19700 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
4fd16b0702
commit
244d6ad8e8
|
@ -816,13 +816,22 @@ static void fixup_vorbis_wf(sh_audio_t *sh, ogg_demuxer_t *od)
|
||||||
sh->wf = (WAVEFORMATEX*)realloc(sh->wf, sizeof(WAVEFORMATEX) + sh->wf->cbSize);
|
sh->wf = (WAVEFORMATEX*)realloc(sh->wf, sizeof(WAVEFORMATEX) + sh->wf->cbSize);
|
||||||
|
|
||||||
if(op[0].bytes >= 29) {
|
if(op[0].bytes >= 29) {
|
||||||
unsigned int br, nombr, minbr, maxbr;
|
unsigned int br;
|
||||||
|
int nombr, minbr, maxbr;
|
||||||
ptr = buf[0];
|
ptr = buf[0];
|
||||||
sh->channels = ptr[11];
|
sh->channels = ptr[11];
|
||||||
sh->samplerate = sh->wf->nSamplesPerSec = get_uint32(&ptr[12]);
|
sh->samplerate = sh->wf->nSamplesPerSec = get_uint32(&ptr[12]);
|
||||||
maxbr = get_uint32(&ptr[16]); //max
|
maxbr = get_uint32(&ptr[16]); //max
|
||||||
nombr = get_uint32(&ptr[20]); //nominal
|
nombr = get_uint32(&ptr[20]); //nominal
|
||||||
minbr = get_uint32(&ptr[24]); //minimum
|
minbr = get_uint32(&ptr[24]); //minimum
|
||||||
|
|
||||||
|
if(maxbr == -1)
|
||||||
|
maxbr = 0;
|
||||||
|
if(nombr == -1)
|
||||||
|
nombr = 0;
|
||||||
|
if(minbr == -1)
|
||||||
|
minbr = 0;
|
||||||
|
|
||||||
br = maxbr / 8;
|
br = maxbr / 8;
|
||||||
if(!br)
|
if(!br)
|
||||||
br = nombr / 8;
|
br = nombr / 8;
|
||||||
|
|
Loading…
Reference in New Issue