[MPlayer-cvslog] r19162 - trunk/libmpcodecs/ad_hwmpa.c

nicodvb subversion at mplayerhq.hu
Sun Jul 23 00:14:14 CEST 2006


Author: nicodvb
Date: Sun Jul 23 00:14:14 2006
New Revision: 19162

Modified:
   trunk/libmpcodecs/ad_hwmpa.c

Log:
the value returned  by decode_audio() must be the amount of _decoded_ bytes (finally it's beginning t work: no more toomanypackets... message)

Modified: trunk/libmpcodecs/ad_hwmpa.c
==============================================================================
--- trunk/libmpcodecs/ad_hwmpa.c	(original)
+++ trunk/libmpcodecs/ad_hwmpa.c	Sun Jul 23 00:14:14 2006
@@ -59,7 +59,7 @@
 
 static int preinit(sh_audio_t *sh)
 {
-	sh->audio_out_minsize = 48;//check
+	sh->audio_out_minsize = 4608;//check
 	sh->audio_in_minsize = 4608;//check
 	sh->sample_format = AF_FORMAT_MPEG2;
 	return 1;
@@ -85,13 +85,14 @@
 {
 	int len, start, tot;
 	int chans, srate, spf, mpa_layer, br;
+	int tot2;
 
-	tot = 0;
+	tot = tot2 = 0;
 
-	while(tot < minlen)
+	while(tot2 < maxlen)
 	{
 		start = mpa_sync(sh, 1, &len, &chans, &srate, &spf, &mpa_layer, &br);
-		if(start < 0 || tot + len > maxlen)
+		if(start < 0 || tot2 + spf * 2 * chans > maxlen)
 			break;
 
 		if(start + len > sh->a_in_buffer_len)
@@ -110,9 +111,10 @@
 
 		sh->a_in_buffer_len -= start + len;
 		memmove(sh->a_in_buffer, &(sh->a_in_buffer[start + len]), sh->a_in_buffer_len);
+		tot2 += spf * 2 * chans;
 	}
 
-	return tot;
+	return tot2;
 }
 
 



More information about the MPlayer-cvslog mailing list