diff --git a/mpd_client.c b/mpd_client.c index cb9f5b6..f252fca 100644 --- a/mpd_client.c +++ b/mpd_client.c @@ -74,6 +74,8 @@ void mpdStop( struct mpd_connection *mpd_connection ) { } enum mpd_state mpdStatus( struct mpd_connection *mpd_connection ) { + if( mpd_connection == NULL ) + return -1; struct mpd_status *status = mpd_run_status( mpd_connection ); if ( status == NULL ) return -1; @@ -84,7 +86,7 @@ enum mpd_state mpdStatus( struct mpd_connection *mpd_connection ) { bool mpdRunning( struct mpd_connection *mpd_connection ) { enum mpd_state state = mpdStatus( mpd_connection ); - return state != MPD_STATE_STOP && state != MPD_STATE_UNKNOWN; + return state == MPD_STATE_PAUSE || state == MPD_STATE_PLAY; } bool mpdPlaying( struct mpd_connection *mpd_connection ) {