[retro-gtk] pa-player: Check and log errors from pa_simple_new



commit 738f4d6e1ac090e6d744a39be426ce069bc3716f
Author: Adrien Plazas <kekun plazas laposte net>
Date:   Wed Nov 8 08:18:12 2017 +0100

    pa-player: Check and log errors from pa_simple_new

 retro-gtk/retro-pa-player.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/retro-gtk/retro-pa-player.c b/retro-gtk/retro-pa-player.c
index 2a6239f..14055bd 100644
--- a/retro-gtk/retro-pa-player.c
+++ b/retro-gtk/retro-pa-player.c
@@ -51,6 +51,7 @@ retro_pa_player_prepare_for_sample_rate (RetroPaPlayer *self,
                                          gdouble        sample_rate)
 {
   pa_sample_spec sample_spec = {0};
+  gint error;
 
   g_return_if_fail (RETRO_IS_PA_PLAYER (self));
 
@@ -65,7 +66,10 @@ retro_pa_player_prepare_for_sample_rate (RetroPaPlayer *self,
     pa_simple_free (self->simple);
 
   self->simple = pa_simple_new (NULL, NULL, PA_STREAM_PLAYBACK, NULL, "",
-                                &sample_spec, NULL, NULL, NULL);
+                                &sample_spec, NULL, NULL, &error);
+  if (!self->simple) {
+      g_critical ("pa_simple_new() failed: %s", pa_strerror(error));
+  }
 }
 
 static void


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