Exemplo n.º 1
0
void EPOCAudio::Close(Bool and_wait)
{
	u32 i;
	if (m_stream) {
		if (state==EPOC_AUDIO_PLAY) {
#if 0
			m_stream->Stop();

			while (0 && and_wait) {

				if (state != EPOC_AUDIO_PLAY) break;
				gf_sleep(1);

				TInt error;
				CActiveScheduler::RunIfReady(error, CActive::EPriorityIdle);
			}
#endif
		}
		delete m_stream;
		m_stream = NULL;
	}
	for (i=0; i<num_buffers; i++) {
		if (buffers[i]) gf_free(buffers[i]);
		buffers[i] = NULL;
	}
	num_buffers = 0;
	state = EPOC_AUDIO_INIT;
	GF_LOG(GF_LOG_DEBUG, GF_LOG_MMIO, ("[EPOCAudio] output audio stream closed\n"));
}
Exemplo n.º 2
0
void CPjAudioOutputEngine::Stop()
{
    // Stop stream if it's playing
    if (iOutputStream_ && state_ != STATE_INACTIVE) {
    	lastError_ = KRequestPending;
    	iOutputStream_->Stop();

	// Wait until it's actually stopped
    	while (lastError_ == KRequestPending)
	    pj_symbianos_poll(-1, 100);
    }
    
    if (iOutputStream_) {	
	delete iOutputStream_;
	iOutputStream_ = NULL;
    }
    
    if (startAsw_.IsStarted()) {
	startAsw_.AsyncStop();
    }
    
    state_ = STATE_INACTIVE;
}