# HG changeset patch # User nicodvb # Date 1157487522 0 # Node ID d32f43ae7f5b2190de8d1d2ecf6276cae5f92e80 # Parent 3fc2235ff0626698b9e5138a5eb1e3edbc746237 in fixup_vorbis_wf() set to 0 bitrates indicated as -1 (unspecified, according to the specs); patch by Andrew Savchenko - Bircoph list ru diff -r 3fc2235ff062 -r d32f43ae7f5b libmpdemux/demux_ogg.c --- a/libmpdemux/demux_ogg.c Tue Sep 05 20:06:20 2006 +0000 +++ b/libmpdemux/demux_ogg.c Tue Sep 05 20:18:42 2006 +0000 @@ -816,13 +816,22 @@ sh->wf = (WAVEFORMATEX*)realloc(sh->wf, sizeof(WAVEFORMATEX) + sh->wf->cbSize); if(op[0].bytes >= 29) { - unsigned int br, nombr, minbr, maxbr; + unsigned int br; + int nombr, minbr, maxbr; ptr = buf[0]; sh->channels = ptr[11]; sh->samplerate = sh->wf->nSamplesPerSec = get_uint32(&ptr[12]); maxbr = get_uint32(&ptr[16]); //max nombr = get_uint32(&ptr[20]); //nominal minbr = get_uint32(&ptr[24]); //minimum + + if(maxbr == -1) + maxbr = 0; + if(nombr == -1) + nombr = 0; + if(minbr == -1) + minbr = 0; + br = maxbr / 8; if(!br) br = nombr / 8;