Revision fd146758 libavcodec/smc.c

View differences:

libavcodec/smc.c
36 36
#include "avcodec.h"
37 37
#include "dsputil.h"
38 38

  
39
#define printf(...) {} //(f)printf() usage is forbidden in libavcodec, use av_log
40
#define fprintf(...) {} 
41

  
42 39
#define CPAIR 2
43 40
#define CQUAD 4
44 41
#define COCTET 8
......
75 72
    total_blocks--; \
76 73
    if (total_blocks < 0) \
77 74
    { \
78
        printf("warning: block counter just went negative (this should not happen)\n"); \
75
        av_log(s->avctx, AV_LOG_INFO, "warning: block counter just went negative (this should not happen)\n"); \
79 76
        return; \
80 77
    } \
81 78
}
......
124 121
    chunk_size = BE_32(&s->buf[stream_ptr]) & 0x00FFFFFF;
125 122
    stream_ptr += 4;
126 123
    if (chunk_size != s->size)
127
        printf("warning: MOV chunk size != encoded chunk size (%d != %d); using MOV chunk size\n",
124
        av_log(s->avctx, AV_LOG_INFO, "warning: MOV chunk size != encoded chunk size (%d != %d); using MOV chunk size\n",
128 125
            chunk_size, s->size);
129 126

  
130 127
    chunk_size = s->size;
......
135 132
        /* sanity checks */
136 133
        /* make sure stream ptr hasn't gone out of bounds */
137 134
        if (stream_ptr > chunk_size) {
138
            printf("SMC decoder just went out of bounds (stream ptr = %d, chunk size = %d)\n",
135
            av_log(s->avctx, AV_LOG_INFO, "SMC decoder just went out of bounds (stream ptr = %d, chunk size = %d)\n",
139 136
                stream_ptr, chunk_size);
140 137
            return;
141 138
        }
142 139
        /* make sure the row pointer hasn't gone wild */
143 140
        if (row_ptr >= image_size) {
144
            printf("SMC decoder just went out of bounds (row ptr = %d, height = %d)\n",
141
            av_log(s->avctx, AV_LOG_INFO, "SMC decoder just went out of bounds (row ptr = %d, height = %d)\n",
145 142
                row_ptr, image_size);
146 143
            return;
147 144
        }
......
164 161

  
165 162
            /* sanity check */
166 163
            if ((row_ptr == 0) && (pixel_ptr == 0)) {
167
                printf("encountered repeat block opcode (%02X) but no blocks rendered yet\n",
164
                av_log(s->avctx, AV_LOG_INFO, "encountered repeat block opcode (%02X) but no blocks rendered yet\n",
168 165
                    opcode & 0xF0);
169 166
                break;
170 167
            }
......
198 195

  
199 196
            /* sanity check */
200 197
            if ((row_ptr == 0) && (pixel_ptr < 2 * 4)) {
201
                printf("encountered repeat block opcode (%02X) but not enough blocks rendered yet\n",
198
        	av_log(s->avctx, AV_LOG_INFO, "encountered repeat block opcode (%02X) but not enough blocks rendered yet\n",
202 199
                    opcode & 0xF0);
203 200
                break;
204 201
            }
......
425 422
            break;
426 423

  
427 424
        case 0xF0:
428
            printf("0xF0 opcode seen in SMC chunk (xine developers would like to know)\n");
425
            av_log(s->avctx, AV_LOG_INFO, "0xF0 opcode seen in SMC chunk (contact the developers)\n");
429 426
            break;
430 427
        }
431 428
    }
......
462 459
    s->frame.buffer_hints = FF_BUFFER_HINTS_VALID | FF_BUFFER_HINTS_PRESERVE | 
463 460
                            FF_BUFFER_HINTS_REUSABLE | FF_BUFFER_HINTS_READABLE;
464 461
    if (avctx->reget_buffer(avctx, &s->frame)) {
465
        printf ("reget_buffer() failed\n");
462
        av_log(s->avctx, AV_LOG_ERROR, "reget_buffer() failed\n");
466 463
        return -1;
467 464
    }
468 465

  

Also available in: Unified diff