-void QuickSyncEncoderImpl::encode_remaining_audio()
-{
- // This really ought to be empty by now, but just to be sure...
- for (auto &pending_frame : pending_audio_frames) {
- int64_t audio_pts = pending_frame.first;
- vector<float> audio = move(pending_frame.second);
-
- file_audio_encoder->encode_audio(audio, audio_pts + global_delay());
- if (stream_audio_encoder) {
- stream_audio_encoder->encode_audio(audio, audio_pts + global_delay());
- }
- }
- pending_audio_frames.clear();
-
- // Encode any leftover audio in the queues, and also any delayed frames.
- // Note: stream_audio_encoder is not owned by us, so don't call encode_last_audio().
- file_audio_encoder->encode_last_audio();
-}
-