Smooth speed change (fix issue #96)

Use GST_SEEK_FLAG_INSTANT_RATE_CHANGE seeking event available since gst version 1.18 for a smooth (non flushing) change of play speed
This commit is contained in:
Bruno Herbelin
2023-06-01 22:08:55 +02:00
parent 6b1c1853b8
commit 514d4170be
2 changed files with 29 additions and 2 deletions

View File

@@ -4401,7 +4401,7 @@ void SourceController::RenderMediaPlayer(MediaSource *ms)
ImGui::SetNextItemWidth(ImGui::GetContentRegionAvail().x - buttons_height_ );
// speed slider
float speed = static_cast<float>(mediaplayer_active_->playSpeed());
if (ImGui::DragFloat( "##Speed", &speed, 0.01f, -10.f, 10.f, UNICODE_MULTIPLY " %.2f", 2.f))
if (ImGui::DragFloat( "##Speed", &speed, 0.01f, -10.f, 10.f, UNICODE_MULTIPLY " %.2f"))
mediaplayer_active_->setPlaySpeed( static_cast<double>(speed) );
// store action on mouse release
if (ImGui::IsItemDeactivatedAfterEdit()){