[Ffmpeg-cvslog] CVS: ffmpeg/libavcodec a52dec.c, 1.10, 1.11 ac3dec.c, 1.10, 1.11 h263.c, 1.288, 1.289 h264.c, 1.151, 1.152 imgresample.c, 1.24, 1.25 mjpeg.c, 1.112, 1.113 motion_est.c, 1.109, 1.110 msmpeg4.c, 1.89, 1.90 parser.c, 1.27, 1.28

Michael Niedermayer CVS michael
Fri Aug 26 21:05:46 CEST 2005


Update of /cvsroot/ffmpeg/ffmpeg/libavcodec
In directory mail:/var2/tmp/cvs-serv29902/libavcodec

Modified Files:
	a52dec.c ac3dec.c h263.c h264.c imgresample.c mjpeg.c 
	motion_est.c msmpeg4.c parser.c 
Log Message:
Compilation fixes part 1 patch by (Arvind R. and Burkhard Plaum, plaum, ipf uni-stuttgart de)


Index: a52dec.c
===================================================================
RCS file: /cvsroot/ffmpeg/ffmpeg/libavcodec/a52dec.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- a52dec.c	21 May 2004 14:37:16 -0000	1.10
+++ a52dec.c	26 Aug 2005 19:05:43 -0000	1.11
@@ -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");

Index: ac3dec.c
===================================================================
RCS file: /cvsroot/ffmpeg/ffmpeg/libavcodec/ac3dec.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- ac3dec.c	21 May 2004 14:37:16 -0000	1.10
+++ ac3dec.c	26 Aug 2005 19:05:43 -0000	1.11
@@ -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;

Index: h263.c
===================================================================
RCS file: /cvsroot/ffmpeg/ffmpeg/libavcodec/h263.c,v
retrieving revision 1.288
retrieving revision 1.289
diff -u -d -r1.288 -r1.289
--- h263.c	31 Jul 2005 10:51:04 -0000	1.288
+++ h263.c	26 Aug 2005 19:05:43 -0000	1.289
@@ -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;
                                 }
                             }

Index: h264.c
===================================================================
RCS file: /cvsroot/ffmpeg/ffmpeg/libavcodec/h264.c,v
retrieving revision 1.151
retrieving revision 1.152
diff -u -d -r1.151 -r1.152
--- h264.c	25 Aug 2005 00:01:57 -0000	1.151
+++ h264.c	26 Aug 2005 19:05:43 -0000	1.152
@@ -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<<h->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;
                     }*/
                 }

Index: imgresample.c
===================================================================
RCS file: /cvsroot/ffmpeg/ffmpeg/libavcodec/imgresample.c,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -d -r1.24 -r1.25
--- imgresample.c	12 Jan 2005 00:59:41 -0000	1.24
+++ imgresample.c	26 Aug 2005 19:05:44 -0000	1.25
@@ -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)

Index: mjpeg.c
===================================================================
RCS file: /cvsroot/ffmpeg/ffmpeg/libavcodec/mjpeg.c,v
retrieving revision 1.112
retrieving revision 1.113
diff -u -d -r1.112 -r1.113
--- mjpeg.c	22 Jul 2005 08:48:00 -0000	1.112
+++ mjpeg.c	26 Aug 2005 19:05:44 -0000	1.113
@@ -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;
     }
 

Index: motion_est.c
===================================================================
RCS file: /cvsroot/ffmpeg/ffmpeg/libavcodec/motion_est.c,v
retrieving revision 1.109
retrieving revision 1.110
diff -u -d -r1.109 -r1.110
--- motion_est.c	14 Aug 2005 15:42:39 -0000	1.109
+++ motion_est.c	26 Aug 2005 19:05:44 -0000	1.110
@@ -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 */

Index: msmpeg4.c
===================================================================
RCS file: /cvsroot/ffmpeg/ffmpeg/libavcodec/msmpeg4.c,v
retrieving revision 1.89
retrieving revision 1.90
diff -u -d -r1.89 -r1.90
--- msmpeg4.c	2 May 2005 22:14:42 -0000	1.89
+++ msmpeg4.c	26 Aug 2005 19:05:44 -0000	1.90
@@ -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){

Index: parser.c
===================================================================
RCS file: /cvsroot/ffmpeg/ffmpeg/libavcodec/parser.c,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -d -r1.27 -r1.28
--- parser.c	15 Aug 2005 15:58:20 -0000	1.27
+++ parser.c	26 Aug 2005 19:05:44 -0000	1.28
@@ -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);





More information about the ffmpeg-cvslog mailing list