codecparsers: h264: fix SEI buffering_period() parsing.

Fix parsing of buffering_period() SEI messages. The number of bits
used to express {nal,vcl}_initial_cpb_removal_delay{,_offset} syntax
elements is not 5 but 1 + initial_cpb_removal_delay_length_minus1.

https://bugzilla.gnome.org/show_bug.cgi?id=726828

Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
This commit is contained in:
Gwenole Beauchesne 2014-03-21 17:03:36 +01:00
parent 80a51a8fab
commit aa73624638

View file

@ -687,25 +687,29 @@ gst_h264_parser_parse_buffering_period (GstH264NalParser * nalparser,
if (vui->nal_hrd_parameters_present_flag) { if (vui->nal_hrd_parameters_present_flag) {
GstH264HRDParams *hrd = &vui->nal_hrd_parameters; GstH264HRDParams *hrd = &vui->nal_hrd_parameters;
const guint8 nbits = hrd->initial_cpb_removal_delay_length_minus1 + 1;
guint8 sched_sel_idx; guint8 sched_sel_idx;
for (sched_sel_idx = 0; sched_sel_idx <= hrd->cpb_cnt_minus1; for (sched_sel_idx = 0; sched_sel_idx <= hrd->cpb_cnt_minus1;
sched_sel_idx++) { sched_sel_idx++) {
READ_UINT8 (nr, per->nal_initial_cpb_removal_delay[sched_sel_idx], 5); READ_UINT8 (nr, per->nal_initial_cpb_removal_delay[sched_sel_idx],
nbits);
READ_UINT8 (nr, READ_UINT8 (nr,
per->nal_initial_cpb_removal_delay_offset[sched_sel_idx], 5); per->nal_initial_cpb_removal_delay_offset[sched_sel_idx], nbits);
} }
} }
if (vui->vcl_hrd_parameters_present_flag) { if (vui->vcl_hrd_parameters_present_flag) {
GstH264HRDParams *hrd = &vui->vcl_hrd_parameters; GstH264HRDParams *hrd = &vui->vcl_hrd_parameters;
const guint8 nbits = hrd->initial_cpb_removal_delay_length_minus1 + 1;
guint8 sched_sel_idx; guint8 sched_sel_idx;
for (sched_sel_idx = 0; sched_sel_idx <= hrd->cpb_cnt_minus1; for (sched_sel_idx = 0; sched_sel_idx <= hrd->cpb_cnt_minus1;
sched_sel_idx++) { sched_sel_idx++) {
READ_UINT8 (nr, per->vcl_initial_cpb_removal_delay[sched_sel_idx], 5); READ_UINT8 (nr, per->vcl_initial_cpb_removal_delay[sched_sel_idx],
nbits);
READ_UINT8 (nr, READ_UINT8 (nr,
per->vcl_initial_cpb_removal_delay_offset[sched_sel_idx], 5); per->vcl_initial_cpb_removal_delay_offset[sched_sel_idx], nbits);
} }
} }
} }