[MPlayer-users] error compiling: libao2: missing AFMT_U* defines

Walter Haidinger walter.haidinger at gmx.at
Fri Dec 31 15:26:31 CET 2004


Hi!

FYI: There is a patch to libao2/ao_oss.c of the latest CVS tree attached.

On Thu, 30 Dec 2004, Reimar Döffinger wrote:

> I was complaining a bit about that "definitly". Things aren't quite that
> simple IMHO...

Yes, that's a strong word and probably not the best choice! ;-)

> > The only thing the OSS people are saying is, that they only provide 
> > defines for formats they support. Any application that require other (like 
> > mplayer) should bring its own. Makes sense me, or not?
> 
> Not really. It leads to ifdef hell, where every application using it
> needs hundreds of ifdefs if it wants to support all features that some
> version has.

I would agree if it was a library. But for a hardware driver?
I think there is no point in providing something that isn't even there.
Say, constants for unsupported formats.
 
> Well and my opinion is that who says signed should say unsigned too ;-)

Ok, one should suppose that. Unfortunately you cannot get away with that 
too often... ;-)

> My main point is that it needs a lot of #ifdefs when the header is free
> to defines whatever formats it wants - a certain an easy to check scheme
> would be more helpful.

Yes, indeed.
 
> They aren't needed for anything internal so when OSS doesn't support
> them in the header there is no reason to define them - just don't
> compile the parts that try to use them (so e.g. put a
> #ifdef AFMT_U24_LE/#endif block around every place that uses
> AFMT_U24_LE).

Oh, that easy! Well, all it took was extending two already exiting #ifdefs 
twice. The small patch is attached. Do you merge it into CVS or do I have 
to send to somebody else?

If so: Issue resolved, thread ends. :-)

Isn't that a good way to end a year?!

Regards, Walter
-------------- next part --------------
*** libao2/ao_oss.c.orig	2004-12-29 20:26:01.000000000 +0100
--- libao2/ao_oss.c	2004-12-31 15:06:51.543459619 +0100
***************
*** 50,62 ****
      case AF_FORMAT_U16_BE: return AFMT_U16_BE;
      case AF_FORMAT_S16_LE: return AFMT_S16_LE;
      case AF_FORMAT_S16_BE: return AFMT_S16_BE;
! #ifdef AFMT_S24_LE
      case AF_FORMAT_U24_LE: return AFMT_U24_LE;
      case AF_FORMAT_U24_BE: return AFMT_U24_BE;
      case AF_FORMAT_S24_LE: return AFMT_S24_LE;
      case AF_FORMAT_S24_BE: return AFMT_S24_BE;
  #endif
! #ifdef AFMT_S32_LE
      case AF_FORMAT_U32_LE: return AFMT_U32_LE;
      case AF_FORMAT_U32_BE: return AFMT_U32_BE;
      case AF_FORMAT_S32_LE: return AFMT_S32_LE;
--- 50,62 ----
      case AF_FORMAT_U16_BE: return AFMT_U16_BE;
      case AF_FORMAT_S16_LE: return AFMT_S16_LE;
      case AF_FORMAT_S16_BE: return AFMT_S16_BE;
! #if defined(AFMT_S24_LE) && defined(AFMT_U24_BE) && defined(AFMT_S24_LE) && defined(AFMT_S24_BE)
      case AF_FORMAT_U24_LE: return AFMT_U24_LE; 
      case AF_FORMAT_U24_BE: return AFMT_U24_BE;
      case AF_FORMAT_S24_LE: return AFMT_S24_LE;
      case AF_FORMAT_S24_BE: return AFMT_S24_BE;
  #endif
! #if defined(AFMT_S32_LE) && defined(FORMAT_S32_BE) && defined(AFMT_U32_LE) && defined(AFMT_U32_BE)
      case AF_FORMAT_U32_LE: return AFMT_U32_LE;
      case AF_FORMAT_U32_BE: return AFMT_U32_BE;
      case AF_FORMAT_S32_LE: return AFMT_S32_LE;
***************
*** 90,102 ****
      case AFMT_U16_BE: return AF_FORMAT_U16_BE;
      case AFMT_S16_LE: return AF_FORMAT_S16_LE;
      case AFMT_S16_BE: return AF_FORMAT_S16_BE;
! #ifdef AFMT_S24_LE
      case AFMT_U24_LE: return AF_FORMAT_U24_LE;
      case AFMT_U24_BE: return AF_FORMAT_U24_BE;
      case AFMT_S24_LE: return AF_FORMAT_S24_LE;
      case AFMT_S24_BE: return AF_FORMAT_S24_BE;
  #endif
! #ifdef AFMT_S32_LE
      case AFMT_U32_LE: return AF_FORMAT_U32_LE;
      case AFMT_U32_BE: return AF_FORMAT_U32_BE;
      case AFMT_S32_LE: return AF_FORMAT_S32_LE;
--- 90,102 ----
      case AFMT_U16_BE: return AF_FORMAT_U16_BE;
      case AFMT_S16_LE: return AF_FORMAT_S16_LE;
      case AFMT_S16_BE: return AF_FORMAT_S16_BE;
! #if defined(AFMT_S24_LE) && defined(AFMT_U24_BE) && defined(AFMT_S24_LE) && defined(AFMT_S24_BE)
      case AFMT_U24_LE: return AF_FORMAT_U24_LE;
      case AFMT_U24_BE: return AF_FORMAT_U24_BE;
      case AFMT_S24_LE: return AF_FORMAT_S24_LE;
      case AFMT_S24_BE: return AF_FORMAT_S24_BE;
  #endif
! #if defined(AFMT_S32_LE) && defined(FORMAT_S32_BE) && defined(AFMT_U32_LE) && defined(AFMT_U32_BE)
      case AFMT_U32_LE: return AF_FORMAT_U32_LE;
      case AFMT_U32_BE: return AF_FORMAT_U32_BE;
      case AFMT_S32_LE: return AF_FORMAT_S32_LE;


More information about the MPlayer-users mailing list