From 99ad62f36f9ddb5172e97709552a25937fe5dd41 Mon Sep 17 00:00:00 2001 From: iive Date: Sun, 23 Dec 2007 11:29:36 +0000 Subject: 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. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@25514 b3059339-0415-0410-9bf9-f77b7e298cf2 --- liba52/Makefile | 2 +- liba52/test.c | 22 +++++++++++----------- 2 files changed, 12 insertions(+), 12 deletions(-) (limited to 'liba52') diff --git a/liba52/Makefile b/liba52/Makefile index 2f1e5128ad..4f80402832 100644 --- a/liba52/Makefile +++ b/liba52/Makefile @@ -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 diff --git a/liba52/test.c b/liba52/test.c index 93906d978c..8d2588c109 100644 --- a/liba52/test.c +++ b/liba52/test.c @@ -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; } -- cgit v1.2.3