Commit 991db3b9 authored by François Cartegnie's avatar François Cartegnie 🤞

packetizer: hevc: hevc_get_xps_id should work on nal data only

parent a692bf04
......@@ -643,7 +643,10 @@ static block_t * ParseAUHead(decoder_t *p_dec, uint8_t i_nal_type, block_t *p_na
case HEVC_NAL_PPS:
{
uint8_t i_id;
if(hevc_get_xps_id(p_nalb->p_buffer, p_nalb->i_buffer, &i_id))
const uint8_t *p_xps = p_nalb->p_buffer;
size_t i_xps = p_nalb->i_buffer;
if(hxxx_strip_AnnexB_startcode(&p_xps, &i_xps) &&
hevc_get_xps_id(p_nalb->p_buffer, p_nalb->i_buffer, &i_id))
InsertXPS(p_dec, i_nal_type, i_id, p_nalb);
break;
}
......
......@@ -515,7 +515,7 @@ static bool hevc_parse_vui_parameters_rbsp( bs_t *p_bs, hevc_vui_parameters_t *p
/* Shortcut for retrieving vps/sps/pps id */
bool hevc_get_xps_id(const uint8_t *p_buf, size_t i_buf, uint8_t *pi_id)
{
if(unlikely(!hxxx_strip_AnnexB_startcode(&p_buf, &i_buf) || i_buf < 3))
if(i_buf < 3)
return false;
/* No need to lookup convert from emulation for that data */
uint8_t i_nal_type = hevc_getNALType(p_buf);
......
......@@ -179,7 +179,7 @@ uint8_t hevc_get_slice_pps_id( const hevc_slice_segment_header_t * );
uint8_t * hevc_hvcC_to_AnnexB_NAL( const uint8_t *p_buf, size_t i_buf,
size_t *pi_res, uint8_t *pi_nal_length_size );
bool hevc_get_xps_id(const uint8_t *p_buf, size_t i_buf, uint8_t *pi_id);
bool hevc_get_xps_id(const uint8_t *p_nalbuf, size_t i_nalbuf, uint8_t *pi_id);
bool hevc_get_sps_profile_tier_level( const hevc_sequence_parameter_set_t *,
uint8_t *pi_profile, uint8_t *pi_level );
bool hevc_get_picture_size( const hevc_sequence_parameter_set_t *, unsigned *p_w, unsigned *p_h,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment