[MPlayer-cvslog] CVS: main/libao2 ao_oss.c,1.46,1.47

Reimar Döffinger Reimar.Doeffinger at stud.uni-karlsruhe.de
Tue Dec 28 11:49:13 CET 2004


Hi,
> Modified Files:
> 	ao_oss.c 
> Log Message:
> 100l set default format for AF_FORMATs not supported by sound card
> 
> 
> Index: ao_oss.c
> ===================================================================
> RCS file: /cvsroot/mplayer/main/libao2/ao_oss.c,v
> retrieving revision 1.46
> retrieving revision 1.47
> diff -u -r1.46 -r1.47
> --- ao_oss.c	27 Dec 2004 17:30:13 -0000	1.46
> +++ ao_oss.c	28 Dec 2004 01:59:12 -0000	1.47
> @@ -256,15 +256,21 @@
>  ac3_retry:  
>    ao_data.format=format;
>    oss_format=format2oss(format);
> -  if (oss_format == -1) return 0;
> +  if (oss_format == -1) {
> +#ifdef WORDS_BIGENDIAN
> +    oss_format=AFMT_S16_BE;
> +    format=AF_FORMAT_S16_BE;
> +#else
> +    oss_format=AFMT_S16_LE;
> +    format=AF_FORMAT_S16_LE;
> +#endif
> +  }
>    if( ioctl(audio_fd, SNDCTL_DSP_SETFMT, &oss_format)<0 ||
>        oss_format != format2oss(format)) if(format == AF_FORMAT_AC3){
>      mp_msg(MSGT_AO,MSGL_WARN, MSGTR_AO_OSS_CantSetAC3, dsp);
>  #ifdef WORDS_BIGENDIAN
> -    oss_format=AFMT_S16_BE;
>      format=AF_FORMAT_S16_BE;
>  #else
> -    oss_format=AFMT_S16_LE;
>      format=AF_FORMAT_S16_LE;
>  #endif

Removing these is wrong AFAICT. Also you should use the _NE variants
instead of these ugly ifdefs (at least for the AF_FORMAT_ variants,
don't know if OSS always defines them.

Greetings,
Reimar Döffinger




More information about the MPlayer-cvslog mailing list