diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2003-04-25 00:29:48 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2003-04-25 00:29:48 +0000 |
commit | d90cf87b907f4f31b65429affe34666de8f84b59 (patch) | |
tree | edae6543471051001a0c70736e5825ec65d64431 /libavcodec/mpegvideo.c | |
parent | 5755c27f4717836ec3776f5bee86dea38d8016a8 (diff) | |
download | ffmpeg-d90cf87b907f4f31b65429affe34666de8f84b59.tar.gz |
fixing mixed dr1 + internal buffers
Originally committed as revision 1820 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/mpegvideo.c')
-rw-r--r-- | libavcodec/mpegvideo.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c index 7f11869a68..7a79d4ec74 100644 --- a/libavcodec/mpegvideo.c +++ b/libavcodec/mpegvideo.c @@ -305,15 +305,8 @@ static void free_picture(MpegEncContext *s, Picture *pic){ av_freep(&pic->motion_val[i]); av_freep(&pic->ref_index[i]); } - - if(pic->type == FF_BUFFER_TYPE_INTERNAL){ - for(i=0; i<4; i++){ - av_freep(&pic->base[i]); - pic->data[i]= NULL; - } - av_freep(&pic->opaque); - pic->type= 0; - }else if(pic->type == FF_BUFFER_TYPE_SHARED){ + + if(pic->type == FF_BUFFER_TYPE_SHARED){ for(i=0; i<4; i++){ pic->base[i]= pic->data[i]= NULL; @@ -524,6 +517,7 @@ void MPV_common_end(MpegEncContext *s) for(i=0; i<MAX_PICTURE_COUNT; i++){ free_picture(s, &s->picture[i]); } + avcodec_default_free_buffers(s->avctx); s->context_initialized = 0; } @@ -978,6 +972,7 @@ alloc: s->last_picture_ptr= s->next_picture_ptr; s->next_picture_ptr= s->current_picture_ptr; } + if(s->last_picture_ptr) s->last_picture= *s->last_picture_ptr; if(s->next_picture_ptr) s->next_picture= *s->next_picture_ptr; if(s->new_picture_ptr ) s->new_picture = *s->new_picture_ptr; |