|
请教各位大侠,我用PCM_Strm_Open()系列函数播放音频数据,音频流播放完毕后怎么没有收到MEDIA_END事件?
代码如下:
void Test_PCM_PlayHandler(MHdl *mhdl, Media_Event event)
{
switch(event)
{
case MEDIA_ERROR:
wls_trace_str("Media Error.\n");
break;
case MEDIA_END:
wls_trace_str("Media End.\n");
g_hPCM->Close(g_hPCM);
g_hPCM = NULL;
break;
case MEDIA_NONE:
wls_trace_str("Media None.\n");
break;
case MEDIA_DATA_REQUEST:
wls_trace_str("Media Data Request.\n");
case MEDIA_DATA_NOTIFICATION:
wls_trace_str("Media Data Notification.\n");
break;
default:
wls_trace_str("Media Other Event.\n");
break;
}
}
g_hPCM = PCM_Strm_Open(Test_PCM_PlayHandler, &vpFormat);
g_hPCM->SetBuffer(g_hPCM, (kal_uint8*)pBuf, nFileSize);
g_hPCM->GetWriteBuffer(g_hPCM, &lpBuf, &nBufLen);
g_hPCM->WriteDataDone(g_hPCM, nPCMLen);
g_hPCM->Play();
我只能收到MEDIA_DATA_REQUEST和MEDIA_DATA_NOTIFICATION事件,收不到MEDIA_END事件,是怎么回事?音频流一直处于播放状态。 |
|