diff --git a/src/apps/mediaplayer/playlist/Playlist.cpp b/src/apps/mediaplayer/playlist/Playlist.cpp index 2201541dbd..a28bcaa911 100644 --- a/src/apps/mediaplayer/playlist/Playlist.cpp +++ b/src/apps/mediaplayer/playlist/Playlist.cpp @@ -463,22 +463,25 @@ Playlist::AppendToPlaylistRecursive(const entry_ref& ref, Playlist* playlist) { // recursively append the ref (dive into folders) BEntry entry(&ref, true); - if (entry.InitCheck() < B_OK || !entry.Exists()) + if (entry.InitCheck() != B_OK || !entry.Exists()) return; if (entry.IsDirectory()) { BDirectory dir(&entry); - if (dir.InitCheck() < B_OK) + if (dir.InitCheck() != B_OK) return; + entry.Unset(); + entry_ref subRef; - while (dir.GetNextRef(&subRef) == B_OK) + while (dir.GetNextRef(&subRef) == B_OK) { AppendToPlaylistRecursive(subRef, playlist); + } } else if (entry.IsFile()) { BString mimeString = _MIMEString(&ref); if (_IsMediaFile(mimeString)) { PlaylistItem* item = new (std::nothrow) FilePlaylistItem(ref); - if (item == NULL || !playlist->AddItem(item)) + if (item != NULL && !playlist->AddItem(item)) delete item; } else printf("MIME Type = %s\n", mimeString.String()); @@ -490,7 +493,7 @@ Playlist::AppendToPlaylistRecursive(const entry_ref& ref, Playlist* playlist) Playlist::AppendPlaylistToPlaylist(const entry_ref& ref, Playlist* playlist) { BEntry entry(&ref, true); - if (entry.InitCheck() < B_OK || !entry.Exists()) + if (entry.InitCheck() != B_OK || !entry.Exists()) return; BString mimeString = _MIMEString(&ref); diff --git a/src/apps/mediaplayer/playlist/Playlist.h b/src/apps/mediaplayer/playlist/Playlist.h index 204b6a0c4d..0cd3dfa17d 100644 --- a/src/apps/mediaplayer/playlist/Playlist.h +++ b/src/apps/mediaplayer/playlist/Playlist.h @@ -97,6 +97,10 @@ public: Playlist* playlist); private: + Playlist(const Playlist& other); + Playlist& operator=(const Playlist& other); + // unimplemented + static bool _IsMediaFile(const BString& mimeString); static bool _IsTextPlaylist(const BString& mimeString); static bool _IsBinaryPlaylist(const BString& mimeString);