From 8914247dc19f167a67c07176a25c74ef8d328e8d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20B=C5=93sch?= Date: Tue, 13 Nov 2012 13:16:43 +0200 Subject: [PATCH] ffserver: use avcodec_descriptor_get_by_name() to identify codec id. That way, configuration such as "AudioCodec mp3" will work. --- ffserver.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ffserver.c b/ffserver.c index d224b41..0d2a8a7 100644 --- a/ffserver.c +++ b/ffserver.c @@ -3937,7 +3937,7 @@ static void add_codec(FFStream *stream, AVCodecContext *av) static enum AVCodecID opt_audio_codec(const char *arg) { - AVCodec *p= avcodec_find_encoder_by_name(arg); + const AVCodecDescriptor *p = avcodec_descriptor_get_by_name(arg); if (p == NULL || p->type != AVMEDIA_TYPE_AUDIO) return AV_CODEC_ID_NONE; @@ -3947,7 +3947,7 @@ static enum AVCodecID opt_audio_codec(const char *arg) static enum AVCodecID opt_video_codec(const char *arg) { - AVCodec *p= avcodec_find_encoder_by_name(arg); + const AVCodecDescriptor *p = avcodec_descriptor_get_by_name(arg); if (p == NULL || p->type != AVMEDIA_TYPE_VIDEO) return AV_CODEC_ID_NONE; -- 1.7.10.4