Hi Sir,
Thanks for giving me the right direction.. I got struck
with GetHeadInfo() function.
I really dont understand why you are calling
head_info3() two times. The second time you are filling the
MPEG Header variable(local), sHead.
MPEG_HEAD sHead;
int iFrameBytes, iBitRate;
iFrameBytes = head_info3(((unsigned char *)pBuffer) +
m_frameBytes + iForward + m_sMpegHead.pad,
iMaxFrameSize - (m_frameBytes + iForward),
&sHead, &iBitRate, &iForward);
You are not using 'sHead' anywhere. Could you clarify?
regards,
Srinu
code:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Error XingLMC::GetHeadInfo()
{
int iLoop;
unsigned int iForward;
void *pBuffer;
Error Err;
for(iLoop = 0; iLoop < iMaxDecodeRetries; iLoop++)
{
Err = BeginRead(pBuffer, iMaxFrameSize, false);
if (Err == kError_NoErr)
{
m_frameBytes = head_info3((unsigned char *)pBuffer,
iMaxFrameSize, &m_sMpegHead,
(int*)&m_iBitRate, &iForward);
if (m_frameBytes > 0 && m_frameBytes < iMaxFrameSize &&
(m_sMpegHead.option == 1 || m_sMpegHead.option == 2))
{
MPEG_HEAD sHead;
int iFrameBytes, iBitRate;
iFrameBytes = head_info3(((unsigned char *)pBuffer) +
m_frameBytes + iForward + m_sMpegHead.pad,
iMaxFrameSize - (m_frameBytes + iForward),
&sHead, &iBitRate, &iForward);
if (m_frameBytes > 0 && m_frameBytes < iMaxFrameSize &&
(m_sMpegHead.option == 1 || m_sMpegHead.option == 2))
{
if (m_pXingHeader)
{
delete m_pXingHeader->toc;
delete m_pXingHeader;
}
m_pXingHeader = new XHEADDATA;
m_pXingHeader->toc = new unsigned char[100];
if (!GetXingHeader(m_pXingHeader, (unsigned char *)pBuffer))
{
delete m_pXingHeader->toc;
delete m_pXingHeader;
m_pXingHeader = NULL;
}
EndRead(0);
return kError_NoErr;
}
EndRead(0);
}
else
{
EndRead(0);
}
Err = AdvanceBufferToNextFrame();
if (Err != kError_NoErr)
return Err;
}
else
{
if (Err != kError_EndOfStream && Err != kError_Interrupt)
{
ReportError(szFailRead);
}
return Err;
}
}
return (Error)lmcError_DecodeFailed;
}
Srinivas A,
Email: [EMAIL PROTECTED]
_______________________________________________
[EMAIL PROTECTED]
http://www.freeamp.org/mailman/listinfo/freeamp-dev