[MPlayer-dev-eng] [PATCH 1/5] ao_alsa: remove mmap support

Reimar Döffinger Reimar.Doeffinger at stud.uni-karlsruhe.de
Wed Feb 1 20:04:20 CET 2006


Hi,
On Mon, Jan 30, 2006 at 09:14:32AM +0100, Clemens Ladisch wrote:
> This patch removes mmap support because it doesn't have any benefit.

Well, at least normally our CVS policy forbids removing features...

>          return 0;
>      }
> +    if (ao_mmap)
> +      mp_msg(MSGT_AO,MSGL_WARN,"alsa-init: mmap option is obsolete and has no effect");

IMHO, just remove the suboption instead.

> @@ -448,10 +445,7 @@ static int init(int rate_hz, int channel
>  	  break;
>  	default:
>  	  alsa_fragcount = 16;
> -	  if (ao_mmap)
> -	    chunk_size = 512;
> -	  else
> -	    chunk_size = 1024;
> +	  chunk_size = 1024;
>  	  break;
>  	}
>      }
> @@ -492,18 +486,8 @@ static int init(int rate_hz, int channel
>  	  return(0);
>  	}
>      
> -      if (ao_mmap) {
> -	snd_pcm_access_mask_t *mask = alloca(snd_pcm_access_mask_sizeof());
> -	snd_pcm_access_mask_none(mask);
> -	snd_pcm_access_mask_set(mask, SND_PCM_ACCESS_MMAP_INTERLEAVED);
> -	snd_pcm_access_mask_set(mask, SND_PCM_ACCESS_MMAP_NONINTERLEAVED);
> -	snd_pcm_access_mask_set(mask, SND_PCM_ACCESS_MMAP_COMPLEX);
> -	err = snd_pcm_hw_params_set_access_mask(alsa_handler, alsa_hwparams, mask);
> -	mp_msg(MSGT_AO,MSGL_INFO,"alsa-init: mmap set\n");
> -      } else {
> -	err = snd_pcm_hw_params_set_access(alsa_handler, alsa_hwparams,
> -					   SND_PCM_ACCESS_RW_INTERLEAVED);
> -      }
> +      err = snd_pcm_hw_params_set_access(alsa_handler, alsa_hwparams,
> +					 SND_PCM_ACCESS_RW_INTERLEAVED);
>        if (err < 0) {
>  	mp_msg(MSGT_AO,MSGL_ERR,"alsa-init: unable to set access type: %s\n", 
>  	       snd_strerror(err));
[...]
> @@ -863,7 +817,7 @@ static int play(void* data, int len, int
>      thanxs for marius <marius at rospot.com> for giving us the light ;)
>  */
>  
> -static int play_normal(void* data, int len)
> +static int play(void* data, int len, int flags)
>  {

These (and I think another one I somehow missed) are cosmetics, please make
sure that code you didn't change doesn't appear in the diff.
If the end result really looks too ugly it can still be fixed
afterwards.

Greetings,
Reimar Döffinger




More information about the MPlayer-dev-eng mailing list