static void discard_to_idx(struct obs_output *output, size_t idx) { for (size_t i = 0; i < idx; i++) { struct encoder_packet *packet = &output->interleaved_packets.array[i]; obs_free_encoder_packet(packet); } da_erase_range(output->interleaved_packets, 0, idx); }
static void prune_interleaved_packets(struct obs_output *output) { size_t start_idx = 0; while (can_prune_interleaved_packet(output, start_idx)) start_idx++; if (start_idx) { for (size_t i = 0; i < start_idx; i++) { struct encoder_packet *packet = &output->interleaved_packets.array[i]; obs_free_encoder_packet(packet); } da_erase_range(output->interleaved_packets, 0, start_idx); } }