Skip to content
Extraits de code Groupes Projets

MPV: Fix the MPV controls

Fusionnées Kubat a demandé de fusionner fix-mpv vers master
1 fichier
+ 8
0
Comparer les modifications
  • Côte à côte
  • En ligne
@@ -7,6 +7,12 @@ using namespace std::string_literals;
if ((ptr) == nullptr) \
return
#define TRY_CREATE_MPV(ptr) \
if ((ptr) == nullptr) { \
logInfo() << "Asked to play MPV but context not created, try to create it"; \
reCreateMpvContext(); \
}
void
MpvContainer::mpvEventWakeUpCB(void *user) noexcept
{
@@ -297,6 +303,7 @@ MpvContainer::printMpvError(int rc) const noexcept
void
MpvContainer::mpvPlay() noexcept
{
TRY_CREATE_MPV(mpv);
RETURN_IF_NULLPTR(mpv);
if (isPlaybackPaused)
mpvTogglePlayback();
@@ -313,6 +320,7 @@ MpvContainer::mpvPause() noexcept
void
MpvContainer::mpvTogglePlayback() noexcept
{
TRY_CREATE_MPV(mpv);
RETURN_IF_NULLPTR(mpv);
logDebug() << "MPV: Toggling the playback";
asyncCommand(AsyncCmdType::TogglePlayback, { "cycle", "pause", "up", nullptr });
Chargement en cours