[FFmpeg-devel] [PATCH 4/6] h264: don't re-assign H264Picture::mbaff between slices.

Ronald S. Bultje rsbultje at gmail.com
Wed Mar 29 17:12:22 EEST 2017


The value must be identical between slices. (Maybe this needs an error
path to inform caller if this fails?)
---
 libavcodec/h264_direct.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/libavcodec/h264_direct.c b/libavcodec/h264_direct.c
index 4e7202b..20136b0 100644
--- a/libavcodec/h264_direct.c
+++ b/libavcodec/h264_direct.c
@@ -138,7 +138,11 @@ void ff_h264_direct_ref_list_init(const H264Context *const h, H264SliceContext *
         memcpy(cur->ref_poc[1],   cur->ref_poc[0],   sizeof(cur->ref_poc[0]));
     }
 
-    cur->mbaff = FRAME_MBAFF(h);
+    if (h->current_slice == 0) {
+        cur->mbaff = FRAME_MBAFF(h);
+    } else if (cur->mbaff != FRAME_MBAFF(h)) {
+        av_log(h->avctx, AV_LOG_ERROR, "Frame mixes MBAFF and non-MBAFF slices\n");
+    }
 
     sl->col_fieldoff = 0;
 
-- 
2.8.1



More information about the ffmpeg-devel mailing list