Commit 562b2163 authored by Michael Niedermayer's avatar Michael Niedermayer

avoid using first_avcodec

Originally committed as revision 11205 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent 55b9e69a
...@@ -3628,15 +3628,9 @@ static void add_codec(FFStream *stream, AVCodecContext *av) ...@@ -3628,15 +3628,9 @@ static void add_codec(FFStream *stream, AVCodecContext *av)
static int opt_audio_codec(const char *arg) static int opt_audio_codec(const char *arg)
{ {
AVCodec *p; AVCodec *p= avcodec_find_encoder_by_name(arg);
p = first_avcodec; if (p == NULL || p->type != CODEC_TYPE_AUDIO)
while (p) {
if (!strcmp(p->name, arg) && p->type == CODEC_TYPE_AUDIO)
break;
p = p->next;
}
if (p == NULL)
return CODEC_ID_NONE; return CODEC_ID_NONE;
return p->id; return p->id;
...@@ -3644,15 +3638,9 @@ static int opt_audio_codec(const char *arg) ...@@ -3644,15 +3638,9 @@ static int opt_audio_codec(const char *arg)
static int opt_video_codec(const char *arg) static int opt_video_codec(const char *arg)
{ {
AVCodec *p; AVCodec *p= avcodec_find_encoder_by_name(arg);
p = first_avcodec; if (p == NULL || p->type != CODEC_TYPE_VIDEO)
while (p) {
if (!strcmp(p->name, arg) && p->type == CODEC_TYPE_VIDEO)
break;
p = p->next;
}
if (p == NULL)
return CODEC_ID_NONE; return CODEC_ID_NONE;
return p->id; return p->id;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment