comparison src/audacious/playback.c @ 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
comparison
equal deleted inserted replaced
3179:d2eae001e562 3180:384cb84c968f
76 playback_get_time(void) 76 playback_get_time(void)
77 { 77 {
78 InputPlayback *playback; 78 InputPlayback *playback;
79 g_return_val_if_fail(playback_get_playing(), -1); 79 g_return_val_if_fail(playback_get_playing(), -1);
80 playback = get_current_input_playback(); 80 playback = get_current_input_playback();
81 g_return_val_if_fail(playback, -1); 81
82 82 if (!playback) /* playback can be NULL during init even if playing is TRUE */
83 return -1;
83 if (playback->plugin->get_time) 84 if (playback->plugin->get_time)
84 return playback->plugin->get_time(playback); 85 return playback->plugin->get_time(playback);
85 if (playback->error) 86 if (playback->error)
86 return -2; 87 return -2;
87 if (!playback->playing || 88 if (!playback->playing ||