[MPlayer-dev-eng] [PATCH] RFC: CrystalHD decoder support

Reimar Döffinger Reimar.Doeffinger at gmx.de
Wed Dec 22 14:02:21 CET 2010


On Wed, Dec 22, 2010 at 01:31:40PM +0100, Diego Biurrun wrote:
> > +static uint8_t name2subtype(Priv *priv, const char *name)
> > +{
> > +   if (strcmp(name, "chddivx") == 0) {
> > +      return BC_MSUBTYPE_DIVX;
> > +   } else if (strcmp(name, "chddivx3") == 0) {
> > +      return BC_MSUBTYPE_DIVX311;
> > +   } else if (strcmp(name, "chdmpeg1") == 0) {
> > +      return BC_MSUBTYPE_MPEG1VIDEO;
> > +   } else if (strcmp(name, "chdmpeg2") == 0) {
> > +      return BC_MSUBTYPE_MPEG2VIDEO;
> > +   } else if (strcmp(name, "chdvc1") == 0) {
> > +      return BC_MSUBTYPE_VC1;
> > +   } else if (strcmp(name, "chdwvc1") == 0) {
> > +      return BC_MSUBTYPE_WVC1;
> > +   } else if (strcmp(name, "chdwmv3") == 0) {
> > +      return BC_MSUBTYPE_WMV3;
> > +   } else if (strcmp(name, "chdwmva") == 0) {
> > +      return BC_MSUBTYPE_WMVA;
> > +   } else if (strcmp(name, "chdh264") == 0) {
> > +      return priv->is_avc ? BC_MSUBTYPE_AVC1 : BC_MSUBTYPE_H264;
> > +   } else {
> > +      return BC_MSUBTYPE_INVALID;
> 
> switch?

Uh, C does not have a switch for strings.
An array lookup would be possible, but not sure if that's a good idea.


More information about the MPlayer-dev-eng mailing list