forked from len0rd/rockbox
Codec test plugins: use DEBUGF() instead of (not cleanly avaliable) printf().
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@6052 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
6e372abb0e
commit
cb78646baf
4 changed files with 5 additions and 22 deletions
|
|
@ -66,9 +66,7 @@ void ao_play(file_info_struct* file_info,sample_t* samples,int flags) {
|
||||||
int16_samples[2*i+1] = LE_S16(convert (samples[i+256]));
|
int16_samples[2*i+1] = LE_S16(convert (samples[i+256]));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
#ifdef SIMULATOR
|
DEBUGF("ERROR: unsupported format: %d\n",flags);
|
||||||
printf("ERROR: unsupported format: %d\n",flags);
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* FIX: Buffer the disk write to write larger amounts at one */
|
/* FIX: Buffer the disk write to write larger amounts at one */
|
||||||
|
|
@ -108,9 +106,7 @@ void a52_decode_data (file_info_struct* file_info, uint8_t * start, uint8_t * en
|
||||||
|
|
||||||
length = a52_syncinfo (buf, &flags, &sample_rate, &bit_rate);
|
length = a52_syncinfo (buf, &flags, &sample_rate, &bit_rate);
|
||||||
if (!length) {
|
if (!length) {
|
||||||
#ifdef SIMULATOR
|
DEBUGF("skip\n");
|
||||||
printf("skip\n");
|
|
||||||
#endif
|
|
||||||
for (bufptr = buf; bufptr < buf + 6; bufptr++)
|
for (bufptr = buf; bufptr < buf + 6; bufptr++)
|
||||||
bufptr[0] = bufptr[1];
|
bufptr[0] = bufptr[1];
|
||||||
continue;
|
continue;
|
||||||
|
|
@ -149,9 +145,7 @@ void a52_decode_data (file_info_struct* file_info, uint8_t * start, uint8_t * en
|
||||||
bufpos = buf + 7;
|
bufpos = buf + 7;
|
||||||
continue;
|
continue;
|
||||||
error:
|
error:
|
||||||
#ifdef SIMULATOR
|
DEBUGF("error\n");
|
||||||
printf ("error\n");
|
|
||||||
#endif
|
|
||||||
bufptr = buf;
|
bufptr = buf;
|
||||||
bufpos = buf + 7;
|
bufpos = buf + 7;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -64,9 +64,7 @@ FLAC__StreamDecoderWriteStatus flac_write_handler(const FLAC__SeekableStreamDeco
|
||||||
|
|
||||||
if (samples*frame->header.channels > (FLAC_MAX_SUPPORTED_BLOCKSIZE*FLAC_MAX_SUPPORTED_CHANNELS)) {
|
if (samples*frame->header.channels > (FLAC_MAX_SUPPORTED_BLOCKSIZE*FLAC_MAX_SUPPORTED_CHANNELS)) {
|
||||||
// ERROR!!!
|
// ERROR!!!
|
||||||
#ifdef SIMULATOR
|
DEBUGF("ERROR: samples*frame->header.channels=%d\n",samples*frame->header.channels);
|
||||||
printf("ERROR: samples*frame->header.channels=%d\n",samples*frame->header.channels);
|
|
||||||
#endif
|
|
||||||
return(FLAC__STREAM_DECODER_WRITE_STATUS_CONTINUE);
|
return(FLAC__STREAM_DECODER_WRITE_STATUS_CONTINUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -19,15 +19,6 @@
|
||||||
|
|
||||||
/* Various "helper functions" common to all the xxx2wav decoder plugins */
|
/* Various "helper functions" common to all the xxx2wav decoder plugins */
|
||||||
|
|
||||||
|
|
||||||
/* A macro to enable printf for the simulator only */
|
|
||||||
|
|
||||||
#ifdef SIMULATOR
|
|
||||||
#define dprintf(...) printf(__VA_ARGS__)
|
|
||||||
#else
|
|
||||||
#define dprintf(...)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* the main data structure of the program */
|
/* the main data structure of the program */
|
||||||
typedef struct {
|
typedef struct {
|
||||||
int infile;
|
int infile;
|
||||||
|
|
|
||||||
|
|
@ -141,7 +141,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void* file)
|
||||||
if (n==0) {
|
if (n==0) {
|
||||||
eof=1;
|
eof=1;
|
||||||
} else if (n < 0) {
|
} else if (n < 0) {
|
||||||
dprintf("Error decoding frame\n");
|
DEBUGF("Error decoding frame\n");
|
||||||
} else {
|
} else {
|
||||||
file_info.frames_decoded++;
|
file_info.frames_decoded++;
|
||||||
#if BYTE_ORDER == BIG_ENDIAN
|
#if BYTE_ORDER == BIG_ENDIAN
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue