mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 01:58:19 +00:00
remove two first audio frames to avoid noise in the begining
This commit is contained in:
parent
a7c2a65ebc
commit
f0e7ca200f
|
@ -239,10 +239,9 @@ void CVideo::nextAudioFrame(short* pData)
|
|||
if (m_Recording && m_HasAudio)
|
||||
{
|
||||
m_aseq += 1;
|
||||
for(int i=0; i < 1024; i++)
|
||||
m_aBuffer[i+(m_aseq%2)*1024] = pData[i];
|
||||
if(m_aseq % 2)
|
||||
{
|
||||
mem_copy(m_aBuffer+(m_aseq%2)*1024, pData, sizeof(short)*1024);
|
||||
if(!(m_aseq % 2) || m_aseq < 4) // jump first two audio frames
|
||||
return;
|
||||
m_ProcessingAudioFrame = true;
|
||||
m_AudioStream.frame->pts = m_AudioStream.enc->frame_number;
|
||||
dbg_msg("video_recorder", "aframe: %d", m_AudioStream.enc->frame_number);
|
||||
|
@ -308,7 +307,6 @@ void CVideo::nextAudioFrame(short* pData)
|
|||
write_frame(&m_AudioStream);
|
||||
|
||||
m_ProcessingAudioFrame = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue