Revision e20c4069 libavcodec/mpegvideo.c

View differences:

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