diff options
author | Bastien Nocera <hadess@hadess.net> | 2019-02-21 13:55:59 +0100 |
---|---|---|
committer | Bastien Nocera <hadess@hadess.net> | 2019-02-21 16:26:03 +0100 |
commit | 8ae8455ab597c15a44fcfb93f2b0a9349ca2c65a (patch) | |
tree | 77625802d107d0f46a7bced724e287ee1d230b93 /src | |
parent | 6ce432d5b6faffcb2c78e6b9596ac1a0e85adba4 (diff) | |
download | totem-8ae8455ab597c15a44fcfb93f2b0a9349ca2c65a.tar.gz |
backend: Add error message when libdvdcss is missing
If we get a read error from a DVD, check whether libdvdcss is available,
and if not, make the error point to installing it as a possible solution.
Closes: #24
Diffstat (limited to 'src')
-rw-r--r-- | src/backend/bacon-video-widget.c | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/src/backend/bacon-video-widget.c b/src/backend/bacon-video-widget.c index 480e07b13..011a94ee7 100644 --- a/src/backend/bacon-video-widget.c +++ b/src/backend/bacon-video-widget.c @@ -3858,7 +3858,6 @@ bvw_error_from_gst_error (BaconVideoWidget *bvw, GstMessage * err_msg) /* FIXME: * Unemitted errors: - * BVW_ERROR_DVD_ENCRYPTED * BVW_ERROR_BROKEN_FILE */ @@ -3876,6 +3875,23 @@ bvw_error_from_gst_error (BaconVideoWidget *bvw, GstMessage * err_msg) } } + /* Check for encrypted DVD */ + if (is_error (e, RESOURCE, READ) && + g_str_has_prefix (bvw->priv->mrl, "dvd:")) { + GModule *module; + gpointer sym; + + module = g_module_open ("libdvdcss", 0); + if (module == NULL || + g_module_symbol (module, "dvdcss_open", &sym)) { + g_clear_pointer (&module, g_module_close); + ret = g_error_new_literal (BVW_ERROR, BVW_ERROR_DVD_ENCRYPTED, + _("The source seems encrypted and can’t be read. Are you trying to play an encrypted DVD without libdvdcss?")); + goto done; + } + g_clear_pointer (&module, g_module_close); + } + /* HTTP error codes */ /* FIXME: bvw_get_http_error_code() calls gst_message_parse_error too */ http_error_code = bvw_get_http_error_code (err_msg); |