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

Roberto Togni r_togni at tiscali.it
Tue Dec 28 12:20:45 CET 2004


On 2004.12.28 11:49, Reimar Döffinger wrote:
> 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

The line after the  #endif is "goto ac3_retry;", so oss_format get  
filled by the call to format2oss()

> instead of these ugly ifdefs (at least for the AF_FORMAT_ variants,
> don't know if OSS always defines them.

#ifdef were there before alex patch, so i assume that oss does not  
define them. Will check it.

Ciao,
 Roberto





More information about the MPlayer-cvslog mailing list