# HG changeset patch # User michael # Date 1067882814 0 # Node ID fdb8244da1e50fc1b165dfed3c0527560e777b9a # Parent a70c07e13e8ec8fe155de93ae93534c734c0bdb2 av_log patch(2 of ?) by (Michel Bardiaux ) diff -r a70c07e13e8e -r fdb8244da1e5 a52dec.c --- a/a52dec.c Mon Nov 03 17:42:50 2003 +0000 +++ b/a52dec.c Mon Nov 03 18:06:54 2003 +0000 @@ -190,7 +190,7 @@ /* No specific number of channel requested */ avctx->channels = s->channels; else if (s->channels < avctx->channels) { - fprintf(stderr, "ac3dec: AC3 Source channels are less than specified: output to %d channels.. (frmsize: %d)\n", s->channels, len); + av_log(avctx, AV_LOG_ERROR, "ac3dec: AC3 Source channels are less than specified: output to %d channels.. (frmsize: %d)\n", s->channels, len); avctx->channels = s->channels; } avctx->bit_rate = bit_rate; diff -r a70c07e13e8e -r fdb8244da1e5 ac3enc.c --- a/ac3enc.c Mon Nov 03 17:42:50 2003 +0000 +++ b/ac3enc.c Mon Nov 03 18:06:54 2003 +0000 @@ -464,7 +464,7 @@ for(i=1;i EXP_DIFF_THRESHOLD) exp_strategy[i][ch] = EXP_NEW; @@ -580,11 +580,11 @@ } #if defined(DEBUG) - av_log(AV_LOG_DEBUG, "exponents: strategy=%d\n", exp_strategy); + av_log(NULL, AV_LOG_DEBUG, "exponents: strategy=%d\n", exp_strategy); for(i=0;i<=nb_groups * group_size;i++) { - av_log(AV_LOG_DEBUG, "%d ", encoded_exp[i]); + av_log(NULL, AV_LOG_DEBUG, "%d ", encoded_exp[i]); } - av_log(AV_LOG_DEBUG, "\n"); + av_log(NULL, AV_LOG_DEBUG, "\n"); #endif return 4 + (nb_groups / 3) * 7; @@ -1021,7 +1021,7 @@ #if defined(DEBUG) { static int count = 0; - av_log(AV_LOG_DEBUG, "Block #%d (%d)\n", block_num, count++); + av_log(NULL, AV_LOG_DEBUG, "Block #%d (%d)\n", block_num, count++); } #endif /* exponent strategy */ diff -r a70c07e13e8e -r fdb8244da1e5 common.c --- a/common.c Mon Nov 03 17:42:50 2003 +0000 +++ b/common.c Mon Nov 03 18:06:54 2003 +0000 @@ -282,7 +282,7 @@ nb = 1 << (table_nb_bits - n); for(k=0;kfaacDecInit(s->faac_handle ... ); if (r < 0) - fprintf(stderr, "faacDecInit2 failed r:%d sr:%ld ch:%d s:%d\n", + av_log(avctx, AV_LOG_ERROR, "faacDecInit2 failed r:%d sr:%ld ch:%d s:%d\n", r, samplerate, channels, avctx->extradata_size); return r; @@ -109,7 +109,7 @@ //printf("DECODE FRAME %d, %d, %d - %p\n", buf_size, frame_info.samples, frame_info.bytesconsumed, out); if (frame_info.error > 0) { - fprintf(stderr, "faac: frame decodinf failed: %s\n", + av_log(avctx, AV_LOG_ERROR, "faac: frame decodinf failed: %s\n", s->faacDecGetErrorMessage(frame_info.error)); return 0; } @@ -146,7 +146,7 @@ s->handle = dlopen(libfaadname, RTLD_LAZY); if (!s->handle) { - fprintf(stderr, "FAAD library: %s could not be opened! \n%s\n", + av_log(avctx, AV_LOG_ERROR, "FAAD library: %s could not be opened! \n%s\n", libfaadname, dlerror()); return -1; } @@ -182,7 +182,7 @@ } if (err) { dlclose(s->handle); - fprintf(stderr, "FAAD library: cannot resolve %s in %s!\n", + av_log(avctx, AV_LOG_ERROR, "FAAD library: cannot resolve %s in %s!\n", err, libfaadname); return -1; } @@ -190,7 +190,7 @@ s->faac_handle = s->faacDecOpen(); if (!s->faac_handle) { - fprintf(stderr, "FAAD library: cannot create handler!\n"); + av_log(avctx, AV_LOG_ERROR, "FAAD library: cannot create handler!\n"); faac_decode_end(avctx); return -1; } @@ -200,7 +200,7 @@ if (faac_cfg) { switch (avctx->bits_per_sample) { - case 8: fprintf(stderr, "FAADlib unsupported bps %d\n", avctx->bits_per_sample); break; + case 8: av_log(avctx, AV_LOG_ERROR, "FAADlib unsupported bps %d\n", avctx->bits_per_sample); break; default: case 16: faac_cfg->outputFormat = FAAD_FMT_16BIT; diff -r a70c07e13e8e -r fdb8244da1e5 liba52/resample.c --- a/liba52/resample.c Mon Nov 03 17:42:50 2003 +0000 +++ b/liba52/resample.c Mon Nov 03 18:06:54 2003 +0000 @@ -24,7 +24,7 @@ if(mm_accel&MM_ACCEL_X86_MMX){ tmp=a52_resample_MMX(flags,chans); if(tmp){ - if(a52_resample==NULL) fprintf(stderr, "Using MMX optimized resampler\n"); + if(a52_resample==NULL) av_log(NULL, AV_LOG_INFO, "Using MMX optimized resampler\n"); a52_resample=tmp; return tmp; } @@ -33,11 +33,11 @@ tmp=a52_resample_C(flags,chans); if(tmp){ - if(a52_resample==NULL) fprintf(stderr, "No accelerated resampler found\n"); + if(a52_resample==NULL) av_log(NULL, AV_LOG_INFO, "No accelerated resampler found\n"); a52_resample=tmp; return tmp; } - fprintf(stderr, "Unimplemented resampler for mode 0x%X -> %d channels conversion - Contact MPlayer developers!\n", flags, chans); + av_log(NULL, AV_LOG_ERROR, "Unimplemented resampler for mode 0x%X -> %d channels conversion - Contact MPlayer developers!\n", flags, chans); return NULL; } diff -r a70c07e13e8e -r fdb8244da1e5 mpegaudio.c --- a/mpegaudio.c Mon Nov 03 17:42:50 2003 +0000 +++ b/mpegaudio.c Mon Nov 03 18:06:54 2003 +0000 @@ -117,7 +117,7 @@ s->alloc_table = alloc_tables[table]; #ifdef DEBUG - av_log(AV_LOG_DEBUG, "%d kb/s, %d Hz, frame_size=%d bits, table=%d, padincr=%x\n", + av_log(avctx, AV_LOG_DEBUG, "%d kb/s, %d Hz, frame_size=%d bits, table=%d, padincr=%x\n", bitrate, freq, s->frame_size, table, s->frame_frac_incr); #endif