changeset 25486:853622d14aa4

Fix compilation of liba52/test.c testing and benchmarking application. It have been broken since API changes in liba52-0.7.4 that have been introduced with commit r18723.
author iive
date Sun, 23 Dec 2007 11:29:36 +0000
parents 765211fd3efb
children 81a77832f5fc
files liba52/Makefile liba52/test.c
diffstat 2 files changed, 12 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/liba52/Makefile	Sat Dec 22 20:17:57 2007 +0000
+++ b/liba52/Makefile	Sun Dec 23 11:29:36 2007 +0000
@@ -12,5 +12,5 @@
 
 include ../mpcommon.mak
 
-test: test.c ../osdep/libosdep.a $(LIBNAME_COMMON)
+test: test.c ../cpudetect.o $(LIBNAME_COMMON)
 	$(CC) $(CFLAGS) -o $@ $^ -lm
--- a/liba52/test.c	Sat Dec 22 20:17:57 2007 +0000
+++ b/liba52/test.c	Sun Dec 23 11:29:36 2007 +0000
@@ -1,7 +1,7 @@
 // liba52 sample by A'rpi/ESP-team
 // Reads an AC-3 stream from stdin, decodes and downmixes to s16 stereo PCM
 // and writes it to stdout. The resulting stream is playable with sox:
-//   play -c 2 -r 48000 out.sw
+//   play -c2 -r48000 -sw -fs out.sw
 
 //#define TIMING //needs Pentium or newer 
 
@@ -14,14 +14,13 @@
 #include "mm_accel.h"
 #include "../cpudetect.h"
 
-static sample_t * samples;
-static a52_state_t state;
+static a52_state_t *state;
 static uint8_t buf[3840];
 static int buf_size=0;
 
 static int16_t out_buf[6*256*6];
 
-void mp_msg_c( int x, const char *format, ... ) // stub for cpudetect.c
+void mp_msg( int x, const char *format, ... ) // stub for cpudetect.c
 {
 }
 
@@ -64,8 +63,8 @@
     if(gCpuCaps.has3DNow) 	accel |= MM_ACCEL_X86_3DNOW;
 //    if(gCpuCaps.has3DNowExt) 	accel |= MM_ACCEL_X86_3DNOWEXT;
     
-    samples = a52_init (accel);
-    if (samples == NULL) {
+    state = a52_init (accel);
+    if (state == NULL) {
 	fprintf (stderr, "A52 init failed\n");
 	return 1;
     }
@@ -104,20 +103,20 @@
     
     flags |= A52_ADJUST_LEVEL;
 STARTTIMING
-    if (a52_frame (&state, buf, &flags, &level, bias))
+    if (a52_frame (state, buf, &flags, &level, bias))
 	{ fprintf(stderr,"error at decoding\n"); continue; }
 ENDTIMING
 
-    // a52_dynrng (&state, NULL, NULL); // disable dynamic range compensation
+    // a52_dynrng (state, NULL, NULL); // disable dynamic range compensation
 
 STARTTIMING
     a52_resample_init(accel,flags,channels);
     s16 = out_buf;
     for (i = 0; i < 6; i++) {
-	if (a52_block (&state, samples))
+	if (a52_block (state))
 	    { fprintf(stderr,"error at sampling\n"); break; }
 	// float->int + channels interleaving:
-	s16+=a52_resample(samples,s16);
+	s16+=a52_resample(a52_samples(state),s16);
 ENDTIMING
     }
 #ifdef TIMING
@@ -130,7 +129,8 @@
 
 eof:
 #ifdef TIMING
-fprintf(stderr, "%4.4fk cycles ",min/1000.0);
+fprintf(stderr, "%4.4fk cycles\n",min/1000.0);
 sum=0;
 #endif
+return 0;
 }