check whether info entity returned by mpd is NULL or not
This commit is contained in:
@@ -376,6 +376,8 @@ Song MPDConnection::GetCurrentSong() const
|
|||||||
mpd_sendCurrentSongCommand(itsConnection);
|
mpd_sendCurrentSongCommand(itsConnection);
|
||||||
mpd_InfoEntity *item = NULL;
|
mpd_InfoEntity *item = NULL;
|
||||||
item = mpd_getNextInfoEntity(itsConnection);
|
item = mpd_getNextInfoEntity(itsConnection);
|
||||||
|
if (item)
|
||||||
|
{
|
||||||
Song result = item->info.song;
|
Song result = item->info.song;
|
||||||
item->info.song = 0;
|
item->info.song = 0;
|
||||||
mpd_freeInfoEntity(item);
|
mpd_freeInfoEntity(item);
|
||||||
@@ -385,6 +387,9 @@ Song MPDConnection::GetCurrentSong() const
|
|||||||
else
|
else
|
||||||
return Song();
|
return Song();
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
return Song();
|
||||||
|
}
|
||||||
|
|
||||||
void MPDConnection::GetPlaylistContent(const string &path, SongList &v) const
|
void MPDConnection::GetPlaylistContent(const string &path, SongList &v) const
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -103,7 +103,6 @@ time_t timer;
|
|||||||
|
|
||||||
int now_playing = -1;
|
int now_playing = -1;
|
||||||
int browsed_dir_scroll_begin = 0;
|
int browsed_dir_scroll_begin = 0;
|
||||||
int stats_scroll_begin = 0;
|
|
||||||
|
|
||||||
int lock_statusbar_delay = -1;
|
int lock_statusbar_delay = -1;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user