Merge remote-tracking branch 'origin/beta'

This commit is contained in:
Bruno Herbelin
2024-10-13 23:58:30 +02:00
3 changed files with 28 additions and 24 deletions

View File

@@ -223,7 +223,7 @@ void Mixer::update()
// (can be automatically repaired without user intervention)
if (fail == Source::FAIL_RETRY) {
if ( !recreateSource( *it ) ) {
Log::Warning("Source '%s' failed and could not be fixed.", (*it)->name().c_str());
Log::Notify("Source '%s' failed.", (*it)->name().c_str());
// delete failed source if could not recreate it
deleteSource( *it );
}
@@ -236,7 +236,7 @@ void Mixer::update()
// Delete FATAL failed sources from the mixer
// (nothing can be done by the user)
else {
Log::Warning("Source '%s' failed and was deleted.", (*it)->name().c_str());
Log::Warning("Source '%s' failed.", (*it)->name().c_str());
deleteSource( *it );
}
// needs refresh after intervention
@@ -246,7 +246,7 @@ void Mixer::update()
else if ( fail < Source::FAIL_CRITICAL ) {
// This looks like we should try to recreate it
if ( !recreateSource( *it ) ) {
Log::Warning("Source '%s' definitely failed and could not be fixed.", (*it)->name().c_str());
Log::Warning("Source '%s' failed and could not be recovered.", (*it)->name().c_str());
// delete failed source if could not recreate it
deleteSource( *it );
}

View File

@@ -2436,13 +2436,13 @@ void SourceControlWindow::RenderMediaPlayer(MediaSource *ms)
/// MERGE CUTS AT CURSOR
///
ImGui::SameLine(0, IMGUI_SAME_LINE);
DragButtonIcon(19, 3, "Drop in timeline to\nMerge right",
DragButtonIcon(19, 3, "Drop in timeline to\nMerge two gaps",
TimelinePayload(TimelinePayload::CUT_MERGE, 0, 0) );
///
/// ERASE CUT AT CURSOR
///
ImGui::SameLine(0, IMGUI_SAME_LINE);
DragButtonIcon(0, 4, "Drop in timeline to\nErase right",
DragButtonIcon(0, 4, "Drop in timeline to\nErase a gap",
TimelinePayload(TimelinePayload::CUT_ERASE, 0, 0) );
}
else {
@@ -2468,11 +2468,14 @@ void SourceControlWindow::RenderMediaPlayer(MediaSource *ms)
ImGui::SameLine(0, 0);
ImVec2 draw_pos = ImGui::GetCursorPos();
ImGui::SetNextItemWidth(180); // TODO VARIABLE WIDTH
ImGui::SetCursorPosY(ImGui::GetTextLineHeightWithSpacing() * 0.333 );
float w = gap_dialog_size.x - 4.f * ImGui::GetTextLineHeightWithSpacing() ;
ImGui::SetNextItemWidth(w - draw_pos.x - IMGUI_SAME_LINE); // VARIABLE WIDTH
ImGuiToolkit::InputTime("##Time", &target_time);
ImGui::SetCursorPos(ImVec2(draw_pos.x, draw_pos.y + 35));
ImGuiToolkit::HSliderUInt64("#SliderTime", ImVec2(180, 14), &target_time, 0, tl->duration());
// ImGui::SetCursorPos(ImVec2(draw_pos.x, draw_pos.y + 35));
// ImGuiToolkit::HSliderUInt64("#SliderTime", ImVec2(180, 14), &target_time, 0, tl->duration());
// static int p = 5;
// ImGuiToolkit::HSliderInt("#toto", ImVec2(140, 14), &p, 1, 9);
@@ -2505,10 +2508,7 @@ void SourceControlWindow::RenderMediaPlayer(MediaSource *ms)
// Action buttons
ImGui::PushStyleColor(ImGuiCol_Button, ImVec4(0, 0, 0, 0));
ImGui::SetCursorPos(
ImVec2(gap_dialog_size.x - 4.f * ImGui::GetTextLineHeightWithSpacing() - IMGUI_SAME_LINE,
draw_pos.y));
ImGui::SetCursorPos( ImVec2(w, draw_pos.y));
// ImGui::SameLine(0, IMGUI_SAME_LINE);
if (ImGuiToolkit::ButtonIcon(17, 3, "Cut left at given time")) {
@@ -2646,7 +2646,10 @@ void SourceControlWindow::RenderMediaPlayer(MediaSource *ms)
// float md = 10000;
ImGui::SameLine(0, IMGUI_SAME_LINE);
ImGui::SetNextItemWidth(180);
ImVec2 draw_pos = ImGui::GetCursorPos();
float w = gap_dialog_size.x - 3.f * ImGui::GetTextLineHeightWithSpacing() - IMGUI_SAME_LINE;
ImGui::SetNextItemWidth(w - draw_pos.x);
float seconds = (float) d / 1000.f;
if (current_curve > 0) {

View File

@@ -77,6 +77,18 @@ Stream::~Stream()
{
Stream::close();
// cleanup opengl texture
if (textureindex_) {
glDeleteTextures(1, &textureindex_);
textureindex_ = 0;
}
// cleanup picture buffer
if (pbo_[0]) {
glDeleteBuffers(2, pbo_);
pbo_[0] = 0;
}
#ifdef STREAM_DEBUG
g_printerr("Stream %s deleted\n", std::to_string(id_).c_str());
#endif
@@ -440,17 +452,6 @@ void Stream::close()
bus_ = nullptr;
}
// cleanup opengl texture
if (textureindex_) {
glDeleteTextures(1, &textureindex_);
textureindex_ = 0;
}
// cleanup picture buffer
if (pbo_[0]) {
glDeleteBuffers(2, pbo_);
pbo_[0] = 0;
}
}