aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-12-14 15:36:37 +0100
committerMichael Niedermayer <michaelni@gmx.at>2012-12-14 15:36:37 +0100
commit2f265d9087362c17920e4bce59b21653f3fffbfe (patch)
tree209ef39243b60e4f360646fd211d88e15f913418 /libavcodec
parent86b4dc6277691781015000763563d1baf212cdc7 (diff)
parent6a27ae28f9bde981e85c82cf5bf42c5f43fb6f13 (diff)
downloadffmpeg-2f265d9087362c17920e4bce59b21653f3fffbfe.tar.gz
Merge commit '6a27ae28f9bde981e85c82cf5bf42c5f43fb6f13'
* commit '6a27ae28f9bde981e85c82cf5bf42c5f43fb6f13': mpegvideo: treat delayed pictures as used Conflicts: libavcodec/h264.h Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/h264.h6
-rw-r--r--libavcodec/mpegvideo.c8
-rw-r--r--libavcodec/mpegvideo.h6
3 files changed, 10 insertions, 10 deletions
diff --git a/libavcodec/h264.h b/libavcodec/h264.h
index eb88c0c21d..bea6e22eca 100644
--- a/libavcodec/h264.h
+++ b/libavcodec/h264.h
@@ -98,12 +98,6 @@
#define IS_REF0(a) ((a) & MB_TYPE_REF0)
#define IS_8x8DCT(a) ((a) & MB_TYPE_8x8DCT)
-/**
- * Value of Picture.reference when Picture is not a reference picture, but
- * is held for delayed output.
- */
-#define DELAYED_PIC_REF 4
-
#define QP_MAX_NUM (51 + 6*6) // The maximum supported qp
/* NAL unit types */
diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c
index dc1fc6ca04..a3eafe42c7 100644
--- a/libavcodec/mpegvideo.c
+++ b/libavcodec/mpegvideo.c
@@ -971,9 +971,6 @@ static int free_context_frame(MpegEncContext *s)
for (i = 0; i < 3; i++)
av_freep(&s->visualization_buffer[i]);
- if (!(s->avctx->active_thread_type & FF_THREAD_FRAME))
- avcodec_default_free_buffers(s->avctx);
-
return 0;
}
@@ -1093,6 +1090,9 @@ void ff_MPV_common_end(MpegEncContext *s)
free_context_frame(s);
+ if (!(s->avctx->active_thread_type & FF_THREAD_FRAME))
+ avcodec_default_free_buffers(s->avctx);
+
s->context_initialized = 0;
s->last_picture_ptr =
s->next_picture_ptr =
@@ -1211,7 +1211,7 @@ static inline int pic_is_unused(MpegEncContext *s, Picture *pic)
{
if (pic->f.data[0] == NULL)
return 1;
- if (pic->needs_realloc)
+ if (pic->needs_realloc && !(pic->f.reference & DELAYED_PIC_REF))
if (!pic->owner2 || pic->owner2 == s)
return 1;
return 0;
diff --git a/libavcodec/mpegvideo.h b/libavcodec/mpegvideo.h
index 1bdead56eb..be23c3e35e 100644
--- a/libavcodec/mpegvideo.h
+++ b/libavcodec/mpegvideo.h
@@ -80,6 +80,12 @@ enum OutputFormat {
#define EXT_START_CODE 0x000001b5
#define USER_START_CODE 0x000001b2
+/**
+ * Value of Picture.reference when Picture is not a reference picture, but
+ * is held for delayed output.
+ */
+#define DELAYED_PIC_REF 4
+
struct MpegEncContext;
/**