lavc/h264dec: make sure a slice is decoded before finishing setup
authorMatthieu Bouron <matthieu.bouron@gmail.com>
Fri, 20 Jan 2017 16:24:52 +0000 (17:24 +0100)
committerMatthieu Bouron <matthieu.bouron@gmail.com>
Fri, 20 Jan 2017 16:28:40 +0000 (17:28 +0100)
Fixes regression in fate-h264-attachment-631 with THREADS=8 introduced
by bdbbb8f11edbf10add874508c5125c174d8939be.

libavcodec/h264dec.c

index c24818bde4c20f3fc95f36cd4c3fc9571b7f6a19..f18fb0b76503976b9653ea9e563403052d14093b 100644 (file)
@@ -679,13 +679,13 @@ again:
             if (sl->redundant_pic_count > 0)
                 break;
 
+            if (h->current_slice == 1) {
             if (avctx->active_thread_type & FF_THREAD_FRAME && !h->avctx->hwaccel &&
                 i >= nals_needed && !h->setup_finished && h->cur_pic_ptr) {
                 ff_thread_finish_setup(avctx);
                 h->setup_finished = 1;
             }
 
-            if (h->current_slice == 1) {
                 if (h->avctx->hwaccel &&
                     (ret = h->avctx->hwaccel->start_frame(h->avctx, buf, buf_size)) < 0)
                     goto end;