Example #1
0
void
session_exit(session_t *sp)
{
        codec_exit();
        if (sp->local_file_player) {
                voxlet_destroy(&sp->local_file_player);
        }
	if (sp->tone_generator) {
		tonegen_destroy(&sp->tone_generator);
	}
        if (sp->in_file_converter) {
                converter_destroy(&sp->in_file_converter);
        }
	if (sp->in_file  != NULL) {
                snd_read_close (&sp->in_file);
        }
	if (sp->out_file != NULL) {
                snd_write_close(&sp->out_file);
        }
	if (sp->pdb != NULL) {
		pdb_destroy(&sp->pdb);
	}
        channel_encoder_destroy(&sp->channel_coder);
        source_list_destroy(&sp->active_sources);
	xfree(sp->mbus_engine_addr);
	xfree(sp->mbus_video_addr);
	xfree(sp->mbus_ui_addr);
	xfree(sp);
}
Example #2
0
int
audio_device_release(session_t *sp, audio_desc_t the_dev)
{
        if (sp->audio_device == 0) {
                debug_msg("Audio device already released from session\n");
                return FALSE;
        }

        if (sp->audio_device != the_dev) {
                debug_msg("Releasing wrong device!\n");
                return FALSE;
        }

	/* Mix is going to be destroyed - tone_generator and
	 * voxlet have pointers to mixer in their state that
	 * is about to expire.  Could pass mixer as argument
	 * to their process functions...
	 */
	if (sp->tone_generator) {
		tonegen_destroy(&sp->tone_generator);
	}

	if (sp->local_file_player) {
		voxlet_destroy(&sp->local_file_player);
	}

        cushion_destroy(&sp->cushion);
        mix_destroy(&sp->ms);

        tx_stop(sp->tb);
        tx_destroy(&sp->tb);

        source_list_clear(sp->active_sources);

        audio_close(sp->audio_device);
        sp->audio_device = 0;

        xfree(zero_buf);
        zero_buf = NULL;

        return FALSE;
}