The big NULL replacement party part 5.
Right. ' = NULL' would get a lot of these.
This commit is contained in:
@@ -6,13 +6,13 @@
|
||||
#define ALSA_PCM_NEW_SW_PARAMS_API
|
||||
#include <alsa/asoundlib.h>
|
||||
|
||||
static void *Handle = NULL;
|
||||
static void *Handle = nullptr;
|
||||
|
||||
#include "RageUtil.h"
|
||||
#include "ALSA9Dynamic.h"
|
||||
|
||||
/* foo_f dfoo = NULL */
|
||||
#define FUNC(ret, name, proto) name##_f d##name = NULL
|
||||
/* foo_f dfoo = nullptr */
|
||||
#define FUNC(ret, name, proto) name##_f d##name = nullptr
|
||||
#include "ALSA9Functions.h"
|
||||
#undef FUNC
|
||||
|
||||
@@ -62,8 +62,8 @@ void UnloadALSA()
|
||||
{
|
||||
if( Handle )
|
||||
dlclose( Handle );
|
||||
Handle = NULL;
|
||||
#define FUNC(ret, name, proto) d##name = NULL;
|
||||
Handle = nullptr;
|
||||
#define FUNC(ret, name, proto) d##name = nullptr;
|
||||
#include "ALSA9Functions.h"
|
||||
#undef FUNC
|
||||
}
|
||||
|
||||
@@ -212,7 +212,7 @@ Alsa9Buf::Alsa9Buf()
|
||||
last_cursor_pos = 0;
|
||||
preferred_writeahead = 8192;
|
||||
preferred_chunksize = 1024;
|
||||
pcm = NULL;
|
||||
pcm = nullptr;
|
||||
}
|
||||
|
||||
RString Alsa9Buf::Init( int channels_,
|
||||
|
||||
@@ -43,7 +43,7 @@ void DSound::SetPrimaryBufferMode()
|
||||
format.dwSize = sizeof(format);
|
||||
format.dwFlags = DSBCAPS_PRIMARYBUFFER;
|
||||
format.dwBufferBytes = 0;
|
||||
format.lpwfxFormat = NULL;
|
||||
format.lpwfxFormat = nullptr;
|
||||
|
||||
IDirectSoundBuffer *pBuffer;
|
||||
HRESULT hr = this->GetDS()->CreateSoundBuffer( &format, &pBuffer, NULL );
|
||||
@@ -98,9 +98,9 @@ void DSound::SetPrimaryBufferMode()
|
||||
DSound::DSound()
|
||||
{
|
||||
HRESULT hr;
|
||||
if( FAILED( hr = CoInitialize(NULL) ) )
|
||||
if( FAILED( hr = CoInitialize(nullptr) ) )
|
||||
RageException::Throw( hr_ssprintf(hr, "CoInitialize") );
|
||||
m_pDS = NULL;
|
||||
m_pDS = nullptr;
|
||||
}
|
||||
|
||||
RString DSound::Init()
|
||||
@@ -163,8 +163,8 @@ bool DSound::IsEmulated() const
|
||||
|
||||
DSoundBuf::DSoundBuf()
|
||||
{
|
||||
m_pBuffer = NULL;
|
||||
m_pTempBuffer = NULL;
|
||||
m_pBuffer = nullptr;
|
||||
m_pTempBuffer = nullptr;
|
||||
}
|
||||
|
||||
RString DSoundBuf::Init( DSound &ds, DSoundBuf::hw hardware,
|
||||
|
||||
@@ -53,12 +53,12 @@ bool RageSoundDriver_ALSA9_Software::GetData()
|
||||
if( frames_to_fill <= 0 )
|
||||
return false;
|
||||
|
||||
static int16_t *buf = NULL;
|
||||
static int16_t *buf = nullptr;
|
||||
static int bufsize = 0;
|
||||
if( buf && bufsize < frames_to_fill )
|
||||
{
|
||||
delete[] buf;
|
||||
buf = NULL;
|
||||
buf = nullptr;
|
||||
}
|
||||
if( !buf )
|
||||
{
|
||||
@@ -89,7 +89,7 @@ void RageSoundDriver_ALSA9_Software::SetupDecodingThread()
|
||||
|
||||
RageSoundDriver_ALSA9_Software::RageSoundDriver_ALSA9_Software()
|
||||
{
|
||||
m_pPCM = NULL;
|
||||
m_pPCM = nullptr;
|
||||
m_bShutdown = false;
|
||||
}
|
||||
|
||||
|
||||
@@ -40,8 +40,8 @@ static inline RString FourCCToString( uint32_t num )
|
||||
return s;
|
||||
}
|
||||
|
||||
RageSoundDriver_AU::RageSoundDriver_AU() : m_OutputUnit(NULL), m_iSampleRate(0), m_bDone(false), m_bStarted(false),
|
||||
m_pIOThread(NULL), m_pNotificationThread(NULL), m_Semaphore("Sound")
|
||||
RageSoundDriver_AU::RageSoundDriver_AU() : m_OutputUnit(nullptr), m_iSampleRate(0), m_bDone(false), m_bStarted(false),
|
||||
m_pIOThread(nullptr), m_pNotificationThread(nullptr), m_Semaphore("Sound")
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -1,169 +1,169 @@
|
||||
#include "global.h"
|
||||
#include "RageSoundDriver_DSound_Software.h"
|
||||
#include "DSoundHelpers.h"
|
||||
|
||||
#include "RageLog.h"
|
||||
#include "RageUtil.h"
|
||||
#include "RageSoundManager.h"
|
||||
#include "PrefsManager.h"
|
||||
#include "archutils/Win32/ErrorStrings.h"
|
||||
|
||||
REGISTER_SOUND_DRIVER_CLASS2( DirectSound-sw, DSound_Software );
|
||||
|
||||
static const int channels = 2;
|
||||
static const int bytes_per_frame = channels*2; /* 16-bit */
|
||||
static const int safe_writeahead = 1024*4; /* in frames */
|
||||
static int g_iMaxWriteahead;
|
||||
|
||||
/* We'll fill the buffer in chunks this big. */
|
||||
static const int num_chunks = 8;
|
||||
static int chunksize() { return g_iMaxWriteahead / num_chunks; }
|
||||
|
||||
void RageSoundDriver_DSound_Software::MixerThread()
|
||||
{
|
||||
if( !SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_TIME_CRITICAL) )
|
||||
if( !SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_ABOVE_NORMAL) )
|
||||
LOG->Warn(werr_ssprintf(GetLastError(), "Failed to set sound thread priority"));
|
||||
|
||||
/* Fill a buffer before we start playing, so we don't play whatever junk is
|
||||
* in the buffer. */
|
||||
char *locked_buf;
|
||||
unsigned len;
|
||||
while( m_pPCM->get_output_buf(&locked_buf, &len, chunksize()) )
|
||||
{
|
||||
memset( locked_buf, 0, len );
|
||||
m_pPCM->release_output_buf(locked_buf, len);
|
||||
}
|
||||
|
||||
/* Start playing. */
|
||||
m_pPCM->Play();
|
||||
|
||||
while( !m_bShutdownMixerThread )
|
||||
{
|
||||
char *pLockedBuf;
|
||||
unsigned iLen;
|
||||
const int64_t iPlayPos = m_pPCM->GetOutputPosition(); /* must be called before get_output_buf */
|
||||
|
||||
if( !m_pPCM->get_output_buf(&pLockedBuf, &iLen, chunksize()) )
|
||||
{
|
||||
Sleep( chunksize()*1000 / m_iSampleRate );
|
||||
continue;
|
||||
}
|
||||
|
||||
this->Mix( (int16_t *) pLockedBuf, iLen/bytes_per_frame, iPlayPos, m_pPCM->GetPosition() );
|
||||
|
||||
m_pPCM->release_output_buf( pLockedBuf, iLen );
|
||||
}
|
||||
|
||||
/* I'm not sure why, but if we don't stop the stream now, then the thread will take
|
||||
* 90ms (our buffer size) longer to close. */
|
||||
m_pPCM->Stop();
|
||||
}
|
||||
|
||||
int64_t RageSoundDriver_DSound_Software::GetPosition() const
|
||||
{
|
||||
return m_pPCM->GetPosition();
|
||||
}
|
||||
|
||||
int RageSoundDriver_DSound_Software::MixerThread_start(void *p)
|
||||
{
|
||||
((RageSoundDriver_DSound_Software *) p)->MixerThread();
|
||||
return 0;
|
||||
}
|
||||
|
||||
RageSoundDriver_DSound_Software::RageSoundDriver_DSound_Software()
|
||||
{
|
||||
m_bShutdownMixerThread = false;
|
||||
m_pPCM = NULL;
|
||||
}
|
||||
|
||||
RString RageSoundDriver_DSound_Software::Init()
|
||||
{
|
||||
RString sError = ds.Init();
|
||||
if( sError != "" )
|
||||
return sError;
|
||||
|
||||
/* If we're emulated, we're better off with the WaveOut driver; DS
|
||||
* emulation tends to be desynced. */
|
||||
if( ds.IsEmulated() )
|
||||
return "Driver unusable (emulated device)";
|
||||
|
||||
g_iMaxWriteahead = safe_writeahead;
|
||||
if( PREFSMAN->m_iSoundWriteAhead )
|
||||
g_iMaxWriteahead = PREFSMAN->m_iSoundWriteAhead;
|
||||
|
||||
/* Create a DirectSound stream, but don't force it into hardware. */
|
||||
m_pPCM = new DSoundBuf;
|
||||
m_iSampleRate = PREFSMAN->m_iSoundPreferredSampleRate;
|
||||
if( m_iSampleRate == 0 )
|
||||
m_iSampleRate = 44100;
|
||||
sError = m_pPCM->Init( ds, DSoundBuf::HW_DONT_CARE, channels, m_iSampleRate, 16, g_iMaxWriteahead );
|
||||
if( sError != "" )
|
||||
return sError;
|
||||
|
||||
LOG->Info( "Software mixing at %i hz", m_iSampleRate );
|
||||
|
||||
StartDecodeThread();
|
||||
|
||||
m_MixingThread.SetName("Mixer thread");
|
||||
m_MixingThread.Create( MixerThread_start, this );
|
||||
|
||||
return RString();
|
||||
}
|
||||
|
||||
RageSoundDriver_DSound_Software::~RageSoundDriver_DSound_Software()
|
||||
{
|
||||
/* Signal the mixing thread to quit. */
|
||||
if( m_MixingThread.IsCreated() )
|
||||
{
|
||||
m_bShutdownMixerThread = true;
|
||||
LOG->Trace("Shutting down mixer thread ...");
|
||||
LOG->Flush();
|
||||
m_MixingThread.Wait();
|
||||
LOG->Trace("Mixer thread shut down.");
|
||||
LOG->Flush();
|
||||
}
|
||||
|
||||
delete m_pPCM;
|
||||
}
|
||||
|
||||
void RageSoundDriver_DSound_Software::SetupDecodingThread()
|
||||
{
|
||||
if( !SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_ABOVE_NORMAL) )
|
||||
LOG->Warn( werr_ssprintf(GetLastError(), "Failed to set decoding thread priority") );
|
||||
}
|
||||
|
||||
float RageSoundDriver_DSound_Software::GetPlayLatency() const
|
||||
{
|
||||
return (1.0f / m_iSampleRate) * g_iMaxWriteahead;
|
||||
}
|
||||
|
||||
int RageSoundDriver_DSound_Software::GetSampleRate() const
|
||||
{
|
||||
return m_iSampleRate;
|
||||
}
|
||||
|
||||
/*
|
||||
* (c) 2002-2004 Glenn Maynard
|
||||
* All rights reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the
|
||||
* "Software"), to deal in the Software without restriction, including
|
||||
* without limitation the rights to use, copy, modify, merge, publish,
|
||||
* distribute, and/or sell copies of the Software, and to permit persons to
|
||||
* whom the Software is furnished to do so, provided that the above
|
||||
* copyright notice(s) and this permission notice appear in all copies of
|
||||
* the Software and that both the above copyright notice(s) and this
|
||||
* permission notice appear in supporting documentation.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF
|
||||
* THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS
|
||||
* INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT
|
||||
* OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
|
||||
* OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
||||
* OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||
* PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
#include "global.h"
|
||||
#include "RageSoundDriver_DSound_Software.h"
|
||||
#include "DSoundHelpers.h"
|
||||
|
||||
#include "RageLog.h"
|
||||
#include "RageUtil.h"
|
||||
#include "RageSoundManager.h"
|
||||
#include "PrefsManager.h"
|
||||
#include "archutils/Win32/ErrorStrings.h"
|
||||
|
||||
REGISTER_SOUND_DRIVER_CLASS2( DirectSound-sw, DSound_Software );
|
||||
|
||||
static const int channels = 2;
|
||||
static const int bytes_per_frame = channels*2; /* 16-bit */
|
||||
static const int safe_writeahead = 1024*4; /* in frames */
|
||||
static int g_iMaxWriteahead;
|
||||
|
||||
/* We'll fill the buffer in chunks this big. */
|
||||
static const int num_chunks = 8;
|
||||
static int chunksize() { return g_iMaxWriteahead / num_chunks; }
|
||||
|
||||
void RageSoundDriver_DSound_Software::MixerThread()
|
||||
{
|
||||
if( !SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_TIME_CRITICAL) )
|
||||
if( !SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_ABOVE_NORMAL) )
|
||||
LOG->Warn(werr_ssprintf(GetLastError(), "Failed to set sound thread priority"));
|
||||
|
||||
/* Fill a buffer before we start playing, so we don't play whatever junk is
|
||||
* in the buffer. */
|
||||
char *locked_buf;
|
||||
unsigned len;
|
||||
while( m_pPCM->get_output_buf(&locked_buf, &len, chunksize()) )
|
||||
{
|
||||
memset( locked_buf, 0, len );
|
||||
m_pPCM->release_output_buf(locked_buf, len);
|
||||
}
|
||||
|
||||
/* Start playing. */
|
||||
m_pPCM->Play();
|
||||
|
||||
while( !m_bShutdownMixerThread )
|
||||
{
|
||||
char *pLockedBuf;
|
||||
unsigned iLen;
|
||||
const int64_t iPlayPos = m_pPCM->GetOutputPosition(); /* must be called before get_output_buf */
|
||||
|
||||
if( !m_pPCM->get_output_buf(&pLockedBuf, &iLen, chunksize()) )
|
||||
{
|
||||
Sleep( chunksize()*1000 / m_iSampleRate );
|
||||
continue;
|
||||
}
|
||||
|
||||
this->Mix( (int16_t *) pLockedBuf, iLen/bytes_per_frame, iPlayPos, m_pPCM->GetPosition() );
|
||||
|
||||
m_pPCM->release_output_buf( pLockedBuf, iLen );
|
||||
}
|
||||
|
||||
/* I'm not sure why, but if we don't stop the stream now, then the thread will take
|
||||
* 90ms (our buffer size) longer to close. */
|
||||
m_pPCM->Stop();
|
||||
}
|
||||
|
||||
int64_t RageSoundDriver_DSound_Software::GetPosition() const
|
||||
{
|
||||
return m_pPCM->GetPosition();
|
||||
}
|
||||
|
||||
int RageSoundDriver_DSound_Software::MixerThread_start(void *p)
|
||||
{
|
||||
((RageSoundDriver_DSound_Software *) p)->MixerThread();
|
||||
return 0;
|
||||
}
|
||||
|
||||
RageSoundDriver_DSound_Software::RageSoundDriver_DSound_Software()
|
||||
{
|
||||
m_bShutdownMixerThread = false;
|
||||
m_pPCM = nullptr;
|
||||
}
|
||||
|
||||
RString RageSoundDriver_DSound_Software::Init()
|
||||
{
|
||||
RString sError = ds.Init();
|
||||
if( sError != "" )
|
||||
return sError;
|
||||
|
||||
/* If we're emulated, we're better off with the WaveOut driver; DS
|
||||
* emulation tends to be desynced. */
|
||||
if( ds.IsEmulated() )
|
||||
return "Driver unusable (emulated device)";
|
||||
|
||||
g_iMaxWriteahead = safe_writeahead;
|
||||
if( PREFSMAN->m_iSoundWriteAhead )
|
||||
g_iMaxWriteahead = PREFSMAN->m_iSoundWriteAhead;
|
||||
|
||||
/* Create a DirectSound stream, but don't force it into hardware. */
|
||||
m_pPCM = new DSoundBuf;
|
||||
m_iSampleRate = PREFSMAN->m_iSoundPreferredSampleRate;
|
||||
if( m_iSampleRate == 0 )
|
||||
m_iSampleRate = 44100;
|
||||
sError = m_pPCM->Init( ds, DSoundBuf::HW_DONT_CARE, channels, m_iSampleRate, 16, g_iMaxWriteahead );
|
||||
if( sError != "" )
|
||||
return sError;
|
||||
|
||||
LOG->Info( "Software mixing at %i hz", m_iSampleRate );
|
||||
|
||||
StartDecodeThread();
|
||||
|
||||
m_MixingThread.SetName("Mixer thread");
|
||||
m_MixingThread.Create( MixerThread_start, this );
|
||||
|
||||
return RString();
|
||||
}
|
||||
|
||||
RageSoundDriver_DSound_Software::~RageSoundDriver_DSound_Software()
|
||||
{
|
||||
/* Signal the mixing thread to quit. */
|
||||
if( m_MixingThread.IsCreated() )
|
||||
{
|
||||
m_bShutdownMixerThread = true;
|
||||
LOG->Trace("Shutting down mixer thread ...");
|
||||
LOG->Flush();
|
||||
m_MixingThread.Wait();
|
||||
LOG->Trace("Mixer thread shut down.");
|
||||
LOG->Flush();
|
||||
}
|
||||
|
||||
delete m_pPCM;
|
||||
}
|
||||
|
||||
void RageSoundDriver_DSound_Software::SetupDecodingThread()
|
||||
{
|
||||
if( !SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_ABOVE_NORMAL) )
|
||||
LOG->Warn( werr_ssprintf(GetLastError(), "Failed to set decoding thread priority") );
|
||||
}
|
||||
|
||||
float RageSoundDriver_DSound_Software::GetPlayLatency() const
|
||||
{
|
||||
return (1.0f / m_iSampleRate) * g_iMaxWriteahead;
|
||||
}
|
||||
|
||||
int RageSoundDriver_DSound_Software::GetSampleRate() const
|
||||
{
|
||||
return m_iSampleRate;
|
||||
}
|
||||
|
||||
/*
|
||||
* (c) 2002-2004 Glenn Maynard
|
||||
* All rights reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the
|
||||
* "Software"), to deal in the Software without restriction, including
|
||||
* without limitation the rights to use, copy, modify, merge, publish,
|
||||
* distribute, and/or sell copies of the Software, and to permit persons to
|
||||
* whom the Software is furnished to do so, provided that the above
|
||||
* copyright notice(s) and this permission notice appear in all copies of
|
||||
* the Software and that both the above copyright notice(s) and this
|
||||
* permission notice appear in supporting documentation.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF
|
||||
* THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS
|
||||
* INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT
|
||||
* OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
|
||||
* OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
||||
* OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||
* PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
@@ -18,7 +18,7 @@ static int underruns = 0, logged_underruns = 0;
|
||||
|
||||
RageSoundDriver::Sound::Sound()
|
||||
{
|
||||
m_pSound = NULL;
|
||||
m_pSound = nullptr;
|
||||
m_State = AVAILABLE;
|
||||
m_bPaused = false;
|
||||
}
|
||||
@@ -273,7 +273,7 @@ void RageSoundDriver::Update()
|
||||
// LOG->Trace("finishing sound %i", i);
|
||||
|
||||
m_Sounds[i].m_pSound->SoundIsFinishedPlaying();
|
||||
m_Sounds[i].m_pSound = NULL;
|
||||
m_Sounds[i].m_pSound = nullptr;
|
||||
|
||||
/* This sound is done. Set it to HALTING, since the mixer thread might
|
||||
* be accessing it; it'll change it back to STOPPED once it's ready to
|
||||
@@ -382,7 +382,7 @@ void RageSoundDriver::StopMixing( RageSoundBase *pSound )
|
||||
|
||||
/* Invalidate the m_pSound pointer to guarantee we don't make any further references to
|
||||
* it. Once this call returns, the sound may no longer exist. */
|
||||
m_Sounds[i].m_pSound = NULL;
|
||||
m_Sounds[i].m_pSound = nullptr;
|
||||
// LOG->Trace("end StopMixing");
|
||||
|
||||
m_Mutex.Unlock();
|
||||
|
||||
@@ -77,7 +77,7 @@ bool RageSoundDriver_OSS::GetData()
|
||||
|
||||
const int chunksize = ab.fragsize;
|
||||
|
||||
static int16_t *buf = NULL;
|
||||
static int16_t *buf = nullptr;
|
||||
if(!buf)
|
||||
buf = new int16_t[chunksize / sizeof(int16_t)];
|
||||
|
||||
|
||||
@@ -16,9 +16,9 @@ REGISTER_SOUND_DRIVER_CLASS2( Pulse, PulseAudio );
|
||||
/* Constructor */
|
||||
RageSoundDriver_PulseAudio::RageSoundDriver_PulseAudio()
|
||||
: RageSoundDriver(),
|
||||
m_LastPosition(0), m_SampleRate(0), m_Error(NULL),
|
||||
m_LastPosition(0), m_SampleRate(0), m_Error(nullptr),
|
||||
m_Sem("Pulseaudio Synchronization Semaphore"),
|
||||
m_PulseMainLoop(NULL), m_PulseCtx(NULL), m_PulseStream(NULL)
|
||||
m_PulseMainLoop(nullptr), m_PulseCtx(nullptr), m_PulseStream(nullptr)
|
||||
{
|
||||
m_SampleRate = PREFSMAN->m_iSoundPreferredSampleRate;
|
||||
if( m_SampleRate == 0 )
|
||||
@@ -137,7 +137,7 @@ void RageSoundDriver_PulseAudio::m_InitStream(void)
|
||||
{
|
||||
if(asprintf(&m_Error, "invalid sample spec!") == -1)
|
||||
{
|
||||
m_Error = NULL;
|
||||
m_Error = nullptr;
|
||||
}
|
||||
m_Sem.Post();
|
||||
return;
|
||||
@@ -155,7 +155,7 @@ void RageSoundDriver_PulseAudio::m_InitStream(void)
|
||||
{
|
||||
if(asprintf(&m_Error, "pa_stream_new(): %s", pa_strerror(pa_context_errno(m_PulseCtx))) == -1)
|
||||
{
|
||||
m_Error = NULL;
|
||||
m_Error = nullptr;
|
||||
}
|
||||
m_Sem.Post();
|
||||
return;
|
||||
@@ -231,7 +231,7 @@ void RageSoundDriver_PulseAudio::m_InitStream(void)
|
||||
if(asprintf(&m_Error, "pa_stream_connect_playback(): %s",
|
||||
pa_strerror(pa_context_errno(m_PulseCtx))) == -1)
|
||||
{
|
||||
m_Error = NULL;
|
||||
m_Error = nullptr;
|
||||
}
|
||||
m_Sem.Post();
|
||||
return;
|
||||
@@ -261,7 +261,7 @@ void RageSoundDriver_PulseAudio::CtxStateCb(pa_context *c)
|
||||
case PA_CONTEXT_FAILED:
|
||||
if(asprintf(&m_Error, "context connection failed: %s", pa_strerror(pa_context_errno(m_PulseCtx))) == -1)
|
||||
{
|
||||
m_Error = NULL;
|
||||
m_Error = nullptr;
|
||||
}
|
||||
m_Sem.Post();
|
||||
return;
|
||||
|
||||
@@ -38,7 +38,7 @@ struct WinWdmPin
|
||||
{
|
||||
WinWdmPin( WinWdmFilter *pParentFilter, int iPinId )
|
||||
{
|
||||
m_hHandle = NULL;
|
||||
m_hHandle = nullptr;
|
||||
m_pParentFilter = pParentFilter;
|
||||
m_iPinId = iPinId;
|
||||
}
|
||||
@@ -92,7 +92,7 @@ struct WinWdmFilter
|
||||
|
||||
WinWdmFilter()
|
||||
{
|
||||
m_hHandle = NULL;
|
||||
m_hHandle = nullptr;
|
||||
m_iUsageCount = 0;
|
||||
}
|
||||
|
||||
@@ -129,8 +129,8 @@ static RString GUIDToString( const GUID *pGuid )
|
||||
pGuid->Data4[4], pGuid->Data4[5], pGuid->Data4[6], pGuid->Data4[7] );
|
||||
}
|
||||
|
||||
static HMODULE DllKsUser = NULL;
|
||||
static KSCREATEPIN *FunctionKsCreatePin = NULL;
|
||||
static HMODULE DllKsUser = nullptr;
|
||||
static KSCREATEPIN *FunctionKsCreatePin = nullptr;
|
||||
|
||||
/* Low level pin/filter access functions */
|
||||
static bool WdmSyncIoctl(
|
||||
@@ -313,7 +313,7 @@ WinWdmPin *WinWdmFilter::CreatePin( unsigned long iPinId, RString &sError )
|
||||
|
||||
/* Get the INTERFACE property list */
|
||||
{
|
||||
KSMULTIPLE_ITEM *pItem = NULL;
|
||||
KSMULTIPLE_ITEM *pItem = nullptr;
|
||||
if( !WdmGetPinPropertyMulti(m_hHandle, iPinId, &KSPROPSETID_Pin, KSPROPERTY_PIN_INTERFACES, &pItem, sError) )
|
||||
{
|
||||
sError = "KSPROPERTY_PIN_INTERFACES: " + sError;
|
||||
@@ -342,7 +342,7 @@ WinWdmPin *WinWdmFilter::CreatePin( unsigned long iPinId, RString &sError )
|
||||
|
||||
/* Get the MEDIUM properties list */
|
||||
{
|
||||
KSMULTIPLE_ITEM *pItem = NULL;
|
||||
KSMULTIPLE_ITEM *pItem = nullptr;
|
||||
if( !WdmGetPinPropertyMulti( m_hHandle, iPinId, &KSPROPSETID_Pin, KSPROPERTY_PIN_MEDIUMS, &pItem, sError) )
|
||||
{
|
||||
sError = "KSPROPERTY_PIN_MEDIUMS: " + sError;
|
||||
@@ -405,7 +405,7 @@ WinWdmPin *WinWdmFilter::CreatePin( unsigned long iPinId, RString &sError )
|
||||
}
|
||||
}
|
||||
free( pDataRangesItem );
|
||||
pDataRangesItem = NULL;
|
||||
pDataRangesItem = nullptr;
|
||||
|
||||
if( pPin->m_dataRangesItem.size() == 0 )
|
||||
{
|
||||
@@ -433,7 +433,7 @@ void WinWdmPin::Close()
|
||||
SetState( KSSTATE_PAUSE, sError );
|
||||
SetState( KSSTATE_STOP, sError );
|
||||
CloseHandle( m_hHandle );
|
||||
m_hHandle = NULL;
|
||||
m_hHandle = nullptr;
|
||||
m_pParentFilter->Release();
|
||||
}
|
||||
|
||||
@@ -465,7 +465,7 @@ bool WinWdmPin::Instantiate( const WAVEFORMATEX *pFormat, RString &sError )
|
||||
|
||||
sError = werr_ssprintf( iRet, "FunctionKsCreatePin" );
|
||||
m_pParentFilter->Release();
|
||||
m_hHandle = NULL;
|
||||
m_hHandle = nullptr;
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -613,7 +613,7 @@ void WinWdmFilter::Release()
|
||||
if( m_hHandle != nullptr )
|
||||
{
|
||||
CloseHandle( m_hHandle );
|
||||
m_hHandle = NULL;
|
||||
m_hHandle = nullptr;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -885,7 +885,7 @@ static bool PaWinWdm_Initialize( RString &sError )
|
||||
{
|
||||
sError = "no KsCreatePin in ksuser.dll";
|
||||
FreeLibrary( DllKsUser );
|
||||
DllKsUser = NULL;
|
||||
DllKsUser = nullptr;
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -900,7 +900,7 @@ struct WinWdmStream
|
||||
memset( this, 0, sizeof(*this) );
|
||||
for( int i = 0; i < MAX_CHUNKS; ++i )
|
||||
m_Signal[i].hEvent = CreateEvent( NULL, FALSE, FALSE, NULL );
|
||||
m_pPlaybackPin = NULL;
|
||||
m_pPlaybackPin = nullptr;
|
||||
}
|
||||
|
||||
~WinWdmStream()
|
||||
@@ -920,11 +920,11 @@ struct WinWdmStream
|
||||
{
|
||||
if( m_pPlaybackPin )
|
||||
m_pPlaybackPin->Close();
|
||||
m_pPlaybackPin = NULL;
|
||||
m_pPlaybackPin = nullptr;
|
||||
for( int i = 0; i < 2; ++i )
|
||||
{
|
||||
VirtualFree( m_Packets[i].Data, 0, MEM_RELEASE );
|
||||
m_Packets[i].Data = NULL;
|
||||
m_Packets[i].Data = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1263,8 +1263,8 @@ int64_t RageSoundDriver_WDMKS::GetPosition() const
|
||||
|
||||
RageSoundDriver_WDMKS::RageSoundDriver_WDMKS()
|
||||
{
|
||||
m_pStream = NULL;
|
||||
m_pFilter = NULL;
|
||||
m_pStream = nullptr;
|
||||
m_pFilter = nullptr;
|
||||
m_bShutdown = false;
|
||||
m_iLastCursorPos = 0;
|
||||
m_hSignal = CreateEvent( NULL, FALSE, FALSE, NULL ); /* abort event */
|
||||
|
||||
@@ -106,7 +106,7 @@ RageSoundDriver_WaveOut::RageSoundDriver_WaveOut()
|
||||
|
||||
m_hSoundEvent = CreateEvent( NULL, false, true, NULL );
|
||||
|
||||
m_hWaveOut = NULL;
|
||||
m_hWaveOut = nullptr;
|
||||
}
|
||||
|
||||
RString RageSoundDriver_WaveOut::Init()
|
||||
|
||||
Reference in New Issue
Block a user