# HG changeset patch # User michael # Date 1125083144 0 # Node ID 40765c51a7a907183e968e2d0391855977f34cd6 # Parent d9f4b93e81c5d63dc9d0fba9439a91638e1c6d78 Compilation fixes part 1 patch by (Arvind R. and Burkhard Plaum, plaum, ipf uni-stuttgart de) diff -r d9f4b93e81c5 -r 40765c51a7a9 a52dec.c --- a/a52dec.c Fri Aug 26 15:41:28 2005 +0000 +++ b/a52dec.c Fri Aug 26 19:05:44 2005 +0000 @@ -73,9 +73,16 @@ { void* f = dlsym(handle, symbol); if (!f) - fprintf(stderr, "A52 Decoder - function '%s' can't be resolved\n", symbol); + av_log( NULL, AV_LOG_ERROR, "A52 Decoder - function '%s' can't be resolved\n", symbol); return f; } + +int ff_a52_syncinfo( AVCodecContext * avctx, uint8_t * buf, int * flags, int * sample_rate, int * bit_rate ) +{ + AC3DecodeState *s = avctx->priv_data; + + return s->a52_syncinfo(buf, flags, sample_rate, bit_rate); +} #endif static int a52_decode_init(AVCodecContext *avctx) @@ -86,7 +93,7 @@ s->handle = dlopen(liba52name, RTLD_LAZY); if (!s->handle) { - fprintf(stderr, "A52 library %s could not be opened! \n%s\n", liba52name, dlerror()); + av_log( avctx, AV_LOG_ERROR, "A52 library %s could not be opened! \n%s\n", liba52name, dlerror()); return -1; } s->a52_init = (a52_state_t* (*)(uint32_t)) dlsymm(s->handle, "a52_init"); diff -r d9f4b93e81c5 -r 40765c51a7a9 ac3dec.c --- a/ac3dec.c Fri Aug 26 15:41:28 2005 +0000 +++ b/ac3dec.c Fri Aug 26 19:05:44 2005 +0000 @@ -121,7 +121,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_INFO, "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 d9f4b93e81c5 -r 40765c51a7a9 h263.c --- a/h263.c Fri Aug 26 15:41:28 2005 +0000 +++ b/h263.c Fri Aug 26 19:05:44 2005 +0000 @@ -4540,7 +4540,7 @@ code = (sign) ? (pred - code) : (pred + code); #ifdef DEBUG - fprintf(stderr,"H.263+ UMV Motion = %d\n", code); + av_log( s->avctx, AV_LOG_DEBUG,"H.263+ UMV Motion = %d\n", code); #endif return code; @@ -4887,11 +4887,11 @@ } if(s->error_resilience > FF_ER_COMPLIANT){ if(abs_level <= rl->max_level[last][run]*2){ - fprintf(stderr, "illegal 3. esc, esc 1 encoding possible\n"); + av_log(s->avctx, AV_LOG_ERROR, "illegal 3. esc, esc 1 encoding possible\n"); return -1; } if(run1 >= 0 && abs_level <= rl->max_level[last][run1]){ - fprintf(stderr, "illegal 3. esc, esc 2 encoding possible\n"); + av_log(s->avctx, AV_LOG_ERROR, "illegal 3. esc, esc 2 encoding possible\n"); return -1; } } diff -r d9f4b93e81c5 -r 40765c51a7a9 h264.c --- a/h264.c Fri Aug 26 15:41:28 2005 +0000 +++ b/h264.c Fri Aug 26 19:05:44 2005 +0000 @@ -3999,7 +3999,7 @@ if(opcode==MMCO_SHORT2UNUSED || opcode==MMCO_SHORT2LONG){ h->mmco[i].short_frame_num= (h->frame_num - get_ue_golomb(&s->gb) - 1) & ((1<sps.log2_max_frame_num)-1); //FIXME fields /* if(h->mmco[i].short_frame_num >= h->short_ref_count || h->short_ref[ h->mmco[i].short_frame_num ] == NULL){ - fprintf(stderr, "illegal short ref in memory management control operation %d\n", mmco); + av_log(s->avctx, AV_LOG_ERROR, "illegal short ref in memory management control operation %d\n", mmco); return -1; }*/ } diff -r d9f4b93e81c5 -r 40765c51a7a9 imgresample.c --- a/imgresample.c Fri Aug 26 15:41:28 2005 +0000 +++ b/imgresample.c Fri Aug 26 19:05:44 2005 +0000 @@ -643,11 +643,13 @@ void save_pgm(const char *filename, uint8_t *img, int xsize, int ysize) { +#undef fprintf FILE *f; f=fopen(filename,"w"); fprintf(f,"P5\n%d %d\n%d\n", xsize, ysize, 255); fwrite(img,1, xsize * ysize,f); fclose(f); +#define fprintf please_use_av_log } static void dump_filter(int16_t *filter) diff -r d9f4b93e81c5 -r 40765c51a7a9 mjpeg.c --- a/mjpeg.c Fri Aug 26 15:41:28 2005 +0000 +++ b/mjpeg.c Fri Aug 26 19:05:44 2005 +0000 @@ -2183,7 +2183,7 @@ s->picture.reference = 0; 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; } diff -r d9f4b93e81c5 -r 40765c51a7a9 motion_est.c --- a/motion_est.c Fri Aug 26 15:41:28 2005 +0000 +++ b/motion_est.c Fri Aug 26 19:05:44 2005 +0000 @@ -441,7 +441,7 @@ } while (range >= 1); #ifdef DEBUG - fprintf(stderr, "log - MX: %d\tMY: %d\n", mx, my); + av_log(s->avctx, AV_LOG_DEBUG, "log - MX: %d\tMY: %d\n", mx, my); #endif *mx_ptr = mx; *my_ptr = my; @@ -530,7 +530,7 @@ } while (range >= 1); #ifdef DEBUG - fprintf(stderr, "phods - MX: %d\tMY: %d\n", mx, my); + av_log(s->avctx, AV_LOG_DEBUG, "phods - MX: %d\tMY: %d\n", mx, my); #endif /* half pixel search */ diff -r d9f4b93e81c5 -r 40765c51a7a9 msmpeg4.c --- a/msmpeg4.c Fri Aug 26 15:41:28 2005 +0000 +++ b/msmpeg4.c Fri Aug 26 19:05:44 2005 +0000 @@ -1821,9 +1821,9 @@ if(last) i+=192; #ifdef ERROR_DETAILS if(run==66) - fprintf(stderr, "illegal vlc code in ESC3 level=%d\n", level); + av_log(s->avctx, AV_LOG_ERROR, "illegal vlc code in ESC3 level=%d\n", level); else if((i>62 && i<192) || i>192+63) - fprintf(stderr, "run overflow in ESC3 i=%d run=%d level=%d\n", i, run, level); + av_log(s->avctx, AV_LOG_ERROR, "run overflow in ESC3 i=%d run=%d level=%d\n", i, run, level); #endif } else { /* second escape */ @@ -1839,9 +1839,9 @@ LAST_SKIP_BITS(re, &s->gb, 1); #ifdef ERROR_DETAILS if(run==66) - fprintf(stderr, "illegal vlc code in ESC2 level=%d\n", level); + av_log(s->avctx, AV_LOG_ERROR, "illegal vlc code in ESC2 level=%d\n", level); else if((i>62 && i<192) || i>192+63) - fprintf(stderr, "run overflow in ESC2 i=%d run=%d level=%d\n", i, run, level); + av_log(s->avctx, AV_LOG_ERROR, "run overflow in ESC2 i=%d run=%d level=%d\n", i, run, level); #endif } } else { @@ -1859,9 +1859,9 @@ LAST_SKIP_BITS(re, &s->gb, 1); #ifdef ERROR_DETAILS if(run==66) - fprintf(stderr, "illegal vlc code in ESC1 level=%d\n", level); + av_log(s->avctx, AV_LOG_ERROR, "illegal vlc code in ESC1 level=%d\n", level); else if((i>62 && i<192) || i>192+63) - fprintf(stderr, "run overflow in ESC1 i=%d run=%d level=%d\n", i, run, level); + av_log(s->avctx, AV_LOG_ERROR, "run overflow in ESC1 i=%d run=%d level=%d\n", i, run, level); #endif } } else { @@ -1870,9 +1870,9 @@ LAST_SKIP_BITS(re, &s->gb, 1); #ifdef ERROR_DETAILS if(run==66) - fprintf(stderr, "illegal vlc code level=%d\n", level); + av_log(s->avctx, AV_LOG_ERROR, "illegal vlc code level=%d\n", level); else if((i>62 && i<192) || i>192+63) - fprintf(stderr, "run overflow i=%d run=%d level=%d\n", i, run, level); + av_log(s->avctx, AV_LOG_ERROR, "run overflow i=%d run=%d level=%d\n", i, run, level); #endif } if (i > 62){ diff -r d9f4b93e81c5 -r 40765c51a7a9 parser.c --- a/parser.c Fri Aug 26 15:41:28 2005 +0000 +++ b/parser.c Fri Aug 26 19:05:44 2005 +0000 @@ -748,8 +748,13 @@ } #ifdef CONFIG_AC3 +#ifdef CONFIG_A52BIN +extern int ff_a52_syncinfo (AVCodecContext * avctx, const uint8_t * buf, + int * flags, int * sample_rate, int * bit_rate); +#else extern int a52_syncinfo (const uint8_t * buf, int * flags, int * sample_rate, int * bit_rate); +#endif typedef struct AC3ParseContext { uint8_t inbuf[4096]; /* input buffer */ @@ -796,7 +801,11 @@ s->inbuf_ptr += len; buf_size -= len; if ((s->inbuf_ptr - s->inbuf) == AC3_HEADER_SIZE) { +#ifdef CONFIG_A52BIN + len = ff_a52_syncinfo(avctx, s->inbuf, &s->flags, &sample_rate, &bit_rate); +#else len = a52_syncinfo(s->inbuf, &s->flags, &sample_rate, &bit_rate); +#endif if (len == 0) { /* no sync found : move by one byte (inefficient, but simple!) */ memmove(s->inbuf, s->inbuf + 1, AC3_HEADER_SIZE - 1);