diff options
author | alex <alex@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2004-12-28 18:13:09 +0000 |
---|---|---|
committer | alex <alex@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2004-12-28 18:13:09 +0000 |
commit | e8739c6d9276cd05361b061a2510e26b84c53cec (patch) | |
tree | 8cbc0ab4d6d3d904843b1f80b24a71367c4ced4f | |
parent | eb7911b7ad28bc7dfb3a1517a052fb0a4b81f83f (diff) |
af_fmt2str_short
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@14264 b3059339-0415-0410-9bf9-f77b7e298cf2
-rw-r--r-- | libaf/af_format.c | 33 | ||||
-rw-r--r-- | libaf/af_format.h | 1 |
2 files changed, 34 insertions, 0 deletions
diff --git a/libaf/af_format.c b/libaf/af_format.c index 00362a9ab1..5237804fbc 100644 --- a/libaf/af_format.c +++ b/libaf/af_format.c @@ -130,6 +130,8 @@ char* af_fmt2str(int format, char* str, int size) i+=snprintf(&str[i],size-i,"MPEG 2 "); break; case(AF_FORMAT_AC3): i+=snprintf(&str[i],size-i,"AC3 "); break; + case(AF_FORMAT_IMA_ADPCM): + i+=snprintf(&str[i],size-i,"IMA ADPCM "); break; default: printf("Unknown special\n"); } @@ -155,6 +157,37 @@ char* af_fmt2str(int format, char* str, int size) return str; } +char *af_fmt2str_short(int format) +{ + switch(format) + { + // special + case AF_FORMAT_MU_LAW: return "mulaw"; + case AF_FORMAT_A_LAW: return "alaw"; + case AF_FORMAT_MPEG2: return "mpeg2"; + case AF_FORMAT_AC3: return "ac3"; + case AF_FORMAT_IMA_ADPCM: return "imaadpcm"; + // ordinary + case AF_FORMAT_U8: return "u8"; + case AF_FORMAT_S8: return "s8"; + case AF_FORMAT_U16_LE: return "u16le"; + case AF_FORMAT_U16_BE: return "u16be"; + case AF_FORMAT_S16_LE: return "s16le"; + case AF_FORMAT_S16_BE: return "s16be"; + case AF_FORMAT_U24_LE: return "u24le"; + case AF_FORMAT_U24_BE: return "u24be"; + case AF_FORMAT_S24_LE: return "s24le"; + case AF_FORMAT_S24_BE: return "s24be"; + case AF_FORMAT_U32_LE: return "u32le"; + case AF_FORMAT_U32_BE: return "u32be"; + case AF_FORMAT_S32_LE: return "s32le"; + case AF_FORMAT_S32_BE: return "s32be"; + case AF_FORMAT_FLOAT_LE: return "floatle"; + case AF_FORMAT_FLOAT_BE: return "floatbe"; + } + return "??"; +} + // Helper functions to check sanity for input arguments // Sanity check for bytes per sample diff --git a/libaf/af_format.h b/libaf/af_format.h index 82eac84817..3fa2bcf140 100644 --- a/libaf/af_format.h +++ b/libaf/af_format.h @@ -83,5 +83,6 @@ extern int af_str2fmt(char *str); extern int af_fmt2bits(int format); extern char* af_fmt2str(int format, char* str, int size); +extern char* af_fmt2str_short(int format); #endif /* __af_format_h__ */ |