mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 12:11:13 +00:00
h264parse: do not try to read from a non existent VUI
https://bugzilla.gnome.org/show_bug.cgi?id=658800
This commit is contained in:
parent
b8f9c3b39d
commit
ac5121eb01
1 changed files with 18 additions and 12 deletions
|
@ -1468,19 +1468,25 @@ gst_h264_parse_sps (GstH264NalUnit * nalu, GstH264SPS * sps,
|
|||
sps->width = width;
|
||||
sps->height = height;
|
||||
|
||||
/* derive framerate */
|
||||
/* FIXME verify / also handle other cases */
|
||||
GST_LOG ("Framerate: %u %u %u %u", parse_vui_params,
|
||||
vui->fixed_frame_rate_flag, sps->frame_mbs_only_flag,
|
||||
vui->pic_struct_present_flag);
|
||||
if (vui) {
|
||||
/* derive framerate */
|
||||
/* FIXME verify / also handle other cases */
|
||||
GST_LOG ("Framerate: %u %u %u %u", parse_vui_params,
|
||||
vui->fixed_frame_rate_flag, sps->frame_mbs_only_flag,
|
||||
vui->pic_struct_present_flag);
|
||||
|
||||
if (parse_vui_params && vui->fixed_frame_rate_flag &&
|
||||
sps->frame_mbs_only_flag && !vui->pic_struct_present_flag) {
|
||||
sps->fps_num = vui->time_scale;
|
||||
sps->fps_den = vui->num_units_in_tick;
|
||||
/* picture is a frame = 2 fields */
|
||||
sps->fps_den *= 2;
|
||||
GST_LOG ("framerate %d/%d", sps->fps_num, sps->fps_den);
|
||||
if (parse_vui_params && vui->fixed_frame_rate_flag &&
|
||||
sps->frame_mbs_only_flag && !vui->pic_struct_present_flag) {
|
||||
sps->fps_num = vui->time_scale;
|
||||
sps->fps_den = vui->num_units_in_tick;
|
||||
/* picture is a frame = 2 fields */
|
||||
sps->fps_den *= 2;
|
||||
GST_LOG ("framerate %d/%d", sps->fps_num, sps->fps_den);
|
||||
}
|
||||
} else {
|
||||
sps->fps_num = 0;
|
||||
sps->fps_den = 1;
|
||||
GST_LOG ("No VUI, unknown framerate");
|
||||
}
|
||||
|
||||
sps->valid = TRUE;
|
||||
|
|
Loading…
Reference in a new issue