aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2020-09-14 02:31:06 +0200
committerdec05eba <dec05eba@protonmail.com>2020-09-14 02:31:06 +0200
commitf0122e7386e0e4fe63dafa9c1835ae0b04557ee4 (patch)
treeffbc1bd65de5e920a8fbd47db0fdbc7d9ea1f1ac /src
parent8c8e0fceedfe66bb2d5c07257514cbc64596bb3c (diff)
Do not show error when quiting video with 'q'
Diffstat (limited to 'src')
-rw-r--r--src/QuickMedia.cpp3
-rw-r--r--src/VideoPlayer.cpp6
2 files changed, 6 insertions, 3 deletions
diff --git a/src/QuickMedia.cpp b/src/QuickMedia.cpp
index 4b528cf..6935995 100644
--- a/src/QuickMedia.cpp
+++ b/src/QuickMedia.cpp
@@ -1299,6 +1299,9 @@ namespace QuickMedia {
show_notification("Video player", "Failed to connect to mpv ipc after 10 seconds", Urgency::CRITICAL);
current_page = previous_page;
break;
+ } else if(update_err == VideoPlayer::Error::EXITED && video_player->exit_status == 0) {
+ fprintf(stderr, "mpv exited with status 0, the user most likely closed mpv with 'q'\n");
+ current_page = previous_page;
} else if(update_err != VideoPlayer::Error::OK) {
show_notification("Video player", "The video player failed to play the video", Urgency::CRITICAL);
current_page = previous_page;
diff --git a/src/VideoPlayer.cpp b/src/VideoPlayer.cpp
index 8d57f62..e8f8795 100644
--- a/src/VideoPlayer.cpp
+++ b/src/VideoPlayer.cpp
@@ -26,6 +26,7 @@ namespace QuickMedia {
connected_to_ipc(false),
connect_tries(0),
find_window_tries(0),
+ exit_status(0),
event_callback(_event_callback),
window_create_callback(_window_create_callback),
window_handle(0),
@@ -209,9 +210,8 @@ namespace QuickMedia {
}
if(video_process_id != -1) {
- int status;
- if(wait_program_non_blocking(video_process_id, &status)) {
- fprintf(stderr, "The video player exited!, status: %d\n", status);
+ if(wait_program_non_blocking(video_process_id, &exit_status)) {
+ fprintf(stderr, "The video player exited!, status: %d\n", exit_status);
close(ipc_socket);
remove(ipc_server_path);
video_process_id = -1;