Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In raising this pull request, I confirm the following (please check boxes):
My familiarity with the project is as follows (check one):
Summary of Changes Made
1. In
src/rust/src/lib.rs:lib_cc_decodestruct with adtvcc_rustfield to store the RustDtvccinstance.ccxr_dtvcc_init()function to initialize theDtvccstruct only once.ccxr_dtvcc_free()function to free theDtvccstruct.ccxr_process_cc_data()to use the storedDtvccinstance instead of creating a new one each time.2. In
src/lib_ccx/ccx_decoders_structs.h:dtvcc_rustfield to the existinglib_cc_decodestruct definition.3. In
src/lib_ccx/ccx_decoders_common.h:externdeclarations forccxr_dtvcc_initandccxr_dtvcc_freefunctions.4. In
src/lib_ccx/ccx_decoders_common.c:ccxr_dtvcc_init()afterdtvcc_initis called.ccxr_dtvcc_free()beforedtvcc_freeis called.dtvcc_rusttoNULLin theinit_cc_decodefunction.NULLinitialization fordtvcc_rustin thecopy_decoder_contextfunction.5. In
src/lib_ccx/mp4.c:MEDIA_TYPEdefines.externdeclarations for the Rust functions were already in place.process_clcpfunction to use the Rust implementation of Dtvcc:dtvcc_rustisNULLand initializes it if needed.cc_blockfor the Rust implementation.ccxr_process_cc_data()with the block.This implementation ensures that the
Dtvccstruct is initialized only once at the start of the program and then reused for all subsequent function calls. This fixes the issue where data was being reset each timeccxr_process_cc_data()was called. The changes also integrate this approach into the MP4 code path.