diff options
author | Juergen Keil <jkeil@users.sourceforge.net> | 2002-03-11 19:58:00 +0000 |
---|---|---|
committer | Juergen Keil <jkeil@users.sourceforge.net> | 2002-03-11 19:58:00 +0000 |
commit | a1bc7578243bd93e106fc426374363da16652797 (patch) | |
tree | 616d2ae6848b68cc9cc0e152184c916e12d14fcf /src/xine-engine/audio_out.c | |
parent | 619e78fc07c1b8622eb4f8f43d979fab476c24a2 (diff) | |
download | xine-lib-a1bc7578243bd93e106fc426374363da16652797.tar.gz xine-lib-a1bc7578243bd93e106fc426374363da16652797.tar.bz2 |
Add a "control" method to the audio drivers, to allow pause/resume of the
playback stream and to flush buffered samples from from the audio driver.
(Currently implemented in the 'Sun' audio driver, + some untested code in the
alsa 0.9 driver).
The pause/resume method can be used by the engine to immediatelly stop playing
buffered audio samples when the video is paused.
Flushing buffered samples is useful when a video is stopped. And it'll be
useful for better seeking support, too.
CVS patchset: 1556
CVS date: 2002/03/11 19:58:00
Diffstat (limited to 'src/xine-engine/audio_out.c')
-rw-r--r-- | src/xine-engine/audio_out.c | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/src/xine-engine/audio_out.c b/src/xine-engine/audio_out.c index 56f777469..4d97da9d1 100644 --- a/src/xine-engine/audio_out.c +++ b/src/xine-engine/audio_out.c @@ -17,7 +17,7 @@ * along with self program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: audio_out.c,v 1.44 2002/03/11 12:31:26 guenter Exp $ + * $Id: audio_out.c,v 1.45 2002/03/11 19:58:01 jkeil Exp $ * * 22-8-2001 James imported some useful AC3 sections from the previous alsa driver. * (c) 2001 Andy Lo A Foe <andy@alsaplayer.org> @@ -240,7 +240,8 @@ static void *ao_loop (void *this_gen) { int64_t cur_time; int num_output_frames ; int paused_wait; - + + while ((this->audio_loop_running) || (!this->audio_loop_running && this->out_fifo->first)) { @@ -564,6 +565,20 @@ static int ao_set_property (ao_instance_t *this, int property, int value) { return(this->driver->set_property(this->driver, property, value)); } +static int ao_control (ao_instance_t *this, int cmd, ...) { + + va_list args; + void *arg; + int rval; + + va_start(args, cmd); + arg = va_arg(args, void*); + rval = this->driver->control(this->driver, cmd, arg); + va_end(args); + + return rval; +} + ao_instance_t *ao_new_instance (ao_driver_t *driver, xine_t *xine) { config_values_t *config = xine->config; @@ -585,6 +600,7 @@ ao_instance_t *ao_new_instance (ao_driver_t *driver, xine_t *xine) { this->get_capabilities = ao_get_capabilities; this->get_property = ao_get_property; this->set_property = ao_set_property; + this->control = ao_control; this->audio_loop_running = 0; this->audio_paused = 0; /* FIXME: is 4* good enough for all resample cases?? */ |