Merge commit '271ce76d317c5432e151216cf23f12b77ed6cb7e'
[ffmpeg.git] / libavcodec / h264.c
index 818ee06..baedcf4 100644 (file)
@@ -608,7 +608,6 @@ static int h264_init_context(AVCodecContext *avctx, H264Context *h)
     h->frame_recovered       = 0;
     h->prev_frame_num        = -1;
     h->sei_fpa.frame_packing_arrangement_cancel_flag = -1;
-    h->has_afd               = 0;
 
     h->next_outputed_poc = INT_MIN;
     for (i = 0; i < MAX_DELAYED_PIC_COUNT; i++)
@@ -870,12 +869,13 @@ static void decode_postinit(H264Context *h, int setup_finished)
         }
     }
 
-    if (h->has_afd) {
-        AVFrameSideData *sd =
-            av_frame_new_side_data(cur->f, AV_FRAME_DATA_AFD, 1);
+    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->afd;
-            h->has_afd = 0;
+            *sd->data = h->active_format_description;
+            h->sei_reguserdata_afd_present = 0;
         }
     }