X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=player.cpp;h=1432f04bad93d2b5df348755e0b7e5349d0f038a;hb=ec2ed287e7271f81fb7cce5170fbce62cac79e82;hp=0d8593878f67445e3dc867dfc0ea2d0719593082;hpb=fca89bd21985639735df96a527d86f8aa05b61fe;p=nageru diff --git a/player.cpp b/player.cpp index 0d85938..1432f04 100644 --- a/player.cpp +++ b/player.cpp @@ -194,6 +194,7 @@ got_clip: if (new_clip_ready) { if (video_stream != nullptr) { video_stream->clear_queue(); + num_queued_frames = 0; } goto wait_for_clip; } @@ -210,6 +211,7 @@ got_clip: unique_lock lock(queue_state_mu); assert(num_queued_frames > 0); --num_queued_frames; + new_clip_changed.notify_all(); }; if (video_stream == nullptr) { display_func(); @@ -239,6 +241,7 @@ got_clip: unique_lock lock(queue_state_mu); assert(num_queued_frames > 0); --num_queued_frames; + new_clip_changed.notify_all(); }; if (video_stream == nullptr) { display_func(); @@ -279,6 +282,7 @@ got_clip: destination->setFrame(primary_stream_idx, pts, /*interpolated=*/true, secondary_stream_idx, secondary_pts, fade_alpha); assert(num_queued_frames > 0); --num_queued_frames; + new_clip_changed.notify_all(); }; bool ok = video_stream->schedule_interpolated_frame(next_frame_start, pts, display_func, primary_stream_idx, in_pts_lower, in_pts_upper, alpha, secondary_stream_idx, secondary_pts, fade_alpha); unique_lock lock(queue_state_mu);