Revision e20c4069

View differences:

libavcodec/cyuv.c
98 98
    /* pixel data starts 48 bytes in, after 3x16-byte tables */
99 99
    stream_ptr = 48;
100 100

  
101
    if(s->frame.data[0])
102
        avctx->release_buffer(avctx, &s->frame);
103

  
101 104
    s->frame.reference = 0;
102 105
    if(avctx->get_buffer(avctx, &s->frame) < 0) {
103 106
        fprintf(stderr, "get_buffer() failed\n");
......
159 162
    *data_size=sizeof(AVFrame);
160 163
    *(AVFrame*)data= s->frame;
161 164

  
162
    avctx->release_buffer(avctx, &s->frame);
163

  
164 165
    return buf_size;
165 166
}
166 167

  
libavcodec/dv.c
580 580
    else
581 581
        avctx->aspect_ratio = 4.0 / 3.0;
582 582

  
583
    if(s->picture.data[0])
584
        avctx->release_buffer(avctx, &s->picture);
585
    
583 586
    s->picture.reference= 0;
584 587
    if(avctx->get_buffer(avctx, &s->picture) < 0) {
585 588
        fprintf(stderr, "get_buffer() failed\n");
......
617 620
    *data_size = sizeof(AVFrame);
618 621
    *(AVFrame*)data= s->picture;
619 622
    
620
    avctx->release_buffer(avctx, &s->picture);
621
    
622 623
    return packet_size;
623 624
}
624 625

  
libavcodec/huffyuv.c
737 737
    
738 738
    init_get_bits(&s->gb, s->bitstream_buffer, buf_size*8);
739 739

  
740
    if(p->data[0])
741
        avctx->release_buffer(avctx, p);
742

  
740 743
    p->reference= 0;
741 744
    if(avctx->get_buffer(avctx, p) < 0){
742 745
        fprintf(stderr, "get_buffer() failed\n");
......
943 946
    emms_c();
944 947
    
945 948
    *picture= *p;
946
    
947
    avctx->release_buffer(avctx, p);
948

  
949 949
    *data_size = sizeof(AVFrame);
950 950
    
951 951
    return (get_bits_count(&s->gb)+31)/32*4;
libavcodec/indeo3.c
1056 1056

  
1057 1057
    iv_decode_frame(s, buf, buf_size);
1058 1058

  
1059
    if(s->frame.data[0])
1060
        avctx->release_buffer(avctx, &s->frame);
1061

  
1059 1062
    s->frame.reference = 0;
1060 1063
    if(avctx->get_buffer(avctx, &s->frame) < 0) {
1061 1064
        fprintf(stderr, "get_buffer() failed\n");
......
1089 1092
    *data_size=sizeof(AVFrame);
1090 1093
    *(AVFrame*)data= s->frame;
1091 1094

  
1092
    avctx->release_buffer(avctx, &s->frame);
1093

  
1094 1095
    return buf_size;
1095 1096
}
1096 1097

  
libavcodec/mpegvideo.c
929 929
    s->mb_skiped = 0;
930 930

  
931 931
    assert(s->last_picture_ptr==NULL || s->out_format != FMT_H264);
932
        
932

  
933 933
    /* mark&release old frames */
934 934
    if (s->pict_type != B_TYPE && s->last_picture_ptr) {
935 935
        avctx->release_buffer(avctx, (AVFrame*)s->last_picture_ptr);
......
945 945
            }
946 946
        }
947 947
    }
948
    
949 948
alloc:
950 949
    if(!s->encoding){
950
        /* release non refernce frames */
951
        for(i=0; i<MAX_PICTURE_COUNT; i++){
952
            if(s->picture[i].data[0] && !s->picture[i].reference /*&& s->picture[i].type!=FF_BUFFER_TYPE_SHARED*/){
953
                s->avctx->release_buffer(s->avctx, (AVFrame*)&s->picture[i]);
954
            }
955
        }
956

  
951 957
        i= find_unused_picture(s, 0);
952 958
    
953 959
        pic= (AVFrame*)&s->picture[i];
......
1041 1047
    assert(i<MAX_PICTURE_COUNT);
1042 1048
#endif    
1043 1049

  
1044
    /* release non refernce frames */
1045
    for(i=0; i<MAX_PICTURE_COUNT; i++){
1046
        if(s->picture[i].data[0] && !s->picture[i].reference /*&& s->picture[i].type!=FF_BUFFER_TYPE_SHARED*/)
1047
            s->avctx->release_buffer(s->avctx, (AVFrame*)&s->picture[i]);
1050
    if(s->encoding){
1051
        /* release non refernce frames */
1052
        for(i=0; i<MAX_PICTURE_COUNT; i++){
1053
            if(s->picture[i].data[0] && !s->picture[i].reference /*&& s->picture[i].type!=FF_BUFFER_TYPE_SHARED*/){
1054
                s->avctx->release_buffer(s->avctx, (AVFrame*)&s->picture[i]);
1055
            }
1056
        }
1048 1057
    }
1049
    
1050 1058
    // clear copies, to avoid confusion
1051 1059
#if 0
1052 1060
    memset(&s->last_picture, 0, sizeof(Picture));

Also available in: Unified diff