From c204bf2c6bbf88d9b582895c488f75b1fbc4d5ea Mon Sep 17 00:00:00 2001 From: phintuka Date: Sun, 19 Dec 2010 14:38:37 +0000 Subject: File browser: Use cPlaylist when launching image player --- menu.c | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/menu.c b/menu.c index d0da488a..45158ed4 100644 --- a/menu.c +++ b/menu.c @@ -4,7 +4,7 @@ * See the main source file 'xineliboutput.c' for copyright information and * how to reach the author. * - * $Id: menu.c,v 1.81 2010-12-09 13:14:55 phintuka Exp $ + * $Id: menu.c,v 1.82 2010-12-19 14:38:37 phintuka Exp $ * */ @@ -360,18 +360,14 @@ eOSState cMenuBrowseFiles::Open(bool ForceOpen, bool Queue, bool Rewind) return osContinue; } else { /* image */ - char **files = new char*[Count()+1]; - int i = 0, index = 0; - memset(files, 0, sizeof(char*)*(Count()+1)); + cPlaylist *Playlist = new cPlaylist(); for (cFileListItem *it = (cFileListItem*)First(); it; it=(cFileListItem*)Next(it)) { - if (it == Get(Current())) - index = i; if (!it->IsDir()) - if (asprintf(&files[i++], "%s/%s", m_CurrentDir, it->Name()) < 0) - i--; + Playlist->Read(cString::sprintf("%s/%s", *m_CurrentDir, it->Name())); + if (it == Get(Current())) + Playlist->SetCurrent(Playlist->Last()); } - cControl::Shutdown(); - cControl::Launch(new cXinelibImagesControl(files, index, i)); + cPlayerFactory::Launch(pmVideoOnly, Playlist, true); } return osEnd; } -- cgit v1.2.3