Mercurial > libavcodec.hg
changeset 1602:fdb8244da1e5 libavcodec
av_log patch(2 of ?) by (Michel Bardiaux <mbardiaux at peaktime dot be>)
author | michael |
---|---|
date | Mon, 03 Nov 2003 18:06:54 +0000 |
parents | a70c07e13e8e |
children | 3a633a3feef6 |
files | a52dec.c ac3enc.c common.c faad.c liba52/resample.c mpegaudio.c |
diffstat | 6 files changed, 17 insertions(+), 17 deletions(-) [+] |
line wrap: on
line diff
--- 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;
--- 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<NB_BLOCKS;i++) { exp_diff = calc_exp_diff(exp[i][ch], exp[i-1][ch], N/2); #ifdef DEBUG - av_log(AV_LOG_DEBUG, "exp_diff=%d\n", exp_diff); + av_log(NULL, AV_LOG_DEBUG, "exp_diff=%d\n", exp_diff); #endif if (exp_diff > 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 */
--- 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;k<nb;k++) { #ifdef DEBUG_VLC - av_log(AV_LOG_DEBUG, "%4x: code=%d n=%d\n", + av_log(NULL, AV_LOG_DEBUG, "%4x: code=%d n=%d\n", j, i, n); #endif if (table[j][1] /*bits*/ != 0) {
--- a/faad.c Mon Nov 03 17:42:50 2003 +0000 +++ b/faad.c Mon Nov 03 18:06:54 2003 +0000 @@ -87,7 +87,7 @@ // else r = s->faacDecInit(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;
--- 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; }
--- 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