[Xbyamp-cvs] xbmp/player buildtime.h,1.6,1.7 FileRelax.cpp,1.2,1.3 MoviePlayer.cpp,1.15,1.16 streami
Status: Pre-Alpha
Brought to you by:
yamp
From: <ya...@us...> - 2002-12-05 16:15:35
|
Update of /cvsroot/xbyamp/xbmp/player In directory sc8-pr-cvs1:/tmp/cvs-serv16512 Modified Files: buildtime.h FileRelax.cpp MoviePlayer.cpp streaming.cpp XBoxMediaPlayer.cpp Log Message: no message Index: buildtime.h =================================================================== RCS file: /cvsroot/xbyamp/xbmp/player/buildtime.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** buildtime.h 4 Dec 2002 20:57:40 -0000 1.6 --- buildtime.h 5 Dec 2002 16:15:31 -0000 1.7 *************** *** 1,4 **** #ifndef BUILD_TIME_H #define BUILD_TIME_H ! #define BUILD_TIME L"build:4-dec-2002 21:00" #endif --- 1,4 ---- #ifndef BUILD_TIME_H #define BUILD_TIME_H ! #define BUILD_TIME L"build:5-dec-2002 17:00" #endif Index: FileRelax.cpp =================================================================== RCS file: /cvsroot/xbyamp/xbmp/player/FileRelax.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** FileRelax.cpp 3 Dec 2002 17:47:05 -0000 1.2 --- FileRelax.cpp 5 Dec 2002 16:15:31 -0000 1.3 *************** *** 96,99 **** --- 96,101 ---- if (sending<=0) { + OutputDebugString( "CFileRelax::Read() failed 2 get response.\n" ); + return 0; } Index: MoviePlayer.cpp =================================================================== RCS file: /cvsroot/xbyamp/xbmp/player/MoviePlayer.cpp,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** MoviePlayer.cpp 4 Dec 2002 20:57:42 -0000 1.15 --- MoviePlayer.cpp 5 Dec 2002 16:15:31 -0000 1.16 *************** *** 9,13 **** // - shoutcast // - select audio stream ! // - // // --- 9,13 ---- // - shoutcast // - select audio stream ! // - files not closed when using relax->end of file->crash // // *************** *** 17,20 **** --- 17,22 ---- // - multiple screen resolutions // - 15min shutdown on non-debug systems + // - control panel: slider not highlighted when selected + // - audio settings:crash // // Index: streaming.cpp =================================================================== RCS file: /cvsroot/xbyamp/xbmp/player/streaming.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** streaming.cpp 30 Nov 2002 20:32:13 -0000 1.2 --- streaming.cpp 5 Dec 2002 16:15:31 -0000 1.3 *************** *** 29,33 **** int streaming_seek(int fd,long pos) { - mp_msg(0,0,"seek %x", pos); return streamer.Seek(fd,pos); } --- 29,32 ---- *************** *** 35,39 **** int streaming_read( int fd, char* buffer, int iLen ) { ! return streamer.Read(fd,buffer,iLen); } --- 34,39 ---- int streaming_read( int fd, char* buffer, int iLen ) { ! int iread=streamer.Read(fd,buffer,iLen); ! return iread; } *************** *** 51,57 **** //**************************************************************************************** CStreaming::CStreaming() ! { ! m_pFile=NULL; } --- 51,57 ---- //**************************************************************************************** CStreaming::CStreaming() ! { m_pFile=NULL; + m_byCache=NULL; } *************** *** 59,62 **** --- 59,63 ---- CStreaming::~CStreaming() { + } *************** *** 67,70 **** --- 68,77 ---- int CStreaming::Open(const string& strProtocol, const string& strHostName, const string &strFileName) { + if (m_byCache) + { + delete [] m_byCache; + m_byCache=NULL; + } + mp_msg(0,0,"open %s %s %s\n", strProtocol.c_str(), strHostName.c_str(), strFileName.c_str()); CSingleLock lock(m_critSection); *************** *** 86,90 **** int CStreaming::Seek(int fd, long pos) { ! if (!m_pFile) return -1; CSingleLock lock(m_critSection); --- 93,100 ---- int CStreaming::Seek(int fd, long pos) { ! if (!m_pFile) ! { ! return -1; ! } CSingleLock lock(m_critSection); *************** *** 100,111 **** int CStreaming::Read(int fd, char *pBuffer, int iLen) { ! if (!m_pFile) return -1; ! // copy from buffer.. int iBytesRead=0; int iSize=0; int iPos=0; m_eventFilled.Reset(); ! while (!m_bEOFReached && iLen>0) { unsigned long ulBytesInCache=CacheFilled(); --- 110,124 ---- int CStreaming::Read(int fd, char *pBuffer, int iLen) { ! if (!m_pFile) ! { ! return -1; ! } // copy from buffer.. int iBytesRead=0; int iSize=0; int iPos=0; + int iLenOrg=iLen; m_eventFilled.Reset(); ! while (iLen>0) { unsigned long ulBytesInCache=CacheFilled(); *************** *** 124,131 **** --- 137,152 ---- else { + if (m_bEOFReached && 0==ulBytesInCache) + { + break; + } Need2Refill(); m_eventFilled.Wait(); } } + if (iBytesRead != iLenOrg) + { + mp_msg(0,0,"read only %i/%i bytes",iBytesRead,iLenOrg); + } return iBytesRead; } *************** *** 134,145 **** void CStreaming::Close() { CSingleLock lock(m_critSection); m_bStop=true; m_eventNeedFilling.Set(); m_eventStop.Wait(); ! m_pFile->Close(); ! delete m_pFile; m_pFile=NULL; m_ulReadPointer=m_ulWritePointer=0; } --- 155,175 ---- void CStreaming::Close() { + mp_msg(0,0,"streaming close"); CSingleLock lock(m_critSection); m_bStop=true; m_eventNeedFilling.Set(); m_eventStop.Wait(); ! if (m_pFile) ! { ! m_pFile->Close(); ! delete m_pFile; ! } m_pFile=NULL; m_ulReadPointer=m_ulWritePointer=0; + if (m_byCache) + { + delete [] m_byCache; + m_byCache=NULL; + } } *************** *** 156,163 **** void CStreaming::OnExit() { - delete [] m_byCache; - m_byCache=NULL; - - m_eventStop.Set(); } --- 186,189 ---- *************** *** 178,181 **** --- 204,208 ---- m_eventNeedFilling.Wait(); } + mp_msg(0,0,"process done"); } *************** *** 211,214 **** --- 238,242 ---- if (iBytesRead==0) { + mp_msg(0,0,"stream eof reached"); m_eventFilled.Set(); m_bEOFReached=true; Index: XBoxMediaPlayer.cpp =================================================================== RCS file: /cvsroot/xbyamp/xbmp/player/XBoxMediaPlayer.cpp,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** XBoxMediaPlayer.cpp 4 Dec 2002 20:57:49 -0000 1.13 --- XBoxMediaPlayer.cpp 5 Dec 2002 16:15:31 -0000 1.14 *************** *** 56,64 **** VOID __cdecl main() { ! CApplication xbApp; ! if( !FAILED( xbApp.Create() ) ) ! xbApp.Run(); ! ! while(1); } --- 56,65 ---- VOID __cdecl main() { ! CApplication xbApp; ! if( !FAILED( xbApp.Create() ) ) ! { ! xbApp.Run(); ! xbApp.Cleanup(); ! } } *************** *** 96,99 **** --- 97,101 ---- { // Freesyle UI + memset(m_pUserInterfaces,0,sizeof(m_pUserInterfaces)); m_bShowDelay=false; m_appState = IN_HOME; *************** *** 465,468 **** --- 467,479 ---- HRESULT CApplication::Cleanup() { + if (m_pMediaPlayer) + { + delete m_pMediaPlayer; + } + if ( m_pVideoRenderer ) delete m_pVideoRenderer; + m_pMediaPlayer=NULL; + m_pVideoRenderer=NULL; + + return S_OK; } *************** *** 1073,1078 **** else { ! // not flipping, then wait until vsync ! m_pd3dDevice->BlockUntilVerticalBlank(); } } --- 1084,1093 ---- else { ! if (m_appState != IN_MOVIE) ! { ! // not flipping, then wait until vsync only when ! // we're in UI ! m_pd3dDevice->BlockUntilVerticalBlank(); ! } } } *************** *** 1086,1089 **** --- 1101,1105 ---- if (( timeGetTime() - m_dwPowerDown) >= POWERDOWN) { + Cleanup(); m_dwPowerDown=timeGetTime(); CIoSupport helper; *************** *** 1268,1271 **** --- 1284,1288 ---- VOID CApplication::ExitToDashboard() { + Cleanup(); if (g_playerSettings.szDashboard[0]!=0) { |