[MPlayer-cvslog] r25514 - in trunk/liba52: Makefile test.c
iive
subversion at mplayerhq.hu
Sun Dec 23 12:29:37 CET 2007
Author: iive
Date: Sun Dec 23 12:29:36 2007
New Revision: 25514
Log:
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.
Modified:
trunk/liba52/Makefile
trunk/liba52/test.c
Modified: trunk/liba52/Makefile
==============================================================================
--- trunk/liba52/Makefile (original)
+++ trunk/liba52/Makefile Sun Dec 23 12:29:36 2007
@@ -12,5 +12,5 @@ SRCS_COMMON = crc.c \
include ../mpcommon.mak
-test: test.c ../osdep/libosdep.a $(LIBNAME_COMMON)
+test: test.c ../cpudetect.o $(LIBNAME_COMMON)
$(CC) $(CFLAGS) -o $@ $^ -lm
Modified: trunk/liba52/test.c
==============================================================================
--- trunk/liba52/test.c (original)
+++ trunk/liba52/test.c Sun Dec 23 12:29:36 2007
@@ -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 @@ long long t, sum=0, min=256*256*256*64;
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 @@ ENDTIMING
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 @@ sum=0;
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;
}
More information about the MPlayer-cvslog
mailing list