changeset 3180:384cb84c968f trunk

Gracefully handle playback being NULL even if playback_get_playing() is TRUE during playback init.
author Christian Birchinger <joker@netswarm.net>
date Fri, 27 Jul 2007 03:16:09 +0200
parents d2eae001e562
children 06d89ea93859 bcf611cf5ae2 f08ce8cf0c7f 62d5f7a24983
files src/audacious/playback.c
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/audacious/playback.c	Fri Jul 27 00:31:46 2007 +0200
+++ b/src/audacious/playback.c	Fri Jul 27 03:16:09 2007 +0200
@@ -78,8 +78,9 @@
     InputPlayback *playback;
     g_return_val_if_fail(playback_get_playing(), -1);
     playback = get_current_input_playback();
-    g_return_val_if_fail(playback, -1);
 
+    if (!playback) /* playback can be NULL during init even if playing is TRUE */              
+        return -1;
     if (playback->plugin->get_time)
         return playback->plugin->get_time(playback);
     if (playback->error)