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

Supply context argument to av_log() in mpeg audio decoder.

Originally committed as revision 14312 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
Andreas Öman 2008-07-20 14:58:49 +00:00
parent 4760aec6a0
commit 11f63a221b

View File

@ -1577,7 +1577,7 @@ static int huffman_decode(MPADecodeContext *s, GranuleDef *g,
part. We must go back into the data */ part. We must go back into the data */
s_index -= 4; s_index -= 4;
skip_bits_long(&s->gb, last_pos - pos); skip_bits_long(&s->gb, last_pos - pos);
av_log(NULL, AV_LOG_INFO, "overread, skip %d enddists: %d %d\n", last_pos - pos, end_pos-pos, end_pos2-pos); av_log(s->avctx, AV_LOG_INFO, "overread, skip %d enddists: %d %d\n", last_pos - pos, end_pos-pos, end_pos2-pos);
if(s->error_resilience >= FF_ER_COMPLIANT) if(s->error_resilience >= FF_ER_COMPLIANT)
s_index=0; s_index=0;
break; break;
@ -1613,10 +1613,10 @@ static int huffman_decode(MPADecodeContext *s, GranuleDef *g,
bits_left = end_pos2 - get_bits_count(&s->gb); bits_left = end_pos2 - get_bits_count(&s->gb);
//av_log(NULL, AV_LOG_ERROR, "left:%d buf:%p\n", bits_left, s->in_gb.buffer); //av_log(NULL, AV_LOG_ERROR, "left:%d buf:%p\n", bits_left, s->in_gb.buffer);
if (bits_left < 0/* || bits_left > 500*/) { if (bits_left < 0/* || bits_left > 500*/) {
av_log(NULL, AV_LOG_ERROR, "bits_left=%d\n", bits_left); av_log(s->avctx, AV_LOG_ERROR, "bits_left=%d\n", bits_left);
s_index=0; s_index=0;
}else if(bits_left > 0 && s->error_resilience >= FF_ER_AGGRESSIVE){ }else if(bits_left > 0 && s->error_resilience >= FF_ER_AGGRESSIVE){
av_log(NULL, AV_LOG_ERROR, "bits_left=%d\n", bits_left); av_log(s->avctx, AV_LOG_ERROR, "bits_left=%d\n", bits_left);
s_index=0; s_index=0;
} }
memset(&g->sb_hybrid[s_index], 0, sizeof(*g->sb_hybrid)*(576 - s_index)); memset(&g->sb_hybrid[s_index], 0, sizeof(*g->sb_hybrid)*(576 - s_index));
@ -2057,7 +2057,7 @@ static int mp_decode_layer3(MPADecodeContext *s)
if (blocksplit_flag) { if (blocksplit_flag) {
g->block_type = get_bits(&s->gb, 2); g->block_type = get_bits(&s->gb, 2);
if (g->block_type == 0){ if (g->block_type == 0){
av_log(NULL, AV_LOG_ERROR, "invalid block type\n"); av_log(s->avctx, AV_LOG_ERROR, "invalid block type\n");
return -1; return -1;
} }
g->switch_point = get_bits1(&s->gb); g->switch_point = get_bits1(&s->gb);
@ -2109,7 +2109,7 @@ static int mp_decode_layer3(MPADecodeContext *s)
for(ch=0;ch<s->nb_channels;ch++) { for(ch=0;ch<s->nb_channels;ch++) {
g = &granules[ch][gr]; g = &granules[ch][gr];
if(get_bits_count(&s->gb)<0){ if(get_bits_count(&s->gb)<0){
av_log(NULL, AV_LOG_ERROR, "mdb:%d, lastbuf:%d skipping granule %d\n", av_log(s->avctx, AV_LOG_ERROR, "mdb:%d, lastbuf:%d skipping granule %d\n",
main_data_begin, s->last_buf_size, gr); main_data_begin, s->last_buf_size, gr);
skip_bits_long(&s->gb, g->part2_3_length); skip_bits_long(&s->gb, g->part2_3_length);
memset(g->sb_hybrid, 0, sizeof(g->sb_hybrid)); memset(g->sb_hybrid, 0, sizeof(g->sb_hybrid));
@ -2316,7 +2316,7 @@ static int mp_decode_frame(MPADecodeContext *s,
memmove(s->last_buf, s->gb.buffer + (get_bits_count(&s->gb)>>3), i); memmove(s->last_buf, s->gb.buffer + (get_bits_count(&s->gb)>>3), i);
s->last_buf_size=i; s->last_buf_size=i;
}else }else
av_log(NULL, AV_LOG_ERROR, "invalid old backstep %d\n", i); av_log(s->avctx, AV_LOG_ERROR, "invalid old backstep %d\n", i);
s->gb= s->in_gb; s->gb= s->in_gb;
s->in_gb.buffer= NULL; s->in_gb.buffer= NULL;
} }
@ -2326,7 +2326,7 @@ static int mp_decode_frame(MPADecodeContext *s,
i= (s->gb.size_in_bits - get_bits_count(&s->gb))>>3; i= (s->gb.size_in_bits - get_bits_count(&s->gb))>>3;
if(i<0 || i > BACKSTEP_SIZE || nb_frames<0){ if(i<0 || i > BACKSTEP_SIZE || nb_frames<0){
av_log(NULL, AV_LOG_ERROR, "invalid new backstep %d\n", i); av_log(s->avctx, AV_LOG_ERROR, "invalid new backstep %d\n", i);
i= FFMIN(BACKSTEP_SIZE, buf_size - HEADER_SIZE); i= FFMIN(BACKSTEP_SIZE, buf_size - HEADER_SIZE);
} }
assert(i <= buf_size - HEADER_SIZE && i>= 0); assert(i <= buf_size - HEADER_SIZE && i>= 0);