Skip to content
Snippets Groups Projects
0005-access_output-file-Add-error-dialog-for-write-open.patch 1.78 KiB
Newer Older
From dfb83a71d0ac1a5094afa320df647481afc5a78f Mon Sep 17 00:00:00 2001
Message-Id: <dfb83a71d0ac1a5094afa320df647481afc5a78f.1565088614.git.thomas@gllm.fr>
In-Reply-To: <8181eb1f5b872c51879f155318b6218f49b73171.1565088614.git.thomas@gllm.fr>
References: <8181eb1f5b872c51879f155318b6218f49b73171.1565088614.git.thomas@gllm.fr>
From: Soomin Lee <bubu@mikan.io>
Date: Mon, 1 Oct 2018 15:37:57 +0200
Subject: [PATCH 5/6] access_output: file: Add error dialog for write/open

---
 modules/access_output/file.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/modules/access_output/file.c b/modules/access_output/file.c
index fbefce0be8..45de0fc75e 100644
--- a/modules/access_output/file.c
+++ b/modules/access_output/file.c
@@ -88,6 +88,9 @@ static ssize_t Write( sout_access_out_t *p_access, block_t *p_buffer )
         {
             if (errno == EINTR)
                 continue;
+            if (errno == ENOSPC)
+                vlc_dialog_display_error(p_access, "record",
+                                         "An error occurred during recording. Error: %s", vlc_strerror_c(errno));
             block_ChainRelease (p_buffer);
             msg_Err( p_access, "cannot write: %s", vlc_strerror_c(errno) );
             return -1;
@@ -305,8 +308,13 @@ static int Open( vlc_object_t *p_this )
             if (fd != -1)
                 break;
             if (fd == -1)
+            {
                 msg_Err (p_access, "cannot create %s: %s", path,
                          vlc_strerror_c(errno));
+
+                vlc_dialog_display_error(p_access, "record",
+                                         "An error occurred during recording. Error: %s", vlc_strerror_c(errno));
+            }
             if (overwrite || errno != EEXIST)
                 break;
             flags &= ~O_EXCL;
-- 
2.20.1