Revision d6db1c9c

View differences:

libavcodec/avcodec.h
5 5

  
6 6
#define LIBAVCODEC_VERSION_INT 0x000406
7 7
#define LIBAVCODEC_VERSION     "0.4.6"
8
#define LIBAVCODEC_BUILD       4631
9
#define LIBAVCODEC_BUILD_STR   "4631"
8
#define LIBAVCODEC_BUILD       4632
9
#define LIBAVCODEC_BUILD_STR   "4632"
10 10

  
11 11
enum CodecID {
12 12
    CODEC_ID_NONE, 
......
503 503
     * encoding: unused
504 504
     * decoding: set by user
505 505
     */
506
    void (*get_buffer_callback)(struct AVCodecContext *c, int width, int height, int pict_type);
506
    int (*get_buffer_callback)(struct AVCodecContext *c, int width, int height, int pict_type);
507 507

  
508 508
    /**
509 509
     * is 1 if the decoded stream contains b frames, 0 otherwise
libavcodec/h263dec.c
457 457
            s->next_p_frame_damaged=0;
458 458
    }
459 459

  
460
    MPV_frame_start(s, avctx);
460
    if(MPV_frame_start(s, avctx) < 0)
461
        return -1;
461 462

  
462 463
#ifdef DEBUG
463 464
    printf("qscale=%d\n", s->qscale);
libavcodec/mpeg12.c
1581 1581
    /* start frame decoding */
1582 1582
    if (s->first_slice) {
1583 1583
        s->first_slice = 0;
1584
        MPV_frame_start(s, avctx);
1584
        if(MPV_frame_start(s, avctx) < 0)
1585
            return -1;
1585 1586
    }
1586 1587

  
1587 1588
    init_get_bits(&s->gb, buf, buf_size);
libavcodec/mpegvideo.c
791 791
}
792 792

  
793 793
/* generic function for encode/decode called before a frame is coded/decoded */
794
void MPV_frame_start(MpegEncContext *s, AVCodecContext *avctx)
794
int MPV_frame_start(MpegEncContext *s, AVCodecContext *avctx)
795 795
{
796 796
    int i;
797 797
    UINT8 *tmp;
......
800 800
    avctx->mbskip_table= s->mbskip_table;
801 801

  
802 802
    if(avctx->flags&CODEC_FLAG_DR1){
803
        avctx->get_buffer_callback(avctx, s->width, s->height, s->pict_type);
803
        if(avctx->get_buffer_callback(avctx, s->width, s->height, s->pict_type) < 0){
804
            fprintf(stderr, "get_buffer() failed\n");
805
            return -1;
806
        }
804 807

  
805 808
        s->linesize  = avctx->dr_stride;
806 809
        s->uvlinesize= avctx->dr_uvstride;
......
854 857
            s->dct_unquantize = s->dct_unquantize_h263;
855 858
    }else 
856 859
        s->dct_unquantize = s->dct_unquantize_mpeg1;
860

  
861
    return 0;
857 862
}
858 863

  
859 864
/* generic function for encode/decode called after a frame has been coded/decoded */
libavcodec/mpegvideo.h
518 518
int MPV_common_init(MpegEncContext *s);
519 519
void MPV_common_end(MpegEncContext *s);
520 520
void MPV_decode_mb(MpegEncContext *s, DCTELEM block[6][64]);
521
void MPV_frame_start(MpegEncContext *s, AVCodecContext *avctx);
521
int MPV_frame_start(MpegEncContext *s, AVCodecContext *avctx);
522 522
void MPV_frame_end(MpegEncContext *s);
523 523
#ifdef HAVE_MMX
524 524
void MPV_common_init_mmx(MpegEncContext *s);
libavcodec/rv10.c
416 416
    }
417 417

  
418 418
    if (s->mb_x == 0 && s->mb_y == 0) {
419
        MPV_frame_start(s, avctx);
419
        if(MPV_frame_start(s, avctx) < 0)
420
            return -1;
420 421
    }
421 422

  
422 423
#ifdef DEBUG
libavcodec/svq1.c
1085 1085

  
1086 1086
  result = svq1_decode_frame_header (&s->gb, s);
1087 1087
  
1088
  MPV_frame_start(s, avctx);
1088
  if(MPV_frame_start(s, avctx) < 0)
1089
      return -1;
1089 1090

  
1090 1091
  if (result != 0)
1091 1092
  {

Also available in: Unified diff