changeset 177:53da914d6f46 libavcodec

avcodec_find_encoder_by_name() patch by Alex
author arpi_esp
date Sun, 23 Dec 2001 22:25:18 +0000
parents 9ce215ee9216
children 374f80a78f0d
files avcodec.h utils.c
diffstat 2 files changed, 13 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/avcodec.h	Sun Dec 16 12:44:34 2001 +0000
+++ b/avcodec.h	Sun Dec 23 22:25:18 2001 +0000
@@ -230,6 +230,7 @@
 
 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);
--- a/utils.c	Sun Dec 16 12:44:34 2001 +0000
+++ b/utils.c	Sun Dec 23 22:25:18 2001 +0000
@@ -155,6 +155,18 @@
     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;