Find the location of a frame in a chunk
| 118 | |
| 119 | // Find the location of a frame in a chunk |
| 120 | ChunkLocation ChunkReader::find_chunk_frame(int64_t requested_frame) |
| 121 | { |
| 122 | // Determine which chunk contains this frame. |
| 123 | int64_t chunk_number = (requested_frame / chunk_size) + 1; |
| 124 | |
| 125 | // Determine which frame in this chunk |
| 126 | int64_t start_frame_of_chunk = (chunk_number - 1) * chunk_size; |
| 127 | int64_t 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. |
| 128 | |
| 129 | // Prepare chunk location struct |
| 130 | ChunkLocation location = {chunk_number, chunk_frame_number}; |
| 131 | |
| 132 | return location; |
| 133 | } |
| 134 | |
| 135 | // Open chunk folder or file |
| 136 | void ChunkReader::Open() |
nothing calls this directly
no outgoing calls
no test coverage detected