bool CAutorun::PlayDisc(const CStdString& path, bool bypassSettings, bool startFromBeginning)
{
- if ( !bypassSettings && !CSettings::Get().GetInt("audiocds.autoaction") == AUTOCD_PLAY && !CSettings::Get().GetBool("dvds.autorun"))
+ if ( !bypassSettings && CSettings::Get().GetInt("audiocds.autoaction") != AUTOCD_PLAY && !CSettings::Get().GetBool("dvds.autorun"))
return false;
int nSize = g_playlistPlayer.GetPlaylist( PLAYLIST_MUSIC ).size();
CStdString path = URIUtils::AddFileToFolder(pItem->GetPath(), "VIDEO_TS.IFO");
if(!CFile::Exists(path))
path = URIUtils::AddFileToFolder(pItem->GetPath(), "video_ts.ifo");
- CFileItem item(path, false);
- item.SetLabel(g_mediaManager.GetDiskLabel(strDrive));
- item.GetVideoInfoTag()->m_strFileNameAndPath = g_mediaManager.GetDiskUniqueId(strDrive);
+ CFileItemPtr item(new CFileItem(path, false));
+ item->SetLabel(g_mediaManager.GetDiskLabel(strDrive));
+ item->GetVideoInfoTag()->m_strFileNameAndPath = g_mediaManager.GetDiskUniqueId(strDrive);
- if (!startFromBeginning && !item.GetVideoInfoTag()->m_strFileNameAndPath.empty())
- item.m_lStartOffset = STARTOFFSET_RESUME;
+ if (!startFromBeginning && !item->GetVideoInfoTag()->m_strFileNameAndPath.empty())
+ item->m_lStartOffset = STARTOFFSET_RESUME;
- g_application.PlayFile(item, false);
+ g_playlistPlayer.ClearPlaylist(PLAYLIST_VIDEO);
+ g_playlistPlayer.SetShuffle (PLAYLIST_VIDEO, false);
+ g_playlistPlayer.Add(PLAYLIST_VIDEO, item);
+ g_playlistPlayer.SetCurrentPlaylist(PLAYLIST_VIDEO);
+ g_playlistPlayer.Play(0);
return true;
}
if (name.Equals("BDMV") && bAllowVideo
&& (bypassSettings || CSettings::Get().GetBool("dvds.autorun")))
{
- CFileItem item(URIUtils::AddFileToFolder(pItem->GetPath(), "index.bdmv"), false);
- item.SetLabel(g_mediaManager.GetDiskLabel(strDrive));
- item.GetVideoInfoTag()->m_strFileNameAndPath = g_mediaManager.GetDiskUniqueId(strDrive);
+ CFileItemPtr item(new CFileItem(URIUtils::AddFileToFolder(pItem->GetPath(), "index.bdmv"), false));
+ item->SetLabel(g_mediaManager.GetDiskLabel(strDrive));
+ item->GetVideoInfoTag()->m_strFileNameAndPath = g_mediaManager.GetDiskUniqueId(strDrive);
- if (!startFromBeginning && !item.GetVideoInfoTag()->m_strFileNameAndPath.empty())
- item.m_lStartOffset = STARTOFFSET_RESUME;
+ if (!startFromBeginning && !item->GetVideoInfoTag()->m_strFileNameAndPath.empty())
+ item->m_lStartOffset = STARTOFFSET_RESUME;
- g_application.PlayFile(item, false);
+ g_playlistPlayer.ClearPlaylist(PLAYLIST_VIDEO);
+ g_playlistPlayer.SetShuffle (PLAYLIST_VIDEO, false);
+ g_playlistPlayer.Add(PLAYLIST_VIDEO, item);
+ g_playlistPlayer.SetCurrentPlaylist(PLAYLIST_VIDEO);
+ g_playlistPlayer.Play(0);
return true;
}