m_forceResampler = false;
m_remapper = NULL;
m_remapBuffer = NULL;
+ m_streamResampleRatio = 1.0;
}
CActiveAEStream::~CActiveAEStream()
for(unsigned int j=0; j<m_format.m_channelLayout.Count(); j++)
{
idx = m_remapper->GetAVChannelIndex(m_format.m_channelLayout[j], avLayout);
- if (idx == i)
+ if (idx == (int)i)
{
ffmpegLayout += m_format.m_channelLayout[j];
break;
for(unsigned int j=0; j<m_format.m_channelLayout.Count(); j++)
{
idx = m_remapper->GetAVChannelIndex(m_format.m_channelLayout[j], avLayout);
- if (idx == i)
+ if (idx == (int)i)
{
remapLayout += ffmpegLayout[j];
break;
while(copied < size)
{
- buf = (uint8_t*)data;
+ buf = ((uint8_t*)data) + copied;
bytesToCopy = size - copied;
if (m_currentBuffer)
if (m_leftoverBytes && bytesToCopy >= (m_format.m_frameSize - m_leftoverBytes))
{
int fillbytes = m_format.m_frameSize - m_leftoverBytes;
- memcpy(m_leftoverBuffer+m_leftoverBytes, (uint8_t*)data, fillbytes);
- data = (uint8_t*)data + fillbytes;
- size -= fillbytes;
+ memcpy(m_leftoverBuffer+m_leftoverBytes, buf, fillbytes);
+ copied += fillbytes;
// leftover buffer will be copied on next cycle
buf = m_leftoverBuffer;
bytesToCopy = m_format.m_frameSize;
// if we don't have a full frame, copy to leftover buffer
if (!availableSamples && bytesToCopy)
{
- memcpy(m_leftoverBuffer+m_leftoverBytes, buf+copied, bytesToCopy);
+ memcpy(m_leftoverBuffer+m_leftoverBytes, buf, bytesToCopy);
m_leftoverBytes = bytesToCopy;
copied += bytesToCopy;
}
//TODO: handle planar formats
if (m_convertFn)
- m_convertFn(buf+copied, samples*m_currentBuffer->pkt->config.channels, (float*)(m_currentBuffer->pkt->data[0] + start));
+ m_convertFn(buf, samples*m_currentBuffer->pkt->config.channels, (float*)(m_currentBuffer->pkt->data[0] + start));
else
- memcpy(m_currentBuffer->pkt->data[0] + start, buf+copied, bytes);
+ memcpy(m_currentBuffer->pkt->data[0] + start, buf, bytes);
{
CSingleLock lock(*m_statsLock);
m_currentBuffer->pkt->nb_samples += samples;