diff options
author | Stefano Sabatini <stefano.sabatini-lala@poste.it> | 2011-08-18 12:27:44 +0200 |
---|---|---|
committer | Stefano Sabatini <stefano.sabatini-lala@poste.it> | 2011-08-20 14:20:25 +0200 |
commit | 69e2c1a95ac4dd00cb09ba3a166efc1275f5ba40 (patch) | |
tree | a3a32177a562feb4d7ef1a7e3ad82e09769ec29a /libavutil/utils.c | |
parent | 31ac0ac29b6bba744493f7d1040757a3f51b9ad7 (diff) | |
download | ffmpeg-69e2c1a95ac4dd00cb09ba3a166efc1275f5ba40.tar.gz |
lavu: add av_get_media_type_string() convenience function
Avoid code duplication.
Diffstat (limited to 'libavutil/utils.c')
-rw-r--r-- | libavutil/utils.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/libavutil/utils.c b/libavutil/utils.c index c77a060443..e6c8424ab4 100644 --- a/libavutil/utils.c +++ b/libavutil/utils.c @@ -40,6 +40,18 @@ const char *avutil_license(void) return LICENSE_PREFIX FFMPEG_LICENSE + sizeof(LICENSE_PREFIX) - 1; } +const char *av_get_media_type_string(enum AVMediaType media_type) +{ + switch (media_type) { + case AVMEDIA_TYPE_VIDEO: return "video"; + case AVMEDIA_TYPE_AUDIO: return "audio"; + case AVMEDIA_TYPE_DATA: return "data"; + case AVMEDIA_TYPE_SUBTITLE: return "subtitle"; + case AVMEDIA_TYPE_ATTACHMENT: return "attachment"; + default: return NULL; + } +} + char av_get_picture_type_char(enum AVPictureType pict_type) { switch (pict_type) { |