- unique_ptr<Player> player(new Player(/*destination=*/nullptr, Player::FILE_STREAM_OUTPUT, closer.release()));
- player->set_done_callback([&done_promise] {
- done_promise.set_value();
+ Player player(/*destination=*/nullptr, Player::FILE_STREAM_OUTPUT, closer.release());
+ player.set_done_callback([&done_promise, &clip_idx, &clips] {
+ if (clip_idx >= clips.size()) {
+ done_promise.set_value();
+ }