diff msrle.c @ 1598:932d306bf1dc libavcodec

av_log() patch by (Michel Bardiaux <mbardiaux at peaktime dot be>)
author michael
date Mon, 03 Nov 2003 13:26:22 +0000
parents b2fecae88e84
children 21190cfac0e1
line wrap: on
line diff
--- a/msrle.c	Sun Nov 02 23:19:47 2003 +0000
+++ b/msrle.c	Mon Nov 03 13:26:22 2003 +0000
@@ -51,7 +51,7 @@
 #define FETCH_NEXT_STREAM_BYTE() \
     if (stream_ptr >= s->size) \
     { \
-      printf(" MS RLE: stream ptr just went out of bounds (1)\n"); \
+      av_log(s->avctx, AV_LOG_ERROR, " MS RLE: stream ptr just went out of bounds (1)\n"); \
       return; \
     } \
     stream_byte = s->buf[stream_ptr++];
@@ -90,14 +90,14 @@
                 /* copy pixels from encoded stream */
                 if ((row_ptr + pixel_ptr + stream_byte > frame_size) ||
                     (row_ptr < 0)) {
-                    printf(" MS RLE: frame ptr just went out of bounds (1)\n");
+                    av_log(s->avctx, AV_LOG_ERROR, " MS RLE: frame ptr just went out of bounds (1)\n");
                     return;
                 }
 
                 rle_code = stream_byte;
                 extra_byte = stream_byte & 0x01;
                 if (stream_ptr + rle_code + extra_byte > s->size) {
-                    printf(" MS RLE: stream ptr just went out of bounds (2)\n");
+                    av_log(s->avctx, AV_LOG_ERROR, " MS RLE: stream ptr just went out of bounds (2)\n");
                     return;
                 }
 
@@ -115,7 +115,7 @@
             /* decode a run of data */
             if ((row_ptr + pixel_ptr + stream_byte > frame_size) ||
                 (row_ptr < 0)) {
-                printf(" MS RLE: frame ptr just went out of bounds (2)\n");
+                av_log(s->avctx, AV_LOG_ERROR, " MS RLE: frame ptr just went out of bounds (2)\n");
                 return;
             }
 
@@ -137,7 +137,7 @@
 
     /* one last sanity check on the way out */
     if (stream_ptr < s->size)
-        printf(" MS RLE: ended frame decode with bytes left over (%d < %d)\n",
+        av_log(s->avctx, AV_LOG_ERROR, " MS RLE: ended frame decode with bytes left over (%d < %d)\n",
             stream_ptr, s->size);
 }
 
@@ -165,12 +165,12 @@
 
     s->frame.reference = 1;
     if (avctx->get_buffer(avctx, &s->frame)) {
-        printf ("  MS RLE: get_buffer() failed\n");
+        av_log(avctx, AV_LOG_ERROR, "  MS RLE: get_buffer() failed\n");
         return -1;
     }
 
     if (s->prev_frame.data[0] && (s->frame.linesize[0] != s->prev_frame.linesize[0]))
-        printf ("  MS RLE: Buffer linesize changed: current %u, previous %u.\n"
+        av_log(avctx, AV_LOG_ERROR, "  MS RLE: Buffer linesize changed: current %u, previous %u.\n"
                 "          Expect wrong image and/or crash!\n",
                 s->frame.linesize[0], s->prev_frame.linesize[0]);