From: <ar...@us...> - 2011-01-31 10:16:26
|
Revision: 30804 http://xbmc4xbox.svn.sourceforge.net/xbmc4xbox/?rev=30804&view=rev Author: arnova Date: 2011-01-31 10:16:19 +0000 (Mon, 31 Jan 2011) Log Message: ----------- removed: libshout and replaced with curl-only code like on mainline xbmc (mainline xbmc/trunk revisions 11040,35468,35469,35483) Modified Paths: -------------- trunk/xbmc/Application.cpp trunk/xbmc/FileSystem/File.cpp trunk/xbmc/FileSystem/FileCurl.cpp trunk/xbmc/FileSystem/FileCurl.h trunk/xbmc/FileSystem/FileShoutcast.cpp trunk/xbmc/FileSystem/FileShoutcast.h trunk/xbmc/FileSystem/IFile.h trunk/xbmc/cores/mplayer/MPlayer.h trunk/xbmc/cores/mplayer/mplayer.cpp trunk/xbmc/cores/paplayer/PAPlayer.h trunk/xbmc/cores/paplayer/PAPlayer_win32.cpp trunk/xbmc/cores/paplayer/PAPlayer_xbox.cpp trunk/xbmc/utils/HttpHeader.cpp trunk/xbmc/utils/HttpHeader.h trunk/xbmc.vcproj Removed Paths: ------------- trunk/xbmc/lib/libshout/ Modified: trunk/xbmc/Application.cpp =================================================================== --- trunk/xbmc/Application.cpp 2011-01-31 02:27:13 UTC (rev 30803) +++ trunk/xbmc/Application.cpp 2011-01-31 10:16:19 UTC (rev 30804) @@ -251,7 +251,6 @@ #pragma comment (lib,"xbmc/lib/libGoAhead/goahead.lib") #pragma comment (lib,"xbmc/lib/sqLite/libSQLite3.lib") #pragma comment (lib,"xbmc/lib/libcdio/libcdio.lib") - #pragma comment (lib,"xbmc/lib/libshout/libshout.lib") #pragma comment (lib,"xbmc/lib/libiconv/libiconv.lib") #pragma comment (lib,"xbmc/lib/libfribidi/libfribidi.lib") #pragma comment (lib,"xbmc/lib/libpcre/libpcre.lib") Modified: trunk/xbmc/FileSystem/File.cpp =================================================================== --- trunk/xbmc/FileSystem/File.cpp 2011-01-31 02:27:13 UTC (rev 30803) +++ trunk/xbmc/FileSystem/File.cpp 2011-01-31 10:16:19 UTC (rev 30804) @@ -313,9 +313,37 @@ if (!m_pFile) return false; - if (!m_pFile->Open(url)) + try { + if (!m_pFile->Open(url)) + { + SAFE_DELETE(m_pFile); + return false; + } + } + catch (CRedirectException *pRedirectEx) + { + // the file implementation decided this item should use a different implementation. + // the exception will contain the new implementation. + + CLog::Log(LOGDEBUG,"File::Open - redirecting implementation for %s", strFileName.c_str()); SAFE_DELETE(m_pFile); + if (pRedirectEx && pRedirectEx->m_pNewFileImp) + { + m_pFile = pRedirectEx->m_pNewFileImp; + delete pRedirectEx; + + if (!m_pFile->Open(url)) + { + SAFE_DELETE(m_pFile); + return false; + } + } + } + catch (...) + { + CLog::Log(LOGERROR, "File::Open - unknown exception when opening %s", strFileName.c_str()); + SAFE_DELETE(m_pFile); return false; } @@ -380,7 +408,8 @@ { try { - if (strFileName.IsEmpty()) return false; + if (strFileName.IsEmpty()) + return false; if (bUseCache) { @@ -394,7 +423,8 @@ CURL url(strFileName); auto_ptr<IFile> pFile(CFileFactory::CreateLoader(url)); - if (!pFile.get()) return false; + if (!pFile.get()) + return false; return pFile->Exists(url); } @@ -424,7 +454,8 @@ CURL url(strFileName); auto_ptr<IFile> pFile(CFileFactory::CreateLoader(url)); - if (!pFile.get()) return false; + if (!pFile.get()) + return false; return pFile->Stat(url, buffer); } @@ -510,10 +541,7 @@ { try { - if (m_pBuffer) SAFE_DELETE(m_pBuffer); - - if (m_pFile) SAFE_DELETE(m_pFile); } #ifndef _LINUX @@ -533,7 +561,8 @@ { try { - if (m_pFile) m_pFile->Flush(); + if (m_pFile) + m_pFile->Flush(); } #ifndef _LINUX catch (const win32_exception &e) @@ -600,7 +629,8 @@ { try { - if (m_pFile) return m_pFile->GetLength(); + if (m_pFile) + return m_pFile->GetLength(); return 0; } #ifndef _LINUX @@ -735,7 +765,8 @@ CURL url(strFileName); auto_ptr<IFile> pFile(CFileFactory::CreateLoader(url)); - if (!pFile.get()) return false; + if (!pFile.get()) + return false; if(pFile->Delete(url)) { @@ -770,7 +801,8 @@ CURL urlnew(strNewFileName); auto_ptr<IFile> pFile(CFileFactory::CreateLoader(url)); - if (!pFile.get()) return false; + if (!pFile.get()) + return false; if(pFile->Rename(url, urlnew)) { @@ -808,7 +840,8 @@ , m_buffer(NULL) , m_backsize(backsize) , m_frontsize(0) -{} +{ +} void CFileStreamBuffer::Attach(IFile *file) { Modified: trunk/xbmc/FileSystem/FileCurl.cpp =================================================================== --- trunk/xbmc/FileSystem/FileCurl.cpp 2011-01-31 02:27:13 UTC (rev 30803) +++ trunk/xbmc/FileSystem/FileCurl.cpp 2011-01-31 10:16:19 UTC (rev 30804) @@ -34,6 +34,7 @@ #include <climits> #include "DllLibCurl.h" +#include "FileShoutcast.h" #include "SpecialProtocol.h" using namespace std; @@ -319,6 +320,7 @@ m_password = ""; m_httpauth = ""; m_state = new CReadState(); + m_skipshout = false; } //Has to be called before Open() @@ -693,12 +695,16 @@ if(m_httpauth.IsEmpty()) m_httpauth = "any"; } + else if (name.Equals("Referer")) + SetReferer(value); else if (name.Equals("User-Agent")) SetUserAgent(value); else if (name.Equals("Cookie")) SetCookie(value); else if (name.Equals("Encoding")) SetContentEncoding(value); + else if (name.Equals("noshout") && value.Equals("true")) + m_skipshout = true; else SetRequestHeader(name, value); } @@ -831,13 +837,22 @@ SetCorrectHeaders(m_state); - // since we can't know the stream size up front if we're gzipped/deflated // flag the stream with an unknown file size rather than the compressed // file size. if (m_contentencoding.size() > 0) m_state->m_fileSize = 0; + // check if this stream is a shoutcast stream. sometimes checking the protocol line is not enough so examine other headers as well. + // shoutcast streams should be handled by FileShoutcast. + if ((m_state->m_httpheader.GetProtoLine().Left(3) == "ICY" || !m_state->m_httpheader.GetValue("icy-notice1").IsEmpty() + || !m_state->m_httpheader.GetValue("icy-name").IsEmpty() + || !m_state->m_httpheader.GetValue("icy-br").IsEmpty()) && !m_skipshout) + { + CLog::Log(LOGDEBUG,"FileCurl - file <%s> is a shoutcast stream. re-opening", m_url.c_str()); + throw new CRedirectException(new CFileShoutcast); + } + m_multisession = false; if(m_url.Left(5).Equals("http:") || m_url.Left(6).Equals("https:")) { Modified: trunk/xbmc/FileSystem/FileCurl.h =================================================================== --- trunk/xbmc/FileSystem/FileCurl.h 2011-01-31 02:27:13 UTC (rev 30803) +++ trunk/xbmc/FileSystem/FileCurl.h 2011-01-31 10:16:19 UTC (rev 30804) @@ -44,8 +44,8 @@ virtual bool Open(const CURL& url); virtual bool Exists(const CURL& url); virtual __int64 Seek(__int64 iFilePosition, int iWhence=SEEK_SET); - virtual __int64 GetPosition(); - virtual __int64 GetLength(); + virtual __int64 GetPosition(); + virtual __int64 GetLength(); virtual int Stat(const CURL& url, struct __stat64* buffer); virtual void Close(); virtual bool ReadString(char *szLine, int iLineLength) { return m_state->ReadString(szLine, iLineLength); } @@ -152,6 +152,7 @@ bool m_useOldHttpVersion; bool m_seekable; bool m_multisession; + bool m_skipshout; struct XCURL::curl_slist* m_curlAliasList; struct XCURL::curl_slist* m_curlHeaderList; Modified: trunk/xbmc/FileSystem/FileShoutcast.cpp =================================================================== --- trunk/xbmc/FileSystem/FileShoutcast.cpp 2011-01-31 02:27:13 UTC (rev 30803) +++ trunk/xbmc/FileSystem/FileShoutcast.cpp 2011-01-31 10:16:19 UTC (rev 30804) @@ -30,154 +30,32 @@ #include "GUIDialogProgress.h" #include "GUIWindowManager.h" #include "URL.h" -#include "LocalizeStrings.h" ////////////////////////////////////////////////////////////////////// // Construction/Destruction ////////////////////////////////////////////////////////////////////// -/* needed for the shoutcast headers */ -#if defined(_XBOX) && !defined(WIN32) -#define WIN32 1 -#endif - -#include "lib/libshout/types.h" -#include "lib/libshout/rip_manager.h" -#include "lib/libshout/util.h" -#include "lib/libshout/filelib.h" -#include "RingBuffer.h" -#include "ShoutcastRipFile.h" #include "utils/GUIInfoManager.h" using namespace MUSIC_INFO; using namespace XFILE; -const int SHOUTCASTTIMEOUT = 60; -static CRingBuffer m_ringbuf; - -static FileState m_fileState; -static CShoutcastRipFile m_ripFile; - - -static RIP_MANAGER_INFO m_ripInfo; -static ERROR_INFO m_errorInfo; - - - -void rip_callback(int message, void *data) -{ - switch (message) - { - RIP_MANAGER_INFO *info; - case RM_UPDATE: - info = (RIP_MANAGER_INFO*)data; - memcpy(&m_ripInfo, info, sizeof(m_ripInfo)); - if (info->status == RM_STATUS_BUFFERING) - { - m_fileState.bBuffering = true; - } - else if ( info->status == RM_STATUS_RIPPING) - { - m_ripFile.SetRipManagerInfo( &m_ripInfo ); - m_fileState.bBuffering = false; - } - else if (info->status == RM_STATUS_RECONNECTING) - {} - break; - case RM_ERROR: - ERROR_INFO *errInfo; - errInfo = (ERROR_INFO*)data; - memcpy(&m_errorInfo, errInfo, sizeof(m_errorInfo)); - m_fileState.bRipError = true; - OutputDebugString("error\n"); - break; - case RM_DONE: - OutputDebugString("done\n"); - m_fileState.bRipDone = true; - break; - case RM_NEW_TRACK: - char *trackName; - trackName = (char*) data; - m_ripFile.SetTrackname( trackName ); - break; - case RM_STARTED: - m_fileState.bRipStarted = true; - OutputDebugString("Started\n"); - break; - } - -} - -error_code filelib_write(char *buf, u_long size) -{ - if ((int)size > m_ringbuf.Size()) - { - CLog::Log(LOGERROR, "Shoutcast chunk too big: %lu", size); - return SR_ERROR_BUFFER_FULL; - } - while (m_ringbuf.GetMaxWriteSize() < (int)size) Sleep(10); - m_ringbuf.WriteBinary(buf, size); - m_ripFile.Write( buf, size ); //will only write, if it has to - return SR_SUCCESS; -} -CFileShoutcast* m_pShoutCastRipper = NULL; - CFileShoutcast::CFileShoutcast() { - // FIXME: without this check - // the playback stops when CFile::Stat() - // or CFile::Exists() is called - - // Do we already have another file - // using the ripper? - if (!m_pShoutCastRipper) - { - m_fileState.bBuffering = true; - m_fileState.bRipDone = false; - m_fileState.bRipStarted = false; - m_fileState.bRipError = false; - m_ringbuf.Create(1024*256); - m_pShoutCastRipper = this; - } + m_lastTime = timeGetTime(); + m_discarded = 0; + m_currint = 0; + m_buffer = NULL; } CFileShoutcast::~CFileShoutcast() { - // FIXME: without this check - // the playback stops when CFile::Stat() - // or CFile::Exists() is called - - // Has this object initialized the ripper? - if (m_pShoutCastRipper==this) - { - rip_manager_stop(); - m_pShoutCastRipper = NULL; - m_ripFile.Reset(); - m_ringbuf.Destroy(); - } + Close(); } -bool CFileShoutcast::CanRecord() -{ - if ( !m_fileState.bRipStarted ) - return false; - return m_ripFile.CanRecord(); -} - -bool CFileShoutcast::Record() -{ - return m_ripFile.Record(); -} - -void CFileShoutcast::StopRecording() -{ - m_ripFile.StopRecording(); -} - - __int64 CFileShoutcast::GetPosition() { - return 0; + return m_file.GetPosition()-m_discarded; } __int64 CFileShoutcast::GetLength() @@ -185,188 +63,53 @@ return 0; } - bool CFileShoutcast::Open(const CURL& url) { - m_dwLastTime = timeGetTime(); - int ret; - RIP_MANAGER_OPTIONS m_opt; - m_opt.relay_port = 8000; - m_opt.max_port = 18000; - m_opt.flags = OPT_AUTO_RECONNECT | - OPT_SEPERATE_DIRS | - OPT_SEARCH_PORTS | - OPT_ADD_ID3; + CURL url2(url); + url2.SetProtocolOptions("noshout=true&Icy-MetaData=1"); + url2.SetProtocol("http"); - // No progress dialog for now as it may deadlock when DVDplayer is used - CGUIDialogProgress* dlgProgress = NULL; - //CGUIDialogProgress* dlgProgress = (CGUIDialogProgress*)g_windowManager.GetWindow(WINDOW_DIALOG_PROGRESS); - - strcpy(m_opt.output_directory, "./"); - m_opt.proxyurl[0] = '\0'; - - // Use a proxy, if the GUI was configured as such - bool bProxyEnabled = g_guiSettings.GetBool("network.usehttpproxy"); - if (bProxyEnabled) + bool result=false; + if ((result=m_file.Open(url2.Get()))) { - const CStdString &strProxyServer = g_guiSettings.GetString("network.httpproxyserver"); - const CStdString &strProxyPort = g_guiSettings.GetString("network.httpproxyport"); - // Should we check for valid strings here - _snprintf( m_opt.proxyurl, MAX_URL_LEN, "http://%s:%s", strProxyServer.c_str(), strProxyPort.c_str() ); + m_tag.SetTitle(m_file.GetHttpHeader().GetValue("icy-name")); + if (m_tag.GetTitle().IsEmpty()) + m_tag.SetTitle(m_file.GetHttpHeader().GetValue("ice-name")); // icecast + m_tag.SetGenre(m_file.GetHttpHeader().GetValue("icy-genre")); + if (m_tag.GetGenre().IsEmpty()) + m_tag.SetGenre(m_file.GetHttpHeader().GetValue("ice-genre")); // icecast + m_tag.SetLoaded(true); + g_infoManager.SetCurrentSongTag(m_tag); } + m_metaint = atoi(m_file.GetHttpHeader().GetValue("icy-metaint").c_str()); + m_buffer = new char[16*255]; - CStdString strUrl = url.Get(); - strUrl.Replace("shout://", "http://"); - strncpy(m_opt.url, strUrl.c_str(), MAX_URL_LEN); - sprintf(m_opt.useragent, "x%s", url.GetFileName().c_str()); - if (dlgProgress) - { - dlgProgress->SetHeading(260); - dlgProgress->SetLine(0, 259); - dlgProgress->SetLine(1, strUrl); - dlgProgress->SetLine(2, ""); - if (!dlgProgress->IsDialogRunning()) - dlgProgress->StartModal(); - dlgProgress->Progress(); - } - - if ((ret = rip_manager_start(rip_callback, &m_opt)) != SR_SUCCESS) - { - if (dlgProgress) dlgProgress->Close(); - return false; - } - int iShoutcastTimeout = 10 * SHOUTCASTTIMEOUT; //i.e: 10 * 10 = 100 * 100ms = 10s - int iCount = 0; - while (!m_fileState.bRipDone && !m_fileState.bRipStarted && !m_fileState.bRipError) - { - if (iCount <= iShoutcastTimeout) //Normally, this isn't the problem, - //because if RIP_MANAGER fails, this would be here - //with m_fileState.bRipError - { - Sleep(100); - } - else - { - if (dlgProgress) - { - dlgProgress->SetLine(1, 257); - dlgProgress->SetLine(2, "Connection timed out..."); - Sleep(1500); - dlgProgress->Close(); - } - return false; - } - iCount++; - } - - /* store content type of stream */ - m_mimetype = m_ripInfo.contenttype; - - //CHANGED CODE: Don't reset timer anymore. - - while (!m_fileState.bRipDone && !m_fileState.bRipError && m_fileState.bBuffering) - { - if (iCount <= iShoutcastTimeout) //Here is the real problem: Sometimes the buffer fills just to - //slowly, thus the quality of the stream will be bad, and should be - //aborted... - { - Sleep(100); - char szTmp[1024]; - //g_dialog.SetCaption(0, "Shoutcast" ); - sprintf(szTmp, g_localizeStrings.Get(23052).c_str(), m_ringbuf.GetMaxReadSize()); - if (dlgProgress) - { - dlgProgress->SetLine(2, szTmp ); - dlgProgress->Progress(); - } - - sprintf(szTmp, "%s", m_ripInfo.filename); - for (int i = 0; i < (int)strlen(szTmp); i++) - szTmp[i] = tolower((unsigned char)szTmp[i]); - szTmp[50] = 0; - if (dlgProgress) - { - dlgProgress->SetLine(1, szTmp ); - dlgProgress->Progress(); - } - } - else //it's not really a connection timeout, but it's here, - //where things get boring, if connection is slow. - //trust me, i did a lot of testing... Doesn't happen often, - //but if it does it sucks to wait here forever. - //CHANGED: Other message here - { - if (dlgProgress) - { - dlgProgress->SetLine(1, 257); - dlgProgress->SetLine(2, "Connection to server too slow..."); - dlgProgress->Close(); - } - return false; - } - iCount++; - } - if ( m_fileState.bRipError ) - { - if (dlgProgress) - { - dlgProgress->SetLine(1, 257); - dlgProgress->SetLine(2, 16029); - CLog::Log(LOGERROR, "%s: error - %s", __FUNCTION__, m_errorInfo.error_str); - dlgProgress->Progress(); - - Sleep(1500); - dlgProgress->Close(); - } - return false; - } - if (dlgProgress) - { - dlgProgress->SetLine(2, 261); - dlgProgress->Progress(); - dlgProgress->Close(); - } - return true; + return result; } unsigned int CFileShoutcast::Read(void* lpBuf, __int64 uiBufSize) { - if (m_fileState.bRipDone) + if (m_currint >= m_metaint && m_metaint > 0) { - OutputDebugString("Read done\n"); - return 0; + unsigned char header; + m_file.Read(&header,1); + ReadTruncated(m_buffer, header*16); + ExtractTagInfo(m_buffer); + m_discarded += header*16+1; + m_currint = 0; } - - int slept=0; - while (m_ringbuf.GetMaxReadSize() <= 0) + if (timeGetTime() - m_lastTime > 500) { - Sleep(10); - if (slept += 10 > SHOUTCASTTIMEOUT*1000) - return -1; + m_lastTime = timeGetTime(); + g_infoManager.SetCurrentSongTag(m_tag); } - int iRead = m_ringbuf.GetMaxReadSize(); - if (iRead > uiBufSize) iRead = (int)uiBufSize; - m_ringbuf.ReadBinary((char*)lpBuf, iRead); - - if (timeGetTime() - m_dwLastTime > 500) - { - m_dwLastTime = timeGetTime(); - CMusicInfoTag tag; - GetMusicInfoTag(tag); - g_infoManager.SetCurrentSongTag(tag); - } - return iRead; + unsigned int toRead = std::min((unsigned int)uiBufSize,(unsigned int)m_metaint-m_currint); + toRead = m_file.Read(lpBuf,toRead); + m_currint += toRead; + return toRead; } -void CFileShoutcast::outputTimeoutMessage(const char* message) -{ - //g_dialog.SetCaption(0, "Shoutcast" ); - //g_dialog.SetMessage(0, message ); - //g_dialog.Render(); - Sleep(1500); -} - __int64 CFileShoutcast::Seek(__int64 iFilePosition, int iWhence) { return -1; @@ -374,29 +117,25 @@ void CFileShoutcast::Close() { - OutputDebugString("Shoutcast Stopping\n"); - if ( m_ripFile.IsRecording() ) - m_ripFile.StopRecording(); - m_ringbuf.Clear(); - rip_manager_stop(); - m_ripFile.Reset(); - OutputDebugString("Shoutcast Stopped\n"); + delete[] m_buffer; + m_file.Close(); } -bool CFileShoutcast::IsRecording() +void CFileShoutcast::ExtractTagInfo(const char* buf) { - return m_ripFile.IsRecording(); + char temp[1024]; + if (sscanf(buf,"StreamTitle='%[^']",temp) > 0) + m_tag.SetTitle(temp); } - - -bool CFileShoutcast::GetMusicInfoTag(CMusicInfoTag& tag) +void CFileShoutcast::ReadTruncated(char* buf2, int size) { - m_ripFile.GetMusicInfoTag(tag); - return true; + char* buf = buf2; + while (size > 0) + { + int read = m_file.Read(buf,size); + size -= read; + buf += read; + } } -CStdString CFileShoutcast::GetContent() -{ - return m_mimetype; -} Modified: trunk/xbmc/FileSystem/FileShoutcast.h =================================================================== --- trunk/xbmc/FileSystem/FileShoutcast.h 2011-01-31 02:27:13 UTC (rev 30803) +++ trunk/xbmc/FileSystem/FileShoutcast.h 2011-01-31 10:16:19 UTC (rev 30804) @@ -23,32 +23,15 @@ // ////////////////////////////////////////////////////////////////////// -#if !defined(AFX_FILESHOUTCAST_H__6B6082E6_547E_44C4_8801_9890781659C0__INCLUDED_) -#define AFX_FILESHOUTCAST_H__6B6082E6_547E_44C4_8801_9890781659C0__INCLUDED_ - -#if _MSC_VER > 1000 #pragma once -#endif // _MSC_VER > 1000 #include "IFile.h" +#include "FileCurl.h" #include "StdString.h" +#include "MusicInfoTag.h" -namespace MUSIC_INFO -{ - class CMusicInfoTag; -} - namespace XFILE { -typedef struct FileStateSt -{ - bool bBuffering; - bool bRipDone; - bool bRipStarted; - bool bRipError; -} -FileState; - class CFileShoutcast : public IFile { public: @@ -62,16 +45,17 @@ virtual unsigned int Read(void* lpBuf, __int64 uiBufSize); virtual __int64 Seek(__int64 iFilePosition, int iWhence = SEEK_SET); virtual void Close(); - virtual bool CanRecord(); - virtual bool Record(); - virtual void StopRecording(); - virtual bool IsRecording(); - virtual bool GetMusicInfoTag(MUSIC_INFO::CMusicInfoTag& tag); - virtual CStdString GetContent(); protected: - void outputTimeoutMessage(const char* message); - DWORD m_dwLastTime; - CStdString m_mimetype; + void ExtractTagInfo(const char* buf); + void ReadTruncated(char* buf2, int size); + + unsigned int m_lastTime; + CFileCurl m_file; + int m_metaint; + int m_discarded; // data used for tags + int m_currint; + char* m_buffer; // buffer used for tags + MUSIC_INFO::CMusicInfoTag m_tag; }; } -#endif // !defined(AFX_FILESHOUTCAST_H__6B6082E6_547E_44C4_8801_9890781659C0__INCLUDED_) + Modified: trunk/xbmc/FileSystem/IFile.h =================================================================== --- trunk/xbmc/FileSystem/IFile.h 2011-01-31 02:27:13 UTC (rev 30803) +++ trunk/xbmc/FileSystem/IFile.h 2011-01-31 10:16:19 UTC (rev 30804) @@ -126,8 +126,18 @@ virtual CStdString GetContent() { return "application/octet-stream"; } }; -} +class CRedirectException +{ +public: + IFile *m_pNewFileImp; + + CRedirectException() : m_pNewFileImp(NULL) { } + CRedirectException(IFile *pNewFileImp) : m_pNewFileImp(pNewFileImp) { } +}; + +}; + #endif // !defined(AFX_IFILE_H__7EE73AC7_36BC_4822_93FF_44F3B0C766F6__INCLUDED_) Modified: trunk/xbmc/cores/mplayer/MPlayer.h =================================================================== --- trunk/xbmc/cores/mplayer/MPlayer.h 2011-01-31 02:27:13 UTC (rev 30803) +++ trunk/xbmc/cores/mplayer/MPlayer.h 2011-01-31 10:16:19 UTC (rev 30804) @@ -155,9 +155,6 @@ virtual void Update(bool bPauseDrawing = false); virtual void GetVideoRect(RECT& SrcRect, RECT& DestRect); virtual void GetVideoAspectRatio(float& fAR); - virtual bool CanRecord() ; - virtual bool IsRecording(); - virtual bool Record(bool bOnOff) ; virtual void SeekPercentage(float fPercent = 0); virtual float GetPercentage(); virtual void SetAVDelay(float fValue = 0.0f); Modified: trunk/xbmc/cores/mplayer/mplayer.cpp =================================================================== --- trunk/xbmc/cores/mplayer/mplayer.cpp 2011-01-31 02:27:13 UTC (rev 30803) +++ trunk/xbmc/cores/mplayer/mplayer.cpp 2011-01-31 10:16:19 UTC (rev 30804) @@ -1730,29 +1730,6 @@ xbox_audio_unregistercallback(); } -bool CMPlayer::CanRecord() -{ - if (!m_pShoutCastRipper) return false; - return m_pShoutCastRipper->CanRecord(); -} -bool CMPlayer::IsRecording() -{ - if (!m_pShoutCastRipper) return false; - return m_pShoutCastRipper->IsRecording(); -} -bool CMPlayer::Record(bool bOnOff) -{ - if (!m_pShoutCastRipper) return false; - if (bOnOff && IsRecording()) return true; - if (bOnOff == false && IsRecording() == false) return true; - if (bOnOff) - return m_pShoutCastRipper->Record(); - - m_pShoutCastRipper->StopRecording(); - return true; -} - - void CMPlayer::SeekPercentage(float percent) { // No EDL compensation possible, because we don't know the total time. Modified: trunk/xbmc/cores/paplayer/PAPlayer.h =================================================================== --- trunk/xbmc/cores/paplayer/PAPlayer.h 2011-01-31 02:27:13 UTC (rev 30803) +++ trunk/xbmc/cores/paplayer/PAPlayer.h 2011-01-31 10:16:19 UTC (rev 30804) @@ -88,9 +88,6 @@ virtual void SeekTime(__int64 iTime = 0); // Skip to next track/item inside the current media (if supported). virtual bool SkipNext(); - virtual bool CanRecord() ; - virtual bool IsRecording(); - virtual bool Record(bool bOnOff) ; void StreamCallback( LPVOID pPacketContext ); Modified: trunk/xbmc/cores/paplayer/PAPlayer_win32.cpp =================================================================== --- trunk/xbmc/cores/paplayer/PAPlayer_win32.cpp 2011-01-31 02:27:13 UTC (rev 30803) +++ trunk/xbmc/cores/paplayer/PAPlayer_win32.cpp 2011-01-31 10:16:19 UTC (rev 30804) @@ -1215,30 +1215,6 @@ return false; } -bool PAPlayer::CanRecord() -{ - if (!m_pShoutCastRipper) return false; - return m_pShoutCastRipper->CanRecord(); -} - -bool PAPlayer::IsRecording() -{ - if (!m_pShoutCastRipper) return false; - return m_pShoutCastRipper->IsRecording(); -} - -bool PAPlayer::Record(bool bOnOff) -{ - if (!m_pShoutCastRipper) return false; - if (bOnOff && IsRecording()) return true; - if (bOnOff == false && IsRecording() == false) return true; - if (bOnOff) - return m_pShoutCastRipper->Record(); - - m_pShoutCastRipper->StopRecording(); - return true; -} - void PAPlayer::WaitForStream() { // should we wait for our other stream as well? Modified: trunk/xbmc/cores/paplayer/PAPlayer_xbox.cpp =================================================================== --- trunk/xbmc/cores/paplayer/PAPlayer_xbox.cpp 2011-01-31 02:27:13 UTC (rev 30803) +++ trunk/xbmc/cores/paplayer/PAPlayer_xbox.cpp 2011-01-31 10:16:19 UTC (rev 30804) @@ -1127,30 +1127,6 @@ return false; } -bool PAPlayer::CanRecord() -{ - if (!m_pShoutCastRipper) return false; - return m_pShoutCastRipper->CanRecord(); -} - -bool PAPlayer::IsRecording() -{ - if (!m_pShoutCastRipper) return false; - return m_pShoutCastRipper->IsRecording(); -} - -bool PAPlayer::Record(bool bOnOff) -{ - if (!m_pShoutCastRipper) return false; - if (bOnOff && IsRecording()) return true; - if (bOnOff == false && IsRecording() == false) return true; - if (bOnOff) - return m_pShoutCastRipper->Record(); - - m_pShoutCastRipper->StopRecording(); - return true; -} - void PAPlayer::WaitForStream() { // should we wait for our other stream as well? Modified: trunk/xbmc/utils/HttpHeader.cpp =================================================================== --- trunk/xbmc/utils/HttpHeader.cpp 2011-01-31 02:27:13 UTC (rev 30803) +++ trunk/xbmc/utils/HttpHeader.cpp 2011-01-31 10:16:19 UTC (rev 30804) @@ -73,7 +73,10 @@ m_params[strParam] = strValue; } + else if (m_protoLine.IsEmpty()) + m_protoLine = strData; + iIter = iValueEnd + 2; } } Modified: trunk/xbmc/utils/HttpHeader.h =================================================================== --- trunk/xbmc/utils/HttpHeader.h 2011-01-31 02:27:13 UTC (rev 30803) +++ trunk/xbmc/utils/HttpHeader.h 2011-01-31 10:16:19 UTC (rev 30804) @@ -41,10 +41,12 @@ void GetHeader(CStdString& strHeader) const; CStdString GetMimeType() { return GetValue(HTTPHEADER_CONTENT_TYPE); } + CStdString GetProtoLine() { return m_protoLine; } void Clear(); protected: HeaderParams m_params; + CStdString m_protoLine; }; Modified: trunk/xbmc.vcproj =================================================================== --- trunk/xbmc.vcproj 2011-01-31 02:27:13 UTC (rev 30803) +++ trunk/xbmc.vcproj 2011-01-31 10:16:19 UTC (rev 30804) @@ -1875,9 +1875,6 @@ RelativePath=".\xbmc\FileSystem\RTVDirectory.cpp"> </File> <File - RelativePath=".\xbmc\FileSystem\ShoutcastRipFile.cpp"> - </File> - <File RelativePath=".\xbmc\FileSystem\SIDFileDirectory.cpp"> </File> <File @@ -3170,9 +3167,6 @@ RelativePath=".\xbmc\Shortcut.h"> </File> <File - RelativePath=".\xbmc\FileSystem\ShoutcastRipFile.h"> - </File> - <File RelativePath=".\xbmc\utils\SingleLock.h"> </File> <File This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |