Skip to content

Commit

Permalink
fix: video should mute if audio is not enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
Almamu committed Jul 12, 2024
1 parent ac117e3 commit 06038b8
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/WallpaperEngine/Render/Wallpapers/CVideo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ CVideo::CVideo (Core::CVideo* video, CRenderContext& context, CAudioContext& aud
mpv_set_option_string (this->m_mpv, "loop", "inf");
mpv_set_option (this->m_mpv, "volume", MPV_FORMAT_DOUBLE, &volume);

if (!this->getContext ().getApp ().getContext ().settings.audio.enabled) {
mpv_set_option_string(this->m_mpv, "mute", "yes");
}

// initialize gl context for mpv
mpv_opengl_init_params gl_init_params {get_proc_address, this};
mpv_render_param params [] {{MPV_RENDER_PARAM_API_TYPE, const_cast<char*> (MPV_RENDER_API_TYPE_OPENGL)},
Expand Down

0 comments on commit 06038b8

Please sign in to comment.