vlc/vlc-3.0 | branch: master | Francois Cartegnie <fcvlc...@free.fr> | Tue Jan 30 14:14:00 2018 +0100| [be9603be709348c60cdd66d7b6362bc2143d33e9] | committer: Jean-Baptiste Kempf
packetizer: hevc: check before replacing xps (cherry picked from commit b6ebaba1a1f0c80392170124e94f63eccb7ddfd8) Signed-off-by: Jean-Baptiste Kempf <j...@videolan.org> > http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=be9603be709348c60cdd66d7b6362bc2143d33e9 --- modules/packetizer/hevc.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/modules/packetizer/hevc.c b/modules/packetizer/hevc.c index d5c6b11f14..ec8873af7c 100644 --- a/modules/packetizer/hevc.c +++ b/modules/packetizer/hevc.c @@ -375,6 +375,19 @@ static bool InsertXPS(decoder_t *p_dec, uint8_t i_nal_type, uint8_t i_id, 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 */ if(*pp_decoded) { _______________________________________________ vlc-commits mailing list vlc-commits@videolan.org https://mailman.videolan.org/listinfo/vlc-commits