[totem/wip/hadess/error-messages: 1/3] backend: Add error message when file is encrypted



commit 8caf2db4d1edcde723f4900efaf49124f4ab7284
Author: Bastien Nocera <hadess hadess net>
Date:   Thu Feb 21 11:17:01 2019 +0100

    backend: Add error message when file is encrypted

 src/backend/bacon-video-widget.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
---
diff --git a/src/backend/bacon-video-widget.c b/src/backend/bacon-video-widget.c
index b321f20a4..d61d99190 100644
--- a/src/backend/bacon-video-widget.c
+++ b/src/backend/bacon-video-widget.c
@@ -3859,7 +3859,6 @@ bvw_error_from_gst_error (BaconVideoWidget *bvw, GstMessage * err_msg)
   /* FIXME:
    * Unemitted errors:
    * BVW_ERROR_DVD_ENCRYPTED
-   * BVW_ERROR_FILE_ENCRYPTED
    * BVW_ERROR_EMPTY_FILE
    * BVW_ERROR_BROKEN_FILE
    */
@@ -3929,6 +3928,12 @@ bvw_error_from_gst_error (BaconVideoWidget *bvw, GstMessage * err_msg)
     goto done;
   }
 
+  if (is_error (e, STREAM, DECRYPT)) {
+    ret = g_error_new_literal (BVW_ERROR, BVW_ERROR_FILE_ENCRYPTED,
+                              _("This file is encrypted and cannot be played back."));
+    goto done;
+  }
+
   if (e->domain == GST_RESOURCE_ERROR) {
     ret = g_error_new_literal (BVW_ERROR, BVW_ERROR_FILE_GENERIC,
                                e->message);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]