summaryrefslogtreecommitdiffstats
path: root/libmpdemux/demux_ogg.c
diff options
context:
space:
mode:
authornicodvb <nicodvb@b3059339-0415-0410-9bf9-f77b7e298cf2>2006-09-05 20:18:42 +0000
committernicodvb <nicodvb@b3059339-0415-0410-9bf9-f77b7e298cf2>2006-09-05 20:18:42 +0000
commit244d6ad8e842d4e18ff74e5d5d24afc412e0b3d3 (patch)
tree4fbc053932a2a775502c1a73cb59d8a528c0f8ae /libmpdemux/demux_ogg.c
parent4fd16b07024567008d557f7e91f66983ea686a3d (diff)
downloadmpv-244d6ad8e842d4e18ff74e5d5d24afc412e0b3d3.tar.bz2
mpv-244d6ad8e842d4e18ff74e5d5d24afc412e0b3d3.tar.xz
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
Diffstat (limited to 'libmpdemux/demux_ogg.c')
-rw-r--r--libmpdemux/demux_ogg.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/libmpdemux/demux_ogg.c b/libmpdemux/demux_ogg.c
index 586267bdf2..79f7e02e32 100644
--- a/libmpdemux/demux_ogg.c
+++ b/libmpdemux/demux_ogg.c
@@ -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);
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;