]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/h264_slice.c
Merge commit '4dfbc7a7559ccab666a8fd39de4224eb4b02c768'
[ffmpeg] / libavcodec / h264_slice.c
index a346ccbc00407dd1b0783d6f349df4839e908c12..eceda8a9bc740b95016c3d1a7456f8b8621304ec 100644 (file)
@@ -617,7 +617,7 @@ static int h264_frame_start(H264Context *h)
        && !(h->avctx->codec->capabilities & AV_CODEC_CAP_HWACCEL_VDPAU)
 #endif
        )
-        avpriv_color_frame(pic->f, c);
+        ff_color_frame(pic->f, c);
 
     h->cur_pic_ptr = pic;
     ff_h264_unref_picture(h, &h->cur_pic);
@@ -1177,6 +1177,15 @@ int ff_h264_decode_slice_header(H264Context *h, H264SliceContext *sl)
                 av_log(h->avctx, AV_LOG_ERROR, "Too many fields\n");
                 return AVERROR_INVALIDDATA;
             }
+            if (h->max_contexts > 1) {
+                if (!h->single_decode_warning) {
+                    av_log(h->avctx, AV_LOG_WARNING, "Cannot decode multiple access units as slice threads\n");
+                    h->single_decode_warning = 1;
+                }
+                h->max_contexts = 1;
+                return SLICE_SINGLETHREAD;
+            }
+
             if (h->cur_pic_ptr && FIELD_PICTURE(h) && h->first_field) {
                 ret = ff_h264_field_end(h, h->slice_ctx, 1);
                 h->current_slice = 0;