changeset 14927:4aa57ea6d129

fixed support for mp3 at <32000 sample_rate
author nicodvb
date Mon, 07 Mar 2005 07:36:27 +0000
parents 56df5a1c7a3f
children 35e2d178be91
files libmpdemux/muxer_mpeg.c
diffstat 1 files changed, 9 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/libmpdemux/muxer_mpeg.c	Sun Mar 06 22:28:00 2005 +0000
+++ b/libmpdemux/muxer_mpeg.c	Mon Mar 07 07:36:27 2005 +0000
@@ -999,7 +999,7 @@
 
 static uint32_t get_audio_frame_size(muxer_headers_t *spriv, uint8_t *buf, int format, int samples_ps)
 {
-	uint32_t sz, tmp;
+	uint32_t sz, tmp, spf;
 	
 #ifdef USE_LIBA52
 #include "../liba52/a52.h"
@@ -1011,7 +1011,14 @@
 			return sz;
 	}
 #endif
-	tmp = spriv->bitrate * (format == 0x2000 ? 1536 : 1152);
+	if(format == 0x2000)
+		spf = 1536;
+	else if((format == 0x55) && (samples_ps < 32000))
+		spf = 576;
+	else
+		spf = 1152;
+
+	tmp = spriv->bitrate * spf;
 	sz = tmp / samples_ps;
 	if(sz % 2)
 		sz++;