[MPlayer-cvslog] r19700 - trunk/libmpdemux/demux_ogg.c

nicodvb subversion at mplayerhq.hu
Tue Sep 5 22:18:42 CEST 2006


Author: nicodvb
Date: Tue Sep  5 22:18:42 2006
New Revision: 19700

Modified:
   trunk/libmpdemux/demux_ogg.c

Log:
in fixup_vorbis_wf() set to 0 bitrates indicated as -1 (unspecified, according to the specs); patch by Andrew Savchenko - Bircoph list ru

Modified: trunk/libmpdemux/demux_ogg.c
==============================================================================
--- trunk/libmpdemux/demux_ogg.c	(original)
+++ trunk/libmpdemux/demux_ogg.c	Tue Sep  5 22:18:42 2006
@@ -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;



More information about the MPlayer-cvslog mailing list