mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2024-12-11 09:35:22 +00:00
avformat/avio: Use av_strstart instead of strncmp
It makes the intent clearer and avoids calculating the length in advance. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
This commit is contained in:
parent
bd85c63d1d
commit
ea5bf12a9a
@ -114,11 +114,10 @@ static int url_alloc_for_protocol(URLContext **puc, const URLProtocol *up,
|
||||
goto fail;
|
||||
}
|
||||
if (up->priv_data_class) {
|
||||
int proto_len= strlen(up->name);
|
||||
char *start = strchr(uc->filename, ',');
|
||||
char *start;
|
||||
*(const AVClass **)uc->priv_data = up->priv_data_class;
|
||||
av_opt_set_defaults(uc->priv_data);
|
||||
if(!strncmp(up->name, uc->filename, proto_len) && uc->filename + proto_len == start){
|
||||
if (av_strstart(uc->filename, up->name, (const char**)&start) && *start == ',') {
|
||||
int ret= 0;
|
||||
char *p= start;
|
||||
char sep= *++p;
|
||||
|
Loading…
Reference in New Issue
Block a user