Commit a4ff40ee authored by michael's avatar michael

avoid using first_avcodec


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@11205 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent f23f1c2e
...@@ -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