Decouple <cstdint>

This commit is contained in:
Martin Natano
2023-04-21 22:13:41 +02:00
parent bcea05dd67
commit aa87f85eef
167 changed files with 1533 additions and 1307 deletions
@@ -11,6 +11,7 @@
#include "archutils/Unix/GetSysInfo.h"
#include <cstdint>
#include <sys/time.h>
#include <sys/resource.h>
@@ -18,7 +19,7 @@ REGISTER_SOUND_DRIVER_CLASS2( ALSA-sw, ALSA9_Software );
static const int channels = 2;
static const int samples_per_frame = channels;
static const int bytes_per_frame = sizeof(int16_t) * samples_per_frame;
static const int bytes_per_frame = sizeof(std::int16_t) * samples_per_frame;
/* Linux 2.6 has a fine-grained scheduler. We can almost always use a smaller buffer
* size than in 2.4. XXX: Some cards can handle smaller buffer sizes than others. */
@@ -53,7 +54,7 @@ bool RageSoundDriver_ALSA9_Software::GetData()
if( frames_to_fill <= 0 )
return false;
static int16_t *buf = nullptr;
static std::int16_t *buf = nullptr;
static int bufsize = 0;
if( buf && bufsize < frames_to_fill )
{
@@ -62,12 +63,12 @@ bool RageSoundDriver_ALSA9_Software::GetData()
}
if( !buf )
{
buf = new int16_t[frames_to_fill*samples_per_frame];
buf = new std::int16_t[frames_to_fill*samples_per_frame];
bufsize = frames_to_fill;
}
const int64_t play_pos = m_pPCM->GetPlayPos();
const int64_t cur_play_pos = m_pPCM->GetPosition();
const std::int64_t play_pos = m_pPCM->GetPlayPos();
const std::int64_t cur_play_pos = m_pPCM->GetPosition();
this->Mix( buf, frames_to_fill, play_pos, cur_play_pos );
m_pPCM->Write( buf, frames_to_fill );
@@ -76,10 +77,10 @@ bool RageSoundDriver_ALSA9_Software::GetData()
}
int64_t RageSoundDriver_ALSA9_Software::GetPosition() const
std::int64_t RageSoundDriver_ALSA9_Software::GetPosition() const
{
return m_pPCM->GetPosition();
}
}
void RageSoundDriver_ALSA9_Software::SetupDecodingThread()
{
@@ -119,9 +120,9 @@ RString RageSoundDriver_ALSA9_Software::Init()
return sError;
m_iSampleRate = m_pPCM->GetSampleRate();
StartDecodeThread();
m_MixingThread.SetName( "RageSoundDriver_ALSA9_Software" );
m_MixingThread.Create( MixerThread_start, this );
@@ -138,7 +139,7 @@ RageSoundDriver_ALSA9_Software::~RageSoundDriver_ALSA9_Software()
m_MixingThread.Wait();
LOG->Trace("Mixer thread shut down.");
}
delete m_pPCM;
UnloadALSA();
@@ -152,7 +153,7 @@ float RageSoundDriver_ALSA9_Software::GetPlayLatency() const
/*
* (c) 2002-2004 Glenn Maynard, Aaron VonderHaar
* 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
@@ -162,7 +163,7 @@ float RageSoundDriver_ALSA9_Software::GetPlayLatency() const
* 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