[MPlayer-cvslog] r34842 - in trunk/libao2: ao_alsa.c ao_oss.c audio_out.c audio_out_internal.h

Reimar Döffinger Reimar.Doeffinger at gmx.de
Fri Apr 6 00:32:22 CEST 2012


On Fri, Apr 06, 2012 at 12:29:37AM +0200, reimar wrote:
> Author: reimar
> Date: Fri Apr  6 00:29:37 2012
> New Revision: 34842
> 
> Log:
> Use approach used by ao_oss to avoid audio desync
> when framestepping with ao_alsa and no hardware pause
> support.
> This fixes bug #2052.
> 
> Modified:
>    trunk/libao2/ao_alsa.c
>    trunk/libao2/ao_oss.c
>    trunk/libao2/audio_out.c
>    trunk/libao2/audio_out_internal.h
> 
> Modified: trunk/libao2/ao_alsa.c
> ==============================================================================
> --- trunk/libao2/ao_alsa.c	Thu Apr  5 23:59:09 2012	(r34841)
> +++ trunk/libao2/ao_alsa.c	Fri Apr  6 00:29:37 2012	(r34842)
> @@ -65,6 +65,7 @@ static snd_pcm_sw_params_t *alsa_swparam
>  static size_t bytes_per_sample;
>  
>  static int alsa_can_pause;
> +static int prepause_space;
>  
>  #define ALSA_DEVICE_SIZE 256
>  
> @@ -691,6 +692,7 @@ static void audio_pause(void)
>          }
>            mp_msg(MSGT_AO,MSGL_V,"alsa-pause: pause supported by hardware\n");
>      } else {
> +        prepause_space = get_space();
>          if ((err = snd_pcm_drop(alsa_handler)) < 0)
>          {
>              mp_msg(MSGT_AO,MSGL_ERR,MSGTR_AO_ALSA_PcmDropError, snd_strerror(err));
> @@ -720,6 +722,7 @@ static void audio_resume(void)
>             mp_msg(MSGT_AO,MSGL_ERR,MSGTR_AO_ALSA_PcmPrepareError, snd_strerror(err));
>              return;
>          }
> +        mp_ao_resume_refill(&audio_out_alsa, prepause_space);

Note that this requires only 3 lines of code, so maintainers of other
aos are very welcome to add this for all where it makes sense.


More information about the MPlayer-cvslog mailing list