I've a problem to decodec AAC frames that I receive from a stream. The 
decode function fail with follow log info:

[mpeg4aac @ 68C432E0] faac: frame decoding failed: ”®áhÿÿ
[mpeg4aac @ 68C432E0] faac: frame decoding failed: Þ®áh¸
[mpeg4aac @ 68C432E0] faac: frame decoding failed: è¯áhÌÌÌÌÌÌÌÌÌÌÌÌ

The size for each frame to decode is 192 Byte.

I used follow funcs.

// Codec_id = CODEC_ID_MPEG4AAC
int CFFDecode::InitAudio(int codec_id)
{
m_codecAudio = avcodec_find_decoder((CodecID)codec_id);
if (m_codecAudio == NULL) {DbgOut("avcodec_find_decoder fail");return 
E_FAIL;}


m_cA = avcodec_alloc_context();
if (m_cA == NULL) {DbgOut("avcodec_alloc_context error");return 
E_OUTOFMEMORY;}
avcodec_get_context_defaults2(m_cA, CODEC_TYPE_AUDIO);

m_cA->codec_id = (CodecID) codec_id;
m_cA->codec_type = CODEC_TYPE_AUDIO;
int iRetOpen = avcodec_open(m_cA, m_codecAudio);
if ( iRetOpen < 0) {
DbgOutInt("avcodec_open Audio error:",iRetOpen);
av_log(m_c, AV_LOG_DEBUG, "Fail avcodec_open\n");
return E_FAIL;

}
log("FFInit Decode Audio completed\n");
return S_OK;
}

int CFFDecode::DecodeAudio(unsigned char* pDataOut, long *plSizeOut, 
unsigned char* pDataIn, long lSizeInt)
{
int ret = m_cA->codec->decode(m_cA, (int16_t*)pDataOut, (int*)plSizeOut, 
pDataIn, lSizeInt);
m_cA->frame_number++;
return ret;
}



Help pls.
thanks
_______________________________________________
libav-user mailing list
[email protected]
https://lists.mplayerhq.hu/mailman/listinfo/libav-user

Reply via email to