1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

av_log patch(2 of ?) by (Michel Bardiaux <mbardiaux at peaktime dot be>)

Originally committed as revision 2474 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
Michael Niedermayer 2003-11-03 18:06:54 +00:00
parent ea05d9c9c7
commit 3d0ef6dd52
6 changed files with 17 additions and 17 deletions

View File

@ -190,7 +190,7 @@ static int a52_decode_frame(AVCodecContext *avctx,
/* No specific number of channel requested */ /* No specific number of channel requested */
avctx->channels = s->channels; avctx->channels = s->channels;
else if (s->channels < avctx->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->channels = s->channels;
} }
avctx->bit_rate = bit_rate; avctx->bit_rate = bit_rate;

View File

@ -464,7 +464,7 @@ static void compute_exp_strategy(uint8_t exp_strategy[NB_BLOCKS][AC3_MAX_CHANNEL
for(i=1;i<NB_BLOCKS;i++) { for(i=1;i<NB_BLOCKS;i++) {
exp_diff = calc_exp_diff(exp[i][ch], exp[i-1][ch], N/2); exp_diff = calc_exp_diff(exp[i][ch], exp[i-1][ch], N/2);
#ifdef DEBUG #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 #endif
if (exp_diff > EXP_DIFF_THRESHOLD) if (exp_diff > EXP_DIFF_THRESHOLD)
exp_strategy[i][ch] = EXP_NEW; exp_strategy[i][ch] = EXP_NEW;
@ -580,11 +580,11 @@ static int encode_exp(uint8_t encoded_exp[N/2],
} }
#if defined(DEBUG) #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++) { 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 #endif
return 4 + (nb_groups / 3) * 7; return 4 + (nb_groups / 3) * 7;
@ -1021,7 +1021,7 @@ static void output_audio_block(AC3EncodeContext *s,
#if defined(DEBUG) #if defined(DEBUG)
{ {
static int count = 0; 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 #endif
/* exponent strategy */ /* exponent strategy */

View File

@ -282,7 +282,7 @@ static int build_table(VLC *vlc, int table_nb_bits,
nb = 1 << (table_nb_bits - n); nb = 1 << (table_nb_bits - n);
for(k=0;k<nb;k++) { for(k=0;k<nb;k++) {
#ifdef DEBUG_VLC #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); j, i, n);
#endif #endif
if (table[j][1] /*bits*/ != 0) { if (table[j][1] /*bits*/ != 0) {

View File

@ -87,7 +87,7 @@ static int faac_init_mp4(AVCodecContext *avctx)
// else r = s->faacDecInit(s->faac_handle ... ); // else r = s->faacDecInit(s->faac_handle ... );
if (r < 0) 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); r, samplerate, channels, avctx->extradata_size);
return r; return r;
@ -109,7 +109,7 @@ static int faac_decode_frame(AVCodecContext *avctx,
//printf("DECODE FRAME %d, %d, %d - %p\n", buf_size, frame_info.samples, frame_info.bytesconsumed, out); //printf("DECODE FRAME %d, %d, %d - %p\n", buf_size, frame_info.samples, frame_info.bytesconsumed, out);
if (frame_info.error > 0) { 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)); s->faacDecGetErrorMessage(frame_info.error));
return 0; return 0;
} }
@ -146,7 +146,7 @@ static int faac_decode_init(AVCodecContext *avctx)
s->handle = dlopen(libfaadname, RTLD_LAZY); s->handle = dlopen(libfaadname, RTLD_LAZY);
if (!s->handle) 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()); libfaadname, dlerror());
return -1; return -1;
} }
@ -182,7 +182,7 @@ static int faac_decode_init(AVCodecContext *avctx)
} }
if (err) { if (err) {
dlclose(s->handle); 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); err, libfaadname);
return -1; return -1;
} }
@ -190,7 +190,7 @@ static int faac_decode_init(AVCodecContext *avctx)
s->faac_handle = s->faacDecOpen(); s->faac_handle = s->faacDecOpen();
if (!s->faac_handle) { 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); faac_decode_end(avctx);
return -1; return -1;
} }
@ -200,7 +200,7 @@ static int faac_decode_init(AVCodecContext *avctx)
if (faac_cfg) { if (faac_cfg) {
switch (avctx->bits_per_sample) { 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: default:
case 16: case 16:
faac_cfg->outputFormat = FAAD_FMT_16BIT; faac_cfg->outputFormat = FAAD_FMT_16BIT;

View File

@ -24,7 +24,7 @@ void* tmp;
if(mm_accel&MM_ACCEL_X86_MMX){ if(mm_accel&MM_ACCEL_X86_MMX){
tmp=a52_resample_MMX(flags,chans); tmp=a52_resample_MMX(flags,chans);
if(tmp){ 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; a52_resample=tmp;
return tmp; return tmp;
} }
@ -33,11 +33,11 @@ void* tmp;
tmp=a52_resample_C(flags,chans); tmp=a52_resample_C(flags,chans);
if(tmp){ 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; a52_resample=tmp;
return 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; return NULL;
} }

View File

@ -117,7 +117,7 @@ static int MPA_encode_init(AVCodecContext *avctx)
s->alloc_table = alloc_tables[table]; s->alloc_table = alloc_tables[table];
#ifdef DEBUG #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); bitrate, freq, s->frame_size, table, s->frame_frac_incr);
#endif #endif