]> git.sesse.net Git - ffmpeg/commitdiff
h264: call the hwaccel frame_start() from h264_field_start()
authorAnton Khirnov <anton@khirnov.net>
Fri, 20 May 2016 10:21:36 +0000 (12:21 +0200)
committerAnton Khirnov <anton@khirnov.net>
Tue, 21 Jun 2016 09:19:51 +0000 (11:19 +0200)
This is a more appropriate place for it.

libavcodec/h264_slice.c
libavcodec/h264dec.c

index 244640fa59c9ecaf7f720864b0b90b51c59943e3..53f745e5e0f5d031c94a290321fad36712772db8 100644 (file)
@@ -1344,6 +1344,12 @@ static int h264_field_start(H264Context *h, const H264SliceContext *sl,
             return ret;
     }
 
+    if (h->avctx->hwaccel) {
+        ret = h->avctx->hwaccel->start_frame(h->avctx, NULL, 0);
+        if (ret < 0)
+            return ret;
+    }
+
     return 0;
 }
 
index c99f6e6ec7f65640517e798f093772d43efc3aa0..b98d1416c11f79f381a6b84a33dbed067c75b704 100644 (file)
@@ -722,10 +722,6 @@ static int decode_nal_units(H264Context *h, const uint8_t *buf, int buf_size)
             if (h->current_slice == 1) {
                 if (!(avctx->flags2 & AV_CODEC_FLAG2_CHUNKS))
                     decode_postinit(h, i >= nals_needed);
-
-                if (h->avctx->hwaccel &&
-                    (ret = h->avctx->hwaccel->start_frame(h->avctx, NULL, 0)) < 0)
-                    return ret;
             }
 
             if (sl->redundant_pic_count == 0 &&