changeset 34828:becaa4804918

Return a spf value even when srate is NULL. Based on patch by Benot Thbaudeau [benoit thebaudeau advansee com]
author reimar
date Fri, 18 May 2012 17:14:04 +0000
parents ef7be22beabe
children 77fa83061e2a
files libmpdemux/mp3_hdr.c
diffstat 1 files changed, 2 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/libmpdemux/mp3_hdr.c	Fri May 18 17:03:09 2012 +0000
+++ b/libmpdemux/mp3_hdr.c	Fri May 18 17:14:04 2012 +0000
@@ -123,19 +123,18 @@
       framesize += padding;
 
 //    if(framesize<=0 || framesize>MAXFRAMESIZE) return FALSE;
-    if(srate) {
+    if(srate)
       *srate = freqs[sampling_frequency];
       if(spf) {
         if(layer == 1)
 	  *spf = 384;
         else if(layer == 2)
 	  *spf = 1152;
-        else if(*srate < 32000)
+        else if(sampling_frequency > 2) // not 1.0
           *spf = 576;
         else
 	  *spf = 1152;
       }
-    }
     if(mpa_layer) *mpa_layer = layer;
     if(chans) *chans = stereo;
     if(br) *br = bitrate;