diff --git a/lib/codeclib.c b/lib/codeclib.c index df5934343..3df3f57e4 100644 --- a/lib/codeclib.c +++ b/lib/codeclib.c @@ -444,18 +444,6 @@ const codec_def_t *codec_find_by_av(enum AVCodecID id) { return g_hash_table_lookup(codecs_ht_by_av, GINT_TO_POINTER(id)); } -enum media_type codec_get_type(const str *type) { - if (!type || !type->len) - return MT_UNKNOWN; - if (!str_cmp(type, "audio")) - return MT_AUDIO; - if (!str_cmp(type, "video")) - return MT_VIDEO; - if (!str_cmp(type, "image")) - return MT_IMAGE; - return MT_OTHER; -} - diff --git a/lib/codeclib.h b/lib/codeclib.h index 87dc7fd1f..751a5fe3d 100644 --- a/lib/codeclib.h +++ b/lib/codeclib.h @@ -16,6 +16,21 @@ enum media_type { }; +#include "str.h" + +INLINE enum media_type codec_get_type(const str *type) { + if (!type || !type->len) + return MT_UNKNOWN; + if (!str_cmp(type, "audio")) + return MT_AUDIO; + if (!str_cmp(type, "video")) + return MT_VIDEO; + if (!str_cmp(type, "image")) + return MT_IMAGE; + return MT_OTHER; +} + + #ifndef WITHOUT_CODECLIB @@ -27,7 +42,6 @@ enum media_type { #include #include #endif -#include "str.h" @@ -198,7 +212,6 @@ void codeclib_init(int); const codec_def_t *codec_find(const str *name, enum media_type); const codec_def_t *codec_find_by_av(enum AVCodecID); -enum media_type codec_get_type(const str *type); decoder_t *decoder_new_fmt(const codec_def_t *def, int clockrate, int channels, int ptime, const format_t *resample_fmt); @@ -275,9 +288,6 @@ INLINE void codeclib_init(int print) { printf("No codecs supported.\n"); } -INLINE enum media_type codec_get_type(const str *type) { - return -1; -} INLINE const codec_def_t *codec_find(const str *name, enum media_type type) { return NULL; }