Commit 9b879566 authored by Michel Bardiaux's avatar Michel Bardiaux Committed by Michael Niedermayer
Browse files

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

Originally committed as revision 2469 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent 8bae9ddc
......@@ -333,7 +333,7 @@ static int decode_p_frame(FourXContext *f, uint8_t *buf, int length){
const int wordstream_size= get32(buf+12);
if(bitstream_size+ bytestream_size+ wordstream_size + 20 != length)
printf("lengths %d %d %d %d\n", bitstream_size, bytestream_size, wordstream_size,
av_log(f->avctx, AV_LOG_ERROR, "lengths %d %d %d %d\n", bitstream_size, bytestream_size, wordstream_size,
bitstream_size+ bytestream_size+ wordstream_size - length);
f->bitstream_buffer= av_fast_realloc(f->bitstream_buffer, &f->bitstream_buffer_size, bitstream_size + FF_INPUT_BUFFER_PADDING_SIZE);
......@@ -354,7 +354,7 @@ static int decode_p_frame(FourXContext *f, uint8_t *buf, int length){
}
if(bitstream_size != (get_bits_count(&f->gb)+31)/32*4)
printf(" %d %d %d bytes left\n",
av_log(f->avctx, AV_LOG_ERROR, " %d %d %d bytes left\n",
bitstream_size - (get_bits_count(&f->gb)+31)/32*4,
bytestream_size - (f->bytestream - (buf + 20 + bitstream_size + wordstream_size)),
wordstream_size - (((uint8_t*)f->wordstream) - (buf + 20 + bitstream_size))
......@@ -373,7 +373,7 @@ static int decode_i_block(FourXContext *f, DCTELEM *block){
/* DC coef */
val = get_vlc2(&f->pre_gb, f->pre_vlc.table, ACDC_VLC_BITS, 3);
if (val>>4){
printf("error dc run != 0\n");
av_log(f->avctx, AV_LOG_ERROR, "error dc run != 0\n");
}
if(val)
......@@ -396,7 +396,7 @@ static int decode_i_block(FourXContext *f, DCTELEM *block){
level = get_xbits(&f->gb, code & 0xf);
i += code >> 4;
if (i >= 64) {
printf("run %d oveflow\n", i);
av_log(f->avctx, AV_LOG_ERROR, "run %d oveflow\n", i);
return 0;
}
......@@ -535,7 +535,7 @@ static uint8_t *read_huffman_tables(FourXContext *f, uint8_t * const buf){
for(node= j; up[node] != -1; node= up[node]){
bits += flag[node]<<len;
len++;
if(len > 31) printf("vlc length overflow\n"); //can this happen at all ?
if(len > 31) av_log(f->avctx, AV_LOG_ERROR, "vlc length overflow\n"); //can this happen at all ?
}
bits_tab[j]= bits;
......@@ -561,7 +561,7 @@ static int decode_i_frame(FourXContext *f, uint8_t *buf, int length){
uint8_t *prestream= buf + bitstream_size + 12;
if(prestream_size + bitstream_size + 12 != length)
fprintf(stderr, "size missmatch %d %d %d\n", prestream_size, bitstream_size, length);
av_log(f->avctx, AV_LOG_ERROR, "size missmatch %d %d %d\n", prestream_size, bitstream_size, length);
prestream= read_huffman_tables(f, prestream);
......@@ -586,7 +586,7 @@ static int decode_i_frame(FourXContext *f, uint8_t *buf, int length){
}
if(get_vlc2(&f->pre_gb, f->pre_vlc.table, ACDC_VLC_BITS, 3) != 256)
printf("end missmatch\n");
av_log(f->avctx, AV_LOG_ERROR, "end missmatch\n");
return 0;
}
......@@ -609,7 +609,7 @@ static int decode_frame(AVCodecContext *avctx,
frame_4cc= get32(buf);
if(buf_size != get32(buf+4)+8){
fprintf(stderr, "size missmatch %d %d\n", buf_size, get32(buf+4));
av_log(f->avctx, AV_LOG_ERROR, "size missmatch %d %d\n", buf_size, get32(buf+4));
}
if(frame_4cc == ff_get_fourcc("cfrm")){
......@@ -621,7 +621,7 @@ static int decode_frame(AVCodecContext *avctx,
for(i=0; i<CFRAME_BUFFER_COUNT; i++){
if(f->cfrm[i].id && f->cfrm[i].id < avctx->frame_number)
printf("lost c frame %d\n", f->cfrm[i].id);
av_log(f->avctx, AV_LOG_ERROR, "lost c frame %d\n", f->cfrm[i].id);
}
for(i=0; i<CFRAME_BUFFER_COUNT; i++){
......@@ -645,7 +645,7 @@ static int decode_frame(AVCodecContext *avctx,
frame_size= cfrm->size;
if(id != avctx->frame_number){
printf("cframe id missmatch %d %d\n", id, avctx->frame_number);
av_log(f->avctx, AV_LOG_ERROR, "cframe id missmatch %d %d\n", id, avctx->frame_number);
}
cfrm->size= cfrm->id= 0;
......@@ -671,7 +671,7 @@ static int decode_frame(AVCodecContext *avctx,
p->reference= 1;
if(avctx->get_buffer(avctx, p) < 0){
fprintf(stderr, "get_buffer() failed\n");
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
return -1;
}
......@@ -684,9 +684,9 @@ static int decode_frame(AVCodecContext *avctx,
if(decode_p_frame(f, buf, frame_size) < 0)
return -1;
}else if(frame_4cc == ff_get_fourcc("snd_")){
printf("ignoring snd_ chunk length:%d\n", buf_size);
av_log(avctx, AV_LOG_ERROR, "ignoring snd_ chunk length:%d\n", buf_size);
}else{
printf("ignoring unknown chunk length:%d\n", buf_size);
av_log(avctx, AV_LOG_ERROR, "ignoring unknown chunk length:%d\n", buf_size);
}
#if 0
......
......@@ -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++) {
exp_diff = calc_exp_diff(exp[i][ch], exp[i-1][ch], N/2);
#ifdef DEBUG
printf("exp_diff=%d\n", exp_diff);
av_log(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 @@ static int encode_exp(uint8_t encoded_exp[N/2],
}
#if defined(DEBUG)
printf("exponents: strategy=%d\n", exp_strategy);
av_log(AV_LOG_DEBUG, "exponents: strategy=%d\n", exp_strategy);
for(i=0;i<=nb_groups * group_size;i++) {
printf("%d ", encoded_exp[i]);
av_log(AV_LOG_DEBUG, "%d ", encoded_exp[i]);
}
printf("\n");
av_log(AV_LOG_DEBUG, "\n");
#endif
return 4 + (nb_groups / 3) * 7;
......@@ -746,7 +746,7 @@ static int compute_bit_allocation(AC3EncodeContext *s,
bit_alloc(s, bap, encoded_exp, exp_strategy, frame_bits, csnroffst, 0) < 0)
csnroffst -= SNR_INC1;
if (csnroffst < 0) {
fprintf(stderr, "Yack, Error !!!\n");
av_log(NULL, AV_LOG_ERROR, "Yack, Error !!!\n");
return -1;
}
while ((csnroffst + SNR_INC1) <= 63 &&
......@@ -1021,7 +1021,7 @@ static void output_audio_block(AC3EncodeContext *s,
#if defined(DEBUG)
{
static int count = 0;
printf("Block #%d (%d)\n", block_num, count++);
av_log(AV_LOG_DEBUG, "Block #%d (%d)\n", block_num, count++);
}
#endif
/* exponent strategy */
......
......@@ -129,7 +129,7 @@ static int adpcm_encode_init(AVCodecContext *avctx)
return -1; /* only stereo or mono =) */
switch(avctx->codec->id) {
case CODEC_ID_ADPCM_IMA_QT:
fprintf(stderr, "ADPCM: codec admcp_ima_qt unsupported for encoding !\n");
av_log(avctx, AV_LOG_ERROR, "ADPCM: codec admcp_ima_qt unsupported for encoding !\n");
avctx->frame_size = 64; /* XXX: can multiple of avctx->channels * 64 (left and right blocks are interleaved) */
return -1;
break;
......@@ -140,7 +140,7 @@ static int adpcm_encode_init(AVCodecContext *avctx)
/* seems frame_size isn't taken into account... have to buffer the samples :-( */
break;
case CODEC_ID_ADPCM_MS:
fprintf(stderr, "ADPCM: codec admcp_ms unsupported for encoding !\n");
av_log(avctx, AV_LOG_ERROR, "ADPCM: codec admcp_ms unsupported for encoding !\n");
return -1;
break;
default:
......@@ -496,7 +496,7 @@ static int adpcm_decode_frame(AVCodecContext *avctx,
cs->step_index = (*src++) & 0x7F;
if (cs->step_index > 88) fprintf(stderr, "ERROR: step_index = %i\n", cs->step_index);
if (cs->step_index > 88) av_log(avctx, AV_LOG_ERROR, "ERROR: step_index = %i\n", cs->step_index);
if (cs->step_index > 88) cs->step_index = 88;
cs->step = step_table[cs->step_index];
......@@ -540,7 +540,7 @@ static int adpcm_decode_frame(AVCodecContext *avctx,
cs->step_index = *src++;
if (cs->step_index < 0) cs->step_index = 0;
if (cs->step_index > 88) cs->step_index = 88;
if (*src++) fprintf(stderr, "unused byte should be null !!\n"); /* unused */
if (*src++) av_log(avctx, AV_LOG_ERROR, "unused byte should be null !!\n"); /* unused */
if (st) {
cs = &(c->status[1]);
......
......@@ -199,7 +199,7 @@ static int adx_encode_init(AVCodecContext *avctx)
// avctx->bit_rate = avctx->sample_rate*avctx->channels*18*8/32;
printf("adx encode init\n"); fflush(stdout);
av_log(avctx, AV_LOG_DEBUG, "adx encode init\n");
adx_decode_init(avctx);
return 0;
......@@ -318,11 +318,11 @@ static void dump(unsigned char *buf,size_t len)
{
int i;
for(i=0;i<len;i++) {
if ((i&15)==0) printf("%04x ",i);
printf("%02x ",buf[i]);
if ((i&15)==15) printf("\n");
if ((i&15)==0) av_log(NULL, AV_LOG_DEBUG, "%04x ",i);
av_log(NULL, AV_LOG_DEBUG, "%02x ",buf[i]);
if ((i&15)==15) av_log(NULL, AV_LOG_DEBUG, "\n");
}
printf("\n");
av_log(NULL, AV_LOG_ERROR, "\n");
}
static int adx_decode_frame(AVCodecContext *avctx,
void *data, int *data_size,
......
......@@ -207,7 +207,7 @@ static inline int asv1_decode_block(ASV1Context *a, DCTELEM block[64]){
if(ccp){
if(ccp == 16) break;
if(ccp < 0 || i>=10){
printf("coded coeff pattern damaged\n");
av_log(a->avctx, AV_LOG_ERROR, "coded coeff pattern damaged\n");
return -1;
}
......@@ -415,7 +415,7 @@ static int decode_frame(AVCodecContext *avctx,
p->reference= 0;
if(avctx->get_buffer(avctx, p) < 0){
fprintf(stderr, "get_buffer() failed\n");
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
return -1;
}
p->pict_type= I_TYPE;
......@@ -561,7 +561,7 @@ static int decode_init(AVCodecContext *avctx){
a->inv_qscale= ((uint8_t*)avctx->extradata)[0];
if(a->inv_qscale == 0){
printf("illegal qscale 0\n");
av_log(avctx, AV_LOG_ERROR, "illegal qscale 0\n");
if(avctx->codec_id == CODEC_ID_ASV1)
a->inv_qscale= 6;
else
......
......@@ -1830,6 +1830,28 @@ void *__av_mallocz_static(void** location, unsigned int size);
/* add by bero : in adx.c */
int is_adx(const unsigned char *buf,size_t bufsize);
/* av_log API */
#include <stdarg.h>
#define AV_LOG_ERROR 0
#define AV_LOG_INFO 1
#define AV_LOG_DEBUG 2
extern void av_log(AVCodecContext*, int level, const char *fmt, ...) __attribute__ ((__format__ (__printf__, 3, 4)));
extern void av_vlog(AVCodecContext*, int level, const char *fmt, va_list);
extern int av_log_get_level(void);
extern void av_log_set_level(int);
extern void av_log_set_callback(void (*)(AVCodecContext*, int, const char*, va_list));
#undef AV_LOG_TRAP_PRINTF
#ifdef AV_LOG_TRAP_PRINTF
#define printf DO NOT USE
#define fprintf DO NOT USE
#undef stderr
#define stderr DO NOT USE
#endif
#ifdef __cplusplus
}
#endif
......
......@@ -418,7 +418,7 @@ static int cinepak_decode_frame(AVCodecContext *avctx,
s->size = buf_size;
if (avctx->get_buffer(avctx, &s->frame)) {
printf (" Cinepak: get_buffer() failed\n");
av_log(avctx, AV_LOG_ERROR, " Cinepak: get_buffer() failed\n");
return -1;
}
......
......@@ -55,7 +55,7 @@ static int decode_frame(AVCodecContext *avctx,
p->reference= 0;
if(avctx->get_buffer(avctx, p) < 0){
fprintf(stderr, "get_buffer() failed\n");
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
return -1;
}
p->pict_type= I_TYPE;
......
......@@ -196,7 +196,8 @@ void align_get_bits(GetBitContext *s)
int check_marker(GetBitContext *s, const char *msg)
{
int bit= get_bits1(s);
if(!bit) printf("Marker bit missing %s\n", msg);
if(!bit)
av_log(NULL, AV_LOG_INFO, "Marker bit missing %s\n", msg);
return bit;
}
......@@ -281,11 +282,11 @@ static int build_table(VLC *vlc, int table_nb_bits,
nb = 1 << (table_nb_bits - n);
for(k=0;k<nb;k++) {
#ifdef DEBUG_VLC
printf("%4x: code=%d n=%d\n",
av_log(AV_LOG_DEBUG, "%4x: code=%d n=%d\n",
j, i, n);
#endif
if (table[j][1] /*bits*/ != 0) {
fprintf(stderr, "incorrect codes\n");
av_log(NULL, AV_LOG_ERROR, "incorrect codes\n");
av_abort();
}
table[j][1] = n; //bits
......
......@@ -192,7 +192,7 @@ inline void dprintf(const char* fmt,...) {}
# endif /* !CONFIG_WIN32 */
# define av_abort() do { fprintf(stderr, "Abort at %s:%d\n", __FILE__, __LINE__); abort(); } while (0)
# define av_abort() do { av_log(NULL, AV_LOG_ERROR, "Abort at %s:%d\n", __FILE__, __LINE__); abort(); } while (0)
//rounded divison & shift
#define RSHIFT(a,b) ((a) > 0 ? ((a) + (1<<((b)-1)))>>(b) : ((a) + (1<<((b)-1))-1)>>(b))
......
......@@ -88,7 +88,7 @@ static int cyuv_decode_frame(AVCodecContext *avctx,
* of 4 pixels. Thus, the total size of the buffer ought to be:
* (3 * 16) + height * (width * 3 / 4) */
if (buf_size != 48 + s->height * (s->width * 3 / 4)) {
printf ("ffmpeg: cyuv: got a buffer with %d bytes when %d were expected\n",
av_log(avctx, AV_LOG_ERROR, "ffmpeg: cyuv: got a buffer with %d bytes when %d were expected\n",
buf_size,
48 + s->height * (s->width * 3 / 4));
return -1;
......@@ -102,7 +102,7 @@ static int cyuv_decode_frame(AVCodecContext *avctx,
s->frame.reference = 0;
if(avctx->get_buffer(avctx, &s->frame) < 0) {
fprintf(stderr, "get_buffer() failed\n");
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
return -1;
}
......
......@@ -3089,7 +3089,7 @@ void dsputil_init(DSPContext* c, AVCodecContext *avctx)
c->idct_permutation[i]= ((i&7)<<3) | (i>>3);
break;
default:
fprintf(stderr, "Internal error, IDCT permutation not set\n");
av_log(avctx, AV_LOG_ERROR, "Internal error, IDCT permutation not set\n");
}
}
......@@ -297,7 +297,7 @@ static void dv_decode_ac(DVVideoDecodeContext *s,
if (pos >= 64) {
read_error:
#if defined(VLC_DEBUG) || 1
fprintf(stderr, "error pos=%d\n", pos);
av_log(NULL, AV_LOG_ERROR, "error pos=%d\n", pos);
#endif
/* for errors, we consider the eob is reached */
mb->eob_reached = 1;
......@@ -868,7 +868,7 @@ static int dvvideo_decode_frame(AVCodecContext *avctx,
avctx->width = s->sys->width;
avctx->height = s->sys->height;
if(avctx->get_buffer(avctx, &s->picture) < 0) {
fprintf(stderr, "get_buffer() failed\n");
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
return -1;
}
s->picture.interlaced_frame = 1;
......
......@@ -669,12 +669,12 @@ void ff_er_frame_end(MpegEncContext *s){
if(!s->error_resilience || s->error_count==0) return;
fprintf(stderr, "concealing errors\n");
av_log(s->avctx, AV_LOG_INFO, "concealing errors\n");
if(s->motion_val == NULL){
int size = (2 * s->mb_width + 2) * (2 * s->mb_height + 2);
fprintf(stderr, "Warning MVs not available\n");
av_log(s->avctx, AV_LOG_ERROR, "Warning MVs not available\n");
s->motion_val= av_mallocz(size * 2 * sizeof(int16_t));
}
......@@ -684,9 +684,9 @@ void ff_er_frame_end(MpegEncContext *s){
for(mb_x=0; mb_x<s->mb_width; mb_x++){
int status= s->error_status_table[mb_x + mb_y*s->mb_stride];
printf("%2X ", status);
av_log(s->avctx, AV_LOG_DEBUG, "%2X ", status);
}
printf("\n");
av_log(s->avctx, AV_LOG_DEBUG, "\n");
}
}
......
......@@ -61,7 +61,7 @@ static void evalExpression(Parser *p);
static void push(Parser *p, double d){
if(p->stack_index+1>= STACK_SIZE){
fprintf(stderr, "stack overflow in the parser\n");
av_log(NULL, AV_LOG_ERROR, "stack overflow in the parser\n");
return;
}
p->stack[ p->stack_index++ ]= d;
......@@ -70,7 +70,7 @@ static void push(Parser *p, double d){
static double pop(Parser *p){
if(p->stack_index<=0){
fprintf(stderr, "stack underflow in the parser\n");
av_log(NULL, AV_LOG_ERROR, "stack underflow in the parser\n");
return NAN;
}
//printf("pop\n"); fflush(stdout);
......@@ -109,7 +109,7 @@ static void evalPrimary(Parser *p){
p->s= strchr(p->s, '(');
if(p->s==NULL){
fprintf(stderr, "Parser: missing ( in \"%s\"\n", next);
av_log(NULL, AV_LOG_ERROR, "Parser: missing ( in \"%s\"\n", next);
return;
}
p->s++; // "("
......@@ -159,13 +159,13 @@ static void evalPrimary(Parser *p){
}
if(error){
fprintf(stderr, "Parser: unknown function in \"%s\"\n", next);
av_log(NULL, AV_LOG_ERROR, "Parser: unknown function in \"%s\"\n", next);
return;
}
}
if(p->s[-1]!= ')'){
fprintf(stderr, "Parser: missing ) in \"%s\"\n", next);
av_log(NULL, AV_LOG_ERROR, "Parser: missing ) in \"%s\"\n", next);
return;
}
push(p, d);
......@@ -185,7 +185,7 @@ static void evalPow(Parser *p){
evalExpression(p);
if(p->s[0]!=')')
fprintf(stderr, "Parser: missing )\n");
av_log(NULL, AV_LOG_ERROR, "Parser: missing )\n");
p->s++;
}else{
evalPrimary(p);
......
......@@ -598,7 +598,7 @@ static int encode_init(AVCodecContext *avctx)
s->colorspace= 1;
break;
default:
fprintf(stderr, "format not supported\n");
av_log(avctx, AV_LOG_ERROR, "format not supported\n");
return -1;
}
avcodec_get_chroma_sub_sample(avctx->pix_fmt, &s->chroma_h_shift, &s->chroma_v_shift);
......@@ -642,7 +642,7 @@ static int encode_frame(AVCodecContext *avctx, unsigned char *buf, int buf_size,
int used_count= 0;
if(avctx->strict_std_compliance >= 0){
printf("this codec is under development, files encoded with it wont be decodeable with future versions!!!\n"
av_log(avctx, AV_LOG_ERROR, "this codec is under development, files encoded with it wont be decodeable with future versions!!!\n"
"use vstrict=-1 to use it anyway\n");
return -1;
}
......@@ -885,17 +885,17 @@ static int read_header(FFV1Context *f){
case 0x20: f->avctx->pix_fmt= PIX_FMT_YUV411P; break;
case 0x33: f->avctx->pix_fmt= PIX_FMT_YUV410P; break;
default:
fprintf(stderr, "format not supported\n");
av_log(f->avctx, AV_LOG_ERROR, "format not supported\n");
return -1;
}
}else if(f->colorspace==1){
if(f->chroma_h_shift || f->chroma_v_shift){
fprintf(stderr, "chroma subsampling not supported in this colorspace\n");
av_log(f->avctx, AV_LOG_ERROR, "chroma subsampling not supported in this colorspace\n");
return -1;
}
f->avctx->pix_fmt= PIX_FMT_RGBA32;
}else{
fprintf(stderr, "colorspace not supported\n");
av_log(f->avctx, AV_LOG_ERROR, "colorspace not supported\n");
return -1;
}
......@@ -905,7 +905,7 @@ static int read_header(FFV1Context *f){
for(i=0; i<5; i++){
context_count*= read_quant_table(c, f->quant_table[i], context_count);
if(context_count < 0){
printf("read_quant_table error\n");
av_log(f->avctx, AV_LOG_ERROR, "read_quant_table error\n");
return -1;
}
}
......@@ -965,16 +965,16 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, uint8
p->reference= 0;
if(avctx->get_buffer(avctx, p) < 0){
fprintf(stderr, "get_buffer() failed\n");
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
return -1;
}
if(avctx->debug&FF_DEBUG_PICT_INFO)
printf("keyframe:%d coder:%d\n", p->key_frame, f->ac);
av_log(avctx, AV_LOG_ERROR, "keyframe:%d coder:%d\n", p->key_frame, f->ac);
if(!f->ac){
bytes_read = get_cabac_terminate(c);
if(bytes_read ==0) printf("error at end of AC stream\n");
if(bytes_read ==0) av_log(avctx, AV_LOG_ERROR, "error at end of AC stream\n");
//printf("pos=%d\n", bytes_read);
init_get_bits(&f->gb, buf + bytes_read, buf_size - bytes_read);
} else {
......@@ -1004,7 +1004,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, uint8
if(f->ac){
bytes_read= get_cabac_terminate(c);
if(bytes_read ==0) printf("error at end of frame\n");
if(bytes_read ==0) av_log(f->avctx, AV_LOG_ERROR, "error at end of frame\n");
}else{
bytes_read+= (get_bits_count(&f->gb)+7)/8;
}
......
This diff is collapsed.
......@@ -219,11 +219,11 @@ static int decode_slice(MpegEncContext *s){
}
return 0;
}else if(ret==SLICE_NOEND){
fprintf(stderr,"Slice mismatch at MB: %d\n", xy);
av_log(s->avctx, AV_LOG_ERROR, "Slice mismatch at MB: %d\n", xy);
ff_er_add_slice(s, s->resync_mb_x, s->resync_mb_y, s->mb_x+1, s->mb_y, (AC_END|DC_END|MV_END)&part_mask);
return -1;
}
fprintf(stderr,"Error at MB: %d\n", xy);
av_log(s->avctx, AV_LOG_ERROR, "Error at MB: %d\n", xy);
ff_er_add_slice(s, s->resync_mb_x, s->resync_mb_y, s->mb_x, s->mb_y, (AC_ERROR|DC_ERROR|MV_ERROR)&part_mask);
return -1;
......@@ -281,17 +281,17 @@ static int decode_slice(MpegEncContext *s){
max_extra+= 256*256*256*64;
if(left>max_extra){
fprintf(stderr, "discarding %d junk bits at end, next would be %X\n", left, show_bits(&s->gb, 24));
av_log(s->avctx, AV_LOG_ERROR, "discarding %d junk bits at end, next would be %X\n", left, show_bits(&s->gb, 24));
}
else if(left<0){
fprintf(stderr, "overreading %d bits\n", -left);
av_log(s->avctx, AV_LOG_ERROR, "overreading %d bits\n", -left);
}else
ff_er_add_slice(s, s->resync_mb_x, s->resync_mb_y, s->mb_x-1, s->mb_y, AC_END|DC_END|MV_END);
return 0;
}
fprintf(stderr, "slice end not reached but screenspace end (%d left %06X, score= %d)\n",
av_log(s->avctx, AV_LOG_ERROR, "slice end not reached but screenspace end (%d left %06X, score= %d)\n",
s->gb.size_in_bits - get_bits_count(&s->gb),
show_bits(&s->gb, 24), s->padding_bug_score);
......@@ -415,7 +415,7 @@ uint64_t time= rdtsc();
}else if(s->codec_id==CODEC_ID_H263){
next= h263_find_frame_end(s, buf, buf_size);
}else{
fprintf(stderr, "this codec doesnt support truncated bitstreams\n");
av_log(s->avctx, AV_LOG_ERROR, "this codec doesnt support truncated bitstreams\n");
return -1;
}
......@@ -470,7 +470,7 @@ retry:
/* skip if the header was thrashed */
if (ret < 0){
fprintf(stderr, "header damaged\n");
av_log(s->avctx, AV_LOG_ERROR, "header damaged\n");
return -1;
}
......@@ -580,7 +580,7 @@ retry:
}
if(avctx->debug & FF_DEBUG_BUGS)
printf("bugs: %X lavc_build:%d xvid_build:%d divx_version:%d divx_build:%d %s\n",
av_log(s->avctx, AV_LOG_DEBUG, "bugs: %X lavc_build:%d xvid_build:%d divx_version:%d divx_build:%d %s\n",
s->workaround_bugs, s->lavc_build, s->xvid_build, s->divx_version, s->divx_build,
s->divx_packed ? "p" : "");
......