Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
FFmpeg
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
libremedia
Tethys
FFmpeg
Commits
b874e2d0
Commit
b874e2d0
authored
13 years ago
by
Stefano Sabatini
Browse files
Options
Downloads
Patches
Plain Diff
ffprobe: prefer av_strtok() over av_get_token() for parsing print_format string
Simplify, and avoid the need for multiple escaping levels.
parent
b35e9e19
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
ffprobe.c
+9
-16
9 additions, 16 deletions
ffprobe.c
with
9 additions
and
16 deletions
ffprobe.c
+
9
−
16
View file @
b874e2d0
...
...
@@ -809,26 +809,20 @@ static int probe_file(const char *filename)
AVFormatContext
*
fmt_ctx
;
int
ret
;
Writer
*
w
;
const
char
*
buf
=
print_format
;
char
*
w_
str
=
NULL
,
*
w_args
=
NULL
;
char
*
buf
;
char
*
w_
name
=
NULL
,
*
w_args
=
NULL
;
WriterContext
*
wctx
;
writer_register_all
();
if
(
buf
)
{
w_str
=
av_get_token
(
&
buf
,
"="
);
if
(
*
buf
==
'='
)
{
buf
++
;
w_args
=
av_get_token
(
&
buf
,
""
);
}
}
if
(
!
w_str
)
w_str
=
av_strdup
(
"default"
);
if
(
!
print_format
)
print_format
=
av_strdup
(
"default"
);
w_name
=
av_strtok
(
print_format
,
"="
,
&
buf
);
w_args
=
buf
;
w
=
writer_get_by_name
(
w_
str
);
w
=
writer_get_by_name
(
w_
name
);
if
(
!
w
)
{
av_log
(
NULL
,
AV_LOG_ERROR
,
"
Invalid
output format '%s'
\n
"
,
w_
str
);
av_log
(
NULL
,
AV_LOG_ERROR
,
"
Unknown
output format
with name
'%s'
\n
"
,
w_
name
);
ret
=
AVERROR
(
EINVAL
);
goto
end
;
}
...
...
@@ -848,8 +842,7 @@ static int probe_file(const char *filename)
writer_close
(
&
wctx
);
end:
av_free
(
w_str
);
av_free
(
w_args
);
av_free
(
print_format
);
return
ret
;
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment