Revision fd146758

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

  
libavcodec/truemotion1.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
#include "truemotion1data.h"
43 40

  
44 41
typedef struct TrueMotion1Context {
......
232 229
    header.header_size = ((s->buf[0] >> 5) | (s->buf[0] << 3)) & 0x7f;
233 230
    if (s->buf[0] < 0x10)
234 231
    {
235
        printf("invalid header size\n");
232
        av_log(s->avctx, AV_LOG_ERROR, "invalid header size\n");
236 233
        return -1;
237 234
    }
238 235

  
......
282 279
    }
283 280

  
284 281
    if (header.compression > 17) {
285
        printf("invalid compression type (%d)\n", header.compression);
282
        av_log(s->avctx, AV_LOG_ERROR, "invalid compression type (%d)\n", header.compression);
286 283
        return -1;
287 284
    }
288 285
    
......
296 293
        if (header.vectable < 4)
297 294
            sel_vector_table = tables[header.vectable - 1];
298 295
        else {
299
            printf("invalid vector table id (%d)\n", header.vectable);
296
            av_log(s->avctx, AV_LOG_ERROR, "invalid vector table id (%d)\n", header.vectable);
300 297
            return -1;
301 298
        }
302 299
    }
......
305 302
    {
306 303
        if (compression_types[header.compression].algorithm == ALGO_RGB24H)
307 304
        {
308
            printf("24bit compression not yet supported\n");
305
            av_log(s->avctx, AV_LOG_ERROR, "24bit compression not yet supported\n");
309 306
        }
310 307
        else
311 308
            gen_vector_table(s, sel_vector_table);
......
354 351
#define GET_NEXT_INDEX() \
355 352
{\
356 353
    if (index_stream_index >= s->index_stream_size) { \
357
        printf (" help! truemotion1 decoder went out of bounds\n"); \
354
        av_log(s->avctx, AV_LOG_INFO, " help! truemotion1 decoder went out of bounds\n"); \
358 355
        return; \
359 356
    } \
360 357
    index = s->index_stream[index_stream_index++] * 4; \
......
542 539

  
543 540
    s->frame.reference = 1;
544 541
    if (avctx->get_buffer(avctx, &s->frame) < 0) {
545
        fprintf(stderr, "truemotion1: get_buffer() failed\n");
542
        av_log(s->avctx, AV_LOG_ERROR, "truemotion1: get_buffer() failed\n");
546 543
        return -1;
547 544
    }
548 545

  
......
561 558
        memcpy(s->frame.data[0], s->prev_frame.data[0],
562 559
            s->frame.linesize[0] * s->avctx->height);
563 560
    } else if (compression_types[s->compression].algorithm == ALGO_RGB24H) {
564
        printf ("  24-bit Duck TrueMotion decoding not yet implemented\n");
561
        av_log(s->avctx, AV_LOG_ERROR, "24bit compression not yet supported\n");
565 562
    } else {
566 563
        truemotion1_decode_16bit(s);
567 564
    }
libavcodec/vmdav.c
47 47
#include "avcodec.h"
48 48
#include "dsputil.h"
49 49

  
50
#define printf(...) {} //(f)printf() usage is forbidden in libavcodec, use av_log
51
#define fprintf(...) {} 
52

  
53 50
#define VMD_HEADER_SIZE 0x330
54 51
#define PALETTE_COUNT 256
55 52

  
......
245 242
                    }
246 243
                } while (ofs < frame_width);
247 244
                if (ofs > frame_width) {
248
                    printf (" VMD video: offset > width (%d > %d)\n",
245
                    av_log(s->avctx, AV_LOG_ERROR, "VMD video: offset > width (%d > %d)\n",
249 246
                        ofs, frame_width);
250 247
                    break;
251 248
                }
......
283 280
                    }
284 281
                } while (ofs < frame_width);
285 282
                if (ofs > frame_width) {
286
                    printf (" VMD video: offset > width (%d > %d)\n",
283
                    av_log(s->avctx, AV_LOG_ERROR, "VMD video: offset > width (%d > %d)\n",
287 284
                        ofs, frame_width);
288 285
                }
289 286
                dp += s->frame.linesize[0];
......
311 308

  
312 309
    /* make sure the VMD header made it */
313 310
    if (s->avctx->extradata_size != VMD_HEADER_SIZE) {
314
        printf("  VMD video: expected extradata size of %d\n", 
311
        av_log(s->avctx, AV_LOG_ERROR, "VMD video: expected extradata size of %d\n", 
315 312
            VMD_HEADER_SIZE);
316 313
        return -1;
317 314
    }
......
350 347

  
351 348
    s->frame.reference = 1;
352 349
    if (avctx->get_buffer(avctx, &s->frame)) {
353
        printf ("  VMD Video: get_buffer() failed\n");
350
        av_log(s->avctx, AV_LOG_ERROR, "VMD Video: get_buffer() failed\n");
354 351
        return -1;
355 352
    }
356 353

  
......
389 386
 */
390 387

  
391 388
typedef struct VmdAudioContext {
389
    AVCodecContext *avctx;
392 390
    int channels;
393 391
    int bits;
394 392
    int block_align;
......
403 401
    VmdAudioContext *s = (VmdAudioContext *)avctx->priv_data;
404 402
    int i;
405 403

  
404
    s->avctx = avctx;
406 405
    s->channels = avctx->channels;
407 406
    s->bits = avctx->bits_per_sample;
408 407
    s->block_align = avctx->block_align;
409 408

  
410
printf ("  %d channels, %d bits/sample, block align = %d, sample rate = %d\n",
411
  s->channels, s->bits, s->block_align, avctx->sample_rate);
409
    av_log(s->avctx, AV_LOG_DEBUG, "%d channels, %d bits/sample, block align = %d, sample rate = %d\n",
410
	    s->channels, s->bits, s->block_align, avctx->sample_rate);
412 411

  
413 412
    /* set up the steps8 and steps16 tables */
414 413
    for (i = 0; i < 8; i++) {
......
465 464
    int bytes_decoded = 0;
466 465
    int i;
467 466

  
468
if (silence)
469
  printf (" silent block!\n");
467
    if (silence)
468
	av_log(s->avctx, AV_LOG_INFO, "silent block!\n");
470 469
    if (s->channels == 2) {
471 470

  
472 471
        /* stereo handling */
......
520 519
    unsigned char *p = buf + 16;
521 520
    unsigned char *p_end = buf + buf_size;
522 521

  
523
printf ("    processing audio frame with %d bytes\n", buf_size);
524 522
    if (buf_size < 16)
525 523
        return buf_size;
526 524

  
......
529 527
        /* the chunk contains audio */
530 528
        *data_size = vmdaudio_loadsound(s, output_samples, p, 0);
531 529
    } else if (buf[6] == 2) {
532
printf ("  hey! audio case #2\n");
533 530
        /* the chunk contains audio and silence mixed together */
534 531
        sound_flags = LE_32(p);
535 532
        p += 4;
......
549 546
            sound_flags >>= 1;
550 547
        }
551 548
    } else if (buf[6] == 3) {
552
printf ("  hey! audio case #3\n");
553 549
        /* silent chunk */
554 550
        *data_size = vmdaudio_loadsound(s, output_samples, p, 1);
555 551
    }
556 552

  
557
printf ("      final sample count = %d, byte count = %d\n", (*data_size) / 2,
558
  *data_size);
559 553
    return buf_size;
560 554
}
561 555

  

Also available in: Unified diff