diff options
author | Diego 'Flameeyes' Pettenò <flameeyes@gmail.com> | 2007-04-07 21:21:35 +0200 |
---|---|---|
committer | Diego 'Flameeyes' Pettenò <flameeyes@gmail.com> | 2007-04-07 21:21:35 +0200 |
commit | 72502048605f35642f421bd256021dbd93482728 (patch) | |
tree | 71cba6df0416fc429171cef5b53f24057ef60275 /src/audio_out/audio_alsa_out.c | |
parent | 7fb0e4d32e5a7ccc121c42e043db795286e1a567 (diff) | |
parent | b56784ba37622f28147b6a10c7ba77f9c9fbf2f7 (diff) | |
download | xine-lib-72502048605f35642f421bd256021dbd93482728.tar.gz xine-lib-72502048605f35642f421bd256021dbd93482728.tar.bz2 |
Merge changes from main repository.
Diffstat (limited to 'src/audio_out/audio_alsa_out.c')
-rw-r--r-- | src/audio_out/audio_alsa_out.c | 20 |
1 files changed, 6 insertions, 14 deletions
diff --git a/src/audio_out/audio_alsa_out.c b/src/audio_out/audio_alsa_out.c index 3651d21da..6ad78da2a 100644 --- a/src/audio_out/audio_alsa_out.c +++ b/src/audio_out/audio_alsa_out.c @@ -265,10 +265,7 @@ static long ao_alsa_get_volume_from_percent(int val, long min, long max) { * Error callback, we need to control this, * error message should be printed only in DEBUG mode. */ -static void -#ifdef __GNUC__ - __attribute__((format (printf, 5, 6))) -#endif +static void XINE_FORMAT_PRINTF(5, 6) error_callback(const char *file, int line, const char *function, int err, const char *fmt, ...) { #ifdef DEBUG @@ -663,15 +660,7 @@ static int ao_alsa_delay (ao_driver_t *this_gen) { struct timeval now; printf("audio_alsa_out:delay:ENTERED\n"); #endif - err=snd_pcm_delay( this->audio_fd, &delay ); - - int state = snd_pcm_state(this->audio_fd); - - /* check for idle states, which need to be handled as delay=0 */ - if(state == SND_PCM_STATE_PREPARED || state == SND_PCM_STATE_PAUSED || - state == SND_PCM_STATE_OPEN || SND_PCM_STATE_XRUN) { - return 0; - } + err = snd_pcm_delay( this->audio_fd, &delay ); #ifdef LOG_DEBUG printf("audio_alsa_out:delay:delay all=%ld err=%d\n",delay, err); @@ -679,8 +668,11 @@ static int ao_alsa_delay (ao_driver_t *this_gen) { printf("audio_alsa_out:delay: Time = %ld.%ld\n", now.tv_sec, now.tv_usec); printf("audio_alsa_out:delay:FINISHED\n"); #endif - return delay; + if (err || (delay < 0)) + delay = 0; + + return delay; } #if 0 |