From c1ffe8d4abb75dad5615006152da3eb130362a45 Mon Sep 17 00:00:00 2001 From: Ondrej Holy Date: Wed, 22 Jun 2016 10:05:58 +0200 Subject: 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 --- common/gvfsmountinfo.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'common') 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); -- cgit v1.2.1