]> git.sesse.net Git - ffmpeg/commitdiff
h264: move calculating the POC out of h264_slice_header_parse()
authorAnton Khirnov <anton@khirnov.net>
Thu, 14 Apr 2016 18:53:59 +0000 (20:53 +0200)
committerAnton Khirnov <anton@khirnov.net>
Sun, 12 Jun 2016 18:27:52 +0000 (20:27 +0200)
This function does not do any bitstream parsing and it depends on the
current frame being allocated, so this will allow the frame_start() to
be moved out eventually.

libavcodec/h264_slice.c

index 0c381218270a4d477d6c5c038896e397868a938a..3252b38ff5226dfe71c3a5f00a629a2db99af580 100644 (file)
@@ -1325,10 +1325,6 @@ static int h264_slice_header_parse(H264Context *h, H264SliceContext *sl)
         }
     }
 
-    if (!h->setup_finished)
-        ff_h264_init_poc(h->cur_pic_ptr->field_poc, &h->cur_pic_ptr->poc,
-                         sps, &h->poc, h->picture_structure, h->nal_ref_idc);
-
     if (pps->redundant_pic_cnt_present)
         sl->redundant_pic_count = get_ue_golomb(&sl->gb);
 
@@ -1446,6 +1442,10 @@ int ff_h264_decode_slice_header(H264Context *h, H264SliceContext *sl)
     if (ret < 0)
         return ret;
 
+    if (!h->setup_finished)
+        ff_h264_init_poc(h->cur_pic_ptr->field_poc, &h->cur_pic_ptr->poc,
+                         h->ps.sps, &h->poc, h->picture_structure, h->nal_ref_idc);
+
     ret = ff_h264_build_ref_list(h, sl);
     if (ret < 0)
         return ret;