comparison utils.c @ 8016:81dba4c59fd6 libavcodec

allows calling avcodec_find_(en|de)coder_by_name with NULL parameter
author aurel
date Wed, 08 Oct 2008 17:19:26 +0000
parents b5f5257c0c70
children e70975d5ff80
comparison
equal deleted inserted replaced
8015:ad3949b075ba 8016:81dba4c59fd6
1007 } 1007 }
1008 1008
1009 AVCodec *avcodec_find_encoder_by_name(const char *name) 1009 AVCodec *avcodec_find_encoder_by_name(const char *name)
1010 { 1010 {
1011 AVCodec *p; 1011 AVCodec *p;
1012 if (!name)
1013 return NULL;
1012 p = first_avcodec; 1014 p = first_avcodec;
1013 while (p) { 1015 while (p) {
1014 if (p->encode != NULL && strcmp(name,p->name) == 0) 1016 if (p->encode != NULL && strcmp(name,p->name) == 0)
1015 return p; 1017 return p;
1016 p = p->next; 1018 p = p->next;
1031 } 1033 }
1032 1034
1033 AVCodec *avcodec_find_decoder_by_name(const char *name) 1035 AVCodec *avcodec_find_decoder_by_name(const char *name)
1034 { 1036 {
1035 AVCodec *p; 1037 AVCodec *p;
1038 if (!name)
1039 return NULL;
1036 p = first_avcodec; 1040 p = first_avcodec;
1037 while (p) { 1041 while (p) {
1038 if (p->decode != NULL && strcmp(name,p->name) == 0) 1042 if (p->decode != NULL && strcmp(name,p->name) == 0)
1039 return p; 1043 return p;
1040 p = p->next; 1044 p = p->next;