mirror of
https://github.com/CCExtractor/ccextractor.git
synced 2026-04-21 13:39:56 +00:00
[PR #1686] [FIX] issue1499 #2405
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Original Pull Request: https://github.com/CCExtractor/ccextractor/pull/1686
State: closed
Merged: No
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.