h265parser: Use vps_timing_info when not present in vui
authorDong Il Park <dongil.park@lge.com>
Thu, 18 Apr 2019 07:54:51 +0000 (16:54 +0900)
committerNicolas Dufresne <nicolas@ndufresne.ca>
Fri, 14 Jun 2019 02:15:46 +0000 (02:15 +0000)
The same timing_info will be present at vps or vui.
When the timeing_info is present in the VPS, vui_timing_info
, when present, shall be equal to vps_timing_info, and when
not present, is inferred to be equal to vps_timing_info.

gst-libs/gst/codecparsers/gsth265parser.c

index 204835e..f8fec3f 100644 (file)
@@ -1884,8 +1884,12 @@ gst_h265_parse_sps (GstH265Parser * parser, GstH265NalUnit * nalu,
         && !vui->field_seq_flag && !vui->frame_field_info_present_flag) {
       sps->fps_num = vui->time_scale;
       sps->fps_den = vui->num_units_in_tick;
-      GST_LOG ("framerate %d/%d", sps->fps_num, sps->fps_den);
+      GST_LOG ("framerate %d/%d in VUI", sps->fps_num, sps->fps_den);
     }
+  } else if (vps && vps->timing_info_present_flag) {
+    sps->fps_num = vps->time_scale;
+    sps->fps_den = vps->num_units_in_tick;
+    GST_LOG ("framerate %d/%d in VPS", sps->fps_num, sps->fps_den);
   } else {
     GST_LOG ("No VUI, unknown framerate");
   }