[totem/wip/hadess/bvw-template: 1/6] backend: Show errors instantiating video widget in test app




commit 29ef3f853a479ab74faa9381720bb1121fbaf02f
Author: Bastien Nocera <hadess hadess net>
Date:   Wed Feb 9 10:34:01 2022 +0100

    backend: Show errors instantiating video widget in test app

 src/backend/bvw-test.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
---
diff --git a/src/backend/bvw-test.c b/src/backend/bvw-test.c
index 3cc36289a..51aded89e 100644
--- a/src/backend/bvw-test.c
+++ b/src/backend/bvw-test.c
@@ -74,7 +74,7 @@ int main
 {
        GOptionContext *context;
        GOptionGroup *baconoptiongroup;
-       GError *error = NULL;
+       g_autoptr(GError) error = NULL;
        GtkWidget *win, *bvw;
        GtkSettings *gtk_settings;
 
@@ -91,7 +91,6 @@ int main
 
        if (g_option_context_parse (context, &argc, &argv, &error) == FALSE) {
                g_print ("Failed to parse options: %s\n", error->message);
-               g_error_free (error);
                return 1;
        }
        if (filenames != NULL &&
@@ -110,7 +109,11 @@ int main
        g_signal_connect (G_OBJECT (win), "destroy",
                        G_CALLBACK (gtk_main_quit), NULL);
 
-       bvw = bacon_video_widget_new (NULL);
+       bvw = bacon_video_widget_new (&error);
+       if (!bvw) {
+               g_warning ("Failed to instantiate video widget: %s", error->message);
+               return 1;
+       }
 
        g_signal_connect (G_OBJECT (bvw), "eos", G_CALLBACK (on_eos_event), NULL);
        g_signal_connect (G_OBJECT (bvw), "got-metadata", G_CALLBACK (on_got_metadata), NULL);


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