summaryrefslogtreecommitdiff
path: root/libavcodec/mpegvideo.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2011-07-21 16:27:55 +0200
committerMichael Niedermayer <michaelni@gmx.at>2011-07-21 16:28:53 +0200
commitf93f6963babf08a7bcf85b9a57f37266dc0a4ae0 (patch)
treed9729ad7db8cb9f9a6a5483ac960ef7a56310072 /libavcodec/mpegvideo.c
parent8c2863b87f651bfce061d5b0e03cd756b049a553 (diff)
parente5985185d2eda942333ebbb72bd7d043ffe40be7 (diff)
Merge remote-tracking branch 'qatar/master'
* qatar/master: rv30: return AVERROR(EINVAL) instead of EINVAL build: add -L flags before existing LDFLAGS simple_idct: whitespace cosmetics simple_idct: make repeated code a macro dsputil: remove huge #if 0 block simple_idct: change 10-bit add/put stride from pixels to bytes dsputil: allow 9/10-bit functions for non-h264 codecs dnxhd: rename some data tables dnxhdenc: remove inline from function only called through pointer dnxhdenc: whitespace cosmetics swscale: mark YUV422P10(LE,BE) as supported for output configure: add -xc99 to LDFLAGS for Sun CC Remove unused and non-compiling vestigial g729 decoder Remove unused code under G729_BITEXACT #ifdef. mpegvideo: fix invalid picture unreferencing. dsputil: Remove extra blank line at end. dsputil: Replace a LONG_MAX check with HAVE_FAST_64BIT. simple_idct: add 10-bit version Conflicts: Makefile libavcodec/g729data.h libavcodec/g729dec.c libavcodec/rv30.c tests/ref/lavfi/pixdesc tests/ref/lavfi/pixfmts_copy tests/ref/lavfi/pixfmts_null tests/ref/lavfi/pixfmts_scale tests/ref/lavfi/pixfmts_vflip Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/mpegvideo.c')
-rw-r--r--libavcodec/mpegvideo.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c
index f44824117d..6ebaef8341 100644
--- a/libavcodec/mpegvideo.c
+++ b/libavcodec/mpegvideo.c
@@ -318,7 +318,7 @@ int ff_alloc_picture(MpegEncContext *s, Picture *pic, int shared){
s->prev_pict_types[0]= s->dropable ? AV_PICTURE_TYPE_B : s->pict_type;
if (pic->f.age < PREV_PICT_TYPES_BUFFER_SIZE && s->prev_pict_types[pic->f.age] == AV_PICTURE_TYPE_B)
pic->f.age = INT_MAX; // Skipped MBs in B-frames are quite rare in MPEG-1/2 and it is a bit tricky to skip them anyway.
- pic->owner2 = NULL;
+ pic->owner2 = s;
return 0;
fail: //for the FF_ALLOCZ_OR_GOTO macro
@@ -1036,14 +1036,16 @@ int MPV_frame_start(MpegEncContext *s, AVCodecContext *avctx)
/* mark&release old frames */
if (s->pict_type != AV_PICTURE_TYPE_B && s->last_picture_ptr && s->last_picture_ptr != s->next_picture_ptr && s->last_picture_ptr->f.data[0]) {
if(s->out_format != FMT_H264 || s->codec_id == CODEC_ID_SVQ3){
- free_frame_buffer(s, s->last_picture_ptr);
+ if (s->last_picture_ptr->owner2 == s)
+ free_frame_buffer(s, s->last_picture_ptr);
/* release forgotten pictures */
/* if(mpeg124/h263) */
if(!s->encoding){
for(i=0; i<s->picture_count; i++){
- if (s->picture[i].f.data[0] && &s->picture[i] != s->next_picture_ptr && s->picture[i].f.reference) {
- av_log(avctx, AV_LOG_ERROR, "releasing zombie picture\n");
+ if (s->picture[i].owner2 == s && s->picture[i].f.data[0] && &s->picture[i] != s->next_picture_ptr && s->picture[i].f.reference) {
+ if (!(avctx->active_thread_type & FF_THREAD_FRAME))
+ av_log(avctx, AV_LOG_ERROR, "releasing zombie picture\n");
free_frame_buffer(s, &s->picture[i]);
}
}