diff options
author | Ondrej Holy <oholy@redhat.com> | 2016-06-22 10:05:58 +0200 |
---|---|---|
committer | Ondrej Holy <oholy@redhat.com> | 2016-06-22 11:01:52 +0200 |
commit | c1ffe8d4abb75dad5615006152da3eb130362a45 (patch) | |
tree | 690da5e0e3fb867eb184b3a62aff71b2a7fe4c6c | |
parent | 2cf06f3800fb1cacee57ee9398e68b7b15805859 (diff) | |
download | gvfs-c1ffe8d4abb75dad5615006152da3eb130362a45.tar.gz |
common: Check BDMV folder before libblueray usage
You can see the following errors from libblueray if you insert
non-blueray disk:
disc.c:350: error opening file BDMV/index.bdmv
disc.c:350: error opening file BDMV/BACKUP/index.bdmv
Unfortunately bd_set_debug_mask is not part of public API, so we
have no control over the output. Let's do not use any libblueray
API functions if BDMV dir does not exists to avoid such errors.
https://bugzilla.gnome.org/show_bug.cgi?id=767909
-rw-r--r-- | common/gvfsmountinfo.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/common/gvfsmountinfo.c b/common/gvfsmountinfo.c index 2c365516..ca4d8685 100644 --- a/common/gvfsmountinfo.c +++ b/common/gvfsmountinfo.c @@ -481,6 +481,7 @@ bdmv_metadata_thread (GSimpleAsyncResult *result, char *icon; char *name; const char *lang; + char *path; file = G_FILE (object); @@ -493,6 +494,16 @@ bdmv_metadata_thread (GSimpleAsyncResult *result, goto error; } + path = g_build_filename (disc_root, "BDMV", NULL); + if (!g_file_test (path, G_FILE_TEST_IS_DIR)) + { + error = g_error_new_literal (G_IO_ERROR, + G_IO_ERROR_FAILED, + "Device is not a Blu-Ray disc"); + goto error; + } + g_free (path); + bd = bd_open (disc_root, NULL); g_free (disc_root); |