diff --git a/lib/src/signed_video_h26x_sign.c b/lib/src/signed_video_h26x_sign.c index 6c4fa9c..8cb9097 100644 --- a/lib/src/signed_video_h26x_sign.c +++ b/lib/src/signed_video_h26x_sign.c @@ -438,8 +438,10 @@ prepare_for_nalus_to_prepend(signed_video_t *self) // proceed. But if there are vital SEI-nalus waiting to be pulled we return an error message // (SV_NOT_SUPPORTED). - SV_THROW_IF_WITH_MSG( - self->num_of_completed_seis > 0, SV_NOT_SUPPORTED, "There are remaining SEIs."); + if (!self->avoid_checking_available_seis) { + SV_THROW_IF_WITH_MSG( + self->num_of_completed_seis > 0, SV_NOT_SUPPORTED, "There are remaining SEIs."); + } SV_CATCH() SV_DONE(status) @@ -652,6 +654,9 @@ signed_video_get_sei(signed_video_t *self, // Only display a SEI if the |peek_nalu| is a primary picture NAL Unit. if (!((nalu_info.nalu_type == NALU_TYPE_I || nalu_info.nalu_type == NALU_TYPE_P) && nalu_info.is_primary_slice)) { + // Flip the sanity check flag since there are pending SEIs, which could not be fetched without + // breaking the H.26x standard. + self->avoid_checking_available_seis = true; return SV_OK; } } diff --git a/lib/src/signed_video_internal.h b/lib/src/signed_video_internal.h index 450d0f7..f3347a1 100644 --- a/lib/src/signed_video_internal.h +++ b/lib/src/signed_video_internal.h @@ -152,6 +152,10 @@ struct _signed_video_t { // unnecessary. bool gop_hash_off; // Flag indicating if the GENERAL TAG doesn't include GOP hash. // TODO: |gop_hash_off| will be deprecated when the feature is fully integrated. + // TODO: Remove this flag when the deprecated API get_nalus_to_prepend have been removed. + bool avoid_checking_available_seis; // Temporary flag to avoid checking for available SEIs when + // peek NAL Units are used when getting SEIs, since they + // might be postponed. // For signing plugin void *plugin_handle;