]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/h264.c
avcodec/dxva2_hevc: unbreak compilation after recent sps/pps changes
[ffmpeg] / libavcodec / h264.c
index 9be317c55fda7bc50cccc8993c5d0862fec5d721..f62ad6a2f313e7636e445027f5c414870f5102c6 100644 (file)
@@ -869,6 +869,25 @@ static void decode_postinit(H264Context *h, int setup_finished)
         }
     }
 
+    if (h->sei_reguserdata_afd_present) {
+        AVFrameSideData *sd = av_frame_new_side_data(cur->f, AV_FRAME_DATA_AFD,
+                                                     sizeof(uint8_t));
+
+        if (sd) {
+            *sd->data = h->active_format_description;
+            h->sei_reguserdata_afd_present = 0;
+        }
+    }
+
+    if (h->a53_caption) {
+        AVFrameSideData *sd =
+            av_frame_new_side_data(cur->f, AV_FRAME_DATA_A53_CC, h->a53_caption_size);
+        if (sd)
+            memcpy(sd->data, h->a53_caption, h->a53_caption_size);
+        av_freep(&h->a53_caption);
+        h->a53_caption_size = 0;
+    }
+
     cur->mmco_reset = h->mmco_reset;
     h->mmco_reset = 0;
 
@@ -964,8 +983,12 @@ static void decode_postinit(H264Context *h, int setup_finished)
         h->next_output_pic->recovered |= !!(h->frame_recovered & FRAME_RECOVERED_SEI);
     }
 
-    if (setup_finished && !h->avctx->hwaccel)
+    if (setup_finished && !h->avctx->hwaccel) {
         ff_thread_finish_setup(h->avctx);
+
+        if (h->avctx->active_thread_type & FF_THREAD_FRAME)
+            h->setup_finished = 1;
+    }
 }
 
 int ff_pred_weight_table(H264Context *h, H264SliceContext *sl)
@@ -1736,6 +1759,7 @@ static int h264_decode_frame(AVCodecContext *avctx, void *data,
     int ret;
 
     h->flags = avctx->flags;
+    h->setup_finished = 0;
 
     if (h->backup_width != -1) {
         avctx->width    = h->backup_width;