Revision fd146758 libavcodec/truemotion1.c

View differences:

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
    }

Also available in: Unified diff