void alogg_stop_autopoll_oggstream(ALOGG_OGGSTREAM *ogg) {
  /* return if we are already not auto polling */
  if (!ogg->auto_polling)
    return;

  ogg->auto_polling = FALSE;

  /* only remove the interrupt if we were already playing */
  /* otherwise, stop will do*/
  if (alogg_is_playing_oggstream(ogg))
    remove_param_int(&alogg_autopoll_oggstream, (void *)ogg);
}
void alogg_stop_oggstream(ALOGG_OGGSTREAM *ogg) {
  /* continue if we are playing it */
  if (!alogg_is_playing_oggstream(ogg))
    return;

  /* remove the interrupt, if we were using autopolling */
  if (ogg->auto_polling)
    remove_param_int(&alogg_autopoll_oggstream, (void *)ogg);

  /* stop the audio stream */
  stop_audio_stream(ogg->audiostream);
  ogg->audiostream = NULL;
}
Exemple #3
0
void apeg_set_stream_rate(APEG_STREAM *stream, float multiple)
{
	if(multiple < 0.0f)
		return;

	if((stream->flags&APEG_HAS_AUDIO))
		_apeg_audio_set_speed_multiple((APEG_LAYER*)stream, multiple);

	if((stream->flags&APEG_HAS_VIDEO))
	{
		// Make sure the multiple is large enough
		float fps = stream->frame_rate * multiple;
		if(fps > 0.0f)
			install_param_int_ex(timer_proc, (void*)&(stream->timer),
			                     FPS_TO_TIMER(fps));
		else
			remove_param_int(timer_proc, (void*)&(stream->timer));
	}

	((APEG_LAYER*)stream)->multiple = multiple;
}
Exemple #4
0
// Closes an opened APEG_STREAM
void apeg_close_stream(APEG_STREAM *stream)
{
	APEG_LAYER *layer = (APEG_LAYER*)stream;
	if(layer)
	{
		_apeg_start_audio(layer, FALSE);

		remove_param_int(timer_proc, (void*)&(layer->stream.timer));

		destroy_bitmap(layer->stream.bitmap);

		alogg_cleanup(layer);

		free(layer->fname);

		free(layer->image_ptr);
		free(layer->audio.pcm.samples);

		UNLOCK_DATA(layer, sizeof(APEG_LAYER));
		free(layer);
	}
}
Exemple #5
0
void alogg_stop_ogg(ALOGG_OGG *ogg) {
  /* continue if we are playing it */
  if (!alogg_is_playing_ogg(ogg))
    return;

  /* remove the interrupt, if we were using autopolling */
  if (ogg->auto_polling)
    remove_param_int(&alogg_autopoll_ogg, (void *)ogg);

  /* stop the audio stream */
  stop_audio_stream(ogg->audiostream);
  ogg->audiostream = NULL;
  if (ogg->time_stretch_buffer[0])
  {
    free(ogg->time_stretch_buffer[0]);
	ogg->time_stretch_buffer[0] = NULL;
  }
  if (ogg->time_stretch_buffer[1])
  {
    free(ogg->time_stretch_buffer[1]);
    ogg->time_stretch_buffer[1] = NULL;
  }
}