diff --git a/src/MediaPlayer.cpp b/src/MediaPlayer.cpp index d060017..33531ef 100644 --- a/src/MediaPlayer.cpp +++ b/src/MediaPlayer.cpp @@ -68,6 +68,7 @@ MediaPlayer::MediaPlayer() rate_change_ = RATE_CHANGE_NONE; decoder_name_ = ""; video_filter_ = ""; + video_filter_available_ = true; position_ = GST_CLOCK_TIME_NONE; loop_ = LoopMode::LOOP_REWIND; @@ -346,8 +347,10 @@ void MediaPlayer::execute_open() g_object_set( G_OBJECT (pipeline_), "flags", flags, NULL); // hack to compensate for lack of PTS in gif animations - if (media_.codec_name.compare("image/gst-libav-gif") == 0) - video_filter_ = "videorate"; + if (media_.codec_name.compare("image/gst-libav-gif") == 0) { + video_filter_ = "videorate rate=1.0"; + video_filter_available_ = false; + } // Add a filter to playbin if provided if ( !video_filter_.empty()) { diff --git a/src/MediaPlayer.h b/src/MediaPlayer.h index e5604a9..41954f5 100644 --- a/src/MediaPlayer.h +++ b/src/MediaPlayer.h @@ -258,6 +258,7 @@ public: * */ void setVideoEffect(const std::string &pipeline_element); inline std::string videoEffect() { return video_filter_; } + inline bool videoEffectAvailable() { return video_filter_available_; } /** * Accept visitors * */ @@ -302,6 +303,7 @@ private: bool rewind_on_disable_; bool force_software_decoding_; std::string decoder_name_; + bool video_filter_available_; std::string video_filter_; // Play speed diff --git a/src/SourceControlWindow.cpp b/src/SourceControlWindow.cpp index 3d7ecdb..2a3c506 100644 --- a/src/SourceControlWindow.cpp +++ b/src/SourceControlWindow.cpp @@ -376,7 +376,8 @@ void SourceControlWindow::Render() { if (ImGui::MenuItem( ICON_FA_REDO_ALT " Reload" )) mediaplayer_active_->reopen(); - if (ImGuiToolkit::MenuItemIcon(16, 16, "Gstreamer effect") ) + if (ImGuiToolkit::MenuItemIcon(16, 16, "Gstreamer effect", nullptr, + false, mediaplayer_active_->videoEffectAvailable()) ) mediaplayer_edit_pipeline_ = true; if (ImGui::BeginMenu(ICON_FA_SNOWFLAKE " On deactivation")) {