You've already forked libopenshot
mirror of
https://github.com/OpenShot/libopenshot.git
synced 2026-03-02 08:53:52 -08:00
Added extra start frame to each chunk in the ChunkWriter and ChunkReader, to make sure every chunk can "stoke" the audio samples from the previous chunk. Also, added additional example code for an openshot::Frame.
This commit is contained in:
@@ -128,12 +128,12 @@ void ChunkReader::load_json()
|
||||
// Find the location of a frame in a chunk
|
||||
ChunkLocation ChunkReader::find_chunk_frame(int requested_frame)
|
||||
{
|
||||
// Determine which chunk contains this frame
|
||||
// Determine which chunk contains this frame.
|
||||
int chunk_number = (requested_frame / chunk_size) + 1;
|
||||
|
||||
// Determine which frame in this chunk
|
||||
int start_frame_of_chunk = (chunk_number - 1) * chunk_size;
|
||||
int chunk_frame_number = requested_frame - start_frame_of_chunk;
|
||||
int chunk_frame_number = (requested_frame - start_frame_of_chunk) + 1; // Add 1 to adjust for the 1st frame of every chunk is just there to "stoke" the audio samples from the previous chunk.
|
||||
|
||||
// Prepare chunk location struct
|
||||
ChunkLocation location = {chunk_number, chunk_frame_number};
|
||||
|
||||
Reference in New Issue
Block a user