Commit b8cd2061 authored by stefano's avatar stefano

Factorize: use the X_NE() macro in avcodec_get_pix_fmt().


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@18160 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 0269e1bd
...@@ -507,20 +507,14 @@ static enum PixelFormat avcodec_get_pix_fmt_internal(const char *name) ...@@ -507,20 +507,14 @@ static enum PixelFormat avcodec_get_pix_fmt_internal(const char *name)
enum PixelFormat avcodec_get_pix_fmt(const char *name) enum PixelFormat avcodec_get_pix_fmt(const char *name)
{ {
#ifdef WORDS_BIGENDIAN
# define NE "be"
#else
# define NE "le"
#endif
enum PixelFormat pix_fmt = avcodec_get_pix_fmt_internal(name); enum PixelFormat pix_fmt = avcodec_get_pix_fmt_internal(name);
if (pix_fmt == PIX_FMT_NONE) { if (pix_fmt == PIX_FMT_NONE) {
char name2[32]; char name2[32];
snprintf(name2, sizeof(name2), "%s%s", name, NE); snprintf(name2, sizeof(name2), "%s%s", name, X_NE("be", "le"));
pix_fmt = avcodec_get_pix_fmt_internal(name2); pix_fmt = avcodec_get_pix_fmt_internal(name2);
} }
return pix_fmt; return pix_fmt;
#undef NE
} }
void avcodec_pix_fmt_string (char *buf, int buf_size, enum PixelFormat pix_fmt) void avcodec_pix_fmt_string (char *buf, int buf_size, enum PixelFormat pix_fmt)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment