From 6ce432d5b6faffcb2c78e6b9596ac1a0e85adba4 Mon Sep 17 00:00:00 2001 From: Bastien Nocera Date: Thu, 21 Feb 2019 11:20:12 +0100 Subject: backend: Add error message when file is empty --- src/backend/bacon-video-widget.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/backend/bacon-video-widget.c b/src/backend/bacon-video-widget.c index d61d99190..480e07b13 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_EMPTY_FILE * BVW_ERROR_BROKEN_FILE */ @@ -3934,6 +3933,12 @@ bvw_error_from_gst_error (BaconVideoWidget *bvw, GstMessage * err_msg) goto done; } + if (is_error (e, STREAM, TYPE_NOT_FOUND)) { + ret = g_error_new_literal (BVW_ERROR, BVW_ERROR_EMPTY_FILE, + _("The file you tried to play is an empty file.")); + goto done; + } + if (e->domain == GST_RESOURCE_ERROR) { ret = g_error_new_literal (BVW_ERROR, BVW_ERROR_FILE_GENERIC, e->message); -- cgit v1.2.1