aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArpi <arpi@thot.banki.hu>2001-12-23 22:25:18 +0000
committerArpi <arpi@thot.banki.hu>2001-12-23 22:25:18 +0000
commit98f3b098f9e3582ffaee736816ffa6b5f7859d87 (patch)
treee964ae5c659d73b587321455f720ced2bf3d59c9
parent627690b5a2899571d213380210ab3c4118270144 (diff)
downloadffmpeg-98f3b098f9e3582ffaee736816ffa6b5f7859d87.tar.gz
avcodec_find_encoder_by_name() patch by Alex
Originally committed as revision 237 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r--libavcodec/avcodec.h1
-rw-r--r--libavcodec/utils.c12
2 files changed, 13 insertions, 0 deletions
diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index 10d19a9c31..9b027091e2 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -230,6 +230,7 @@ void avcodec_init(void);
void register_avcodec(AVCodec *format);
AVCodec *avcodec_find_encoder(enum CodecID id);
+AVCodec *avcodec_find_encoder_by_name(const char *name);
AVCodec *avcodec_find_decoder(enum CodecID id);
AVCodec *avcodec_find_decoder_by_name(const char *name);
void avcodec_string(char *buf, int buf_size, AVCodecContext *enc, int encode);
diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index 01c1c13c65..0e6ba29d7a 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -155,6 +155,18 @@ AVCodec *avcodec_find_encoder(enum CodecID id)
return NULL;
}
+AVCodec *avcodec_find_encoder_by_name(const char *name)
+{
+ AVCodec *p;
+ p = first_avcodec;
+ while (p) {
+ if (p->encode != NULL && strcmp(name,p->name) == 0)
+ return p;
+ p = p->next;
+ }
+ return NULL;
+}
+
AVCodec *avcodec_find_decoder(enum CodecID id)
{
AVCodec *p;