Close the writer
| 209 | |
| 210 | // Close the writer |
| 211 | void ChunkWriter::Close() |
| 212 | { |
| 213 | // Write the frames once it reaches the correct chunk size |
| 214 | if (is_writing) |
| 215 | { |
| 216 | // Pad an additional 12 frames |
| 217 | for (int z = 0; z<12; z++) |
| 218 | { |
| 219 | // Repeat frame |
| 220 | writer_final->WriteFrame(last_frame); |
| 221 | writer_preview->WriteFrame(last_frame); |
| 222 | writer_thumb->WriteFrame(last_frame); |
| 223 | } |
| 224 | |
| 225 | // Write Footer |
| 226 | writer_final->WriteTrailer(); |
| 227 | writer_preview->WriteTrailer(); |
| 228 | writer_thumb->WriteTrailer(); |
| 229 | |
| 230 | // Close writer & reader |
| 231 | writer_final->Close(); |
| 232 | writer_preview->Close(); |
| 233 | writer_thumb->Close(); |
| 234 | |
| 235 | // Increment chunk count |
| 236 | chunk_count++; |
| 237 | |
| 238 | // Stop writing chunk |
| 239 | is_writing = false; |
| 240 | } |
| 241 | |
| 242 | // close writer |
| 243 | is_open = false; |
| 244 | |
| 245 | // Reset frame counters |
| 246 | chunk_count = 0; |
| 247 | frame_count = 0; |
| 248 | |
| 249 | // Open reader |
| 250 | local_reader->Close(); |
| 251 | } |
| 252 | |
| 253 | // write JSON meta data |
| 254 | void ChunkWriter::write_json_meta_data() |
no test coverage detected