Commit be9603be authored by François Cartegnie's avatar François Cartegnie 🤞 Committed by Jean-Baptiste Kempf

packetizer: hevc: check before replacing xps

(cherry picked from commit b6ebaba1)
Signed-off-by: Jean-Baptiste Kempf's avatarJean-Baptiste Kempf <jb@videolan.org>
parent da339b03
...@@ -375,6 +375,19 @@ static bool InsertXPS(decoder_t *p_dec, uint8_t i_nal_type, uint8_t i_id, ...@@ -375,6 +375,19 @@ static bool InsertXPS(decoder_t *p_dec, uint8_t i_nal_type, uint8_t i_id,
return false; return false;
} }
/* Check if we really need to re-decode/replace */
if(*pp_nal)
{
const uint8_t *p_stored = (*pp_nal)->p_buffer;
size_t i_stored = (*pp_nal)->i_buffer;
hxxx_strip_AnnexB_startcode(&p_stored, &i_stored);
const uint8_t *p_new = p_nalb->p_buffer;
size_t i_new = p_nalb->i_buffer;
hxxx_strip_AnnexB_startcode(&p_new, &i_new);
if(i_stored == i_new && !memcmp(p_stored, p_new, i_new))
return true;
}
/* Free associated decoded version */ /* Free associated decoded version */
if(*pp_decoded) if(*pp_decoded)
{ {
......
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