Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
c4810fbe
Commit
c4810fbe
authored
Aug 28, 2013
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avformat/utils: fix av_probe_input_buffer2() so it returns the probe score
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
7528fdcd
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
+3
-2
utils.c
libavformat/utils.c
+3
-2
No files found.
libavformat/utils.c
View file @
c4810fbe
...
...
@@ -322,6 +322,7 @@ int av_probe_input_buffer2(AVIOContext *pb, AVInputFormat **fmt,
unsigned
char
*
buf
=
NULL
;
uint8_t
*
mime_type
;
int
ret
=
0
,
probe_size
,
buf_offset
=
0
;
int
score
=
0
;
if
(
!
max_probe_size
)
{
max_probe_size
=
PROBE_BUF_MAX
;
...
...
@@ -346,12 +347,12 @@ int av_probe_input_buffer2(AVIOContext *pb, AVInputFormat **fmt,
for
(
probe_size
=
PROBE_BUF_MIN
;
probe_size
<=
max_probe_size
&&
!*
fmt
;
probe_size
=
FFMIN
(
probe_size
<<
1
,
FFMAX
(
max_probe_size
,
probe_size
+
1
)))
{
int
score
=
probe_size
<
max_probe_size
?
AVPROBE_SCORE_RETRY
:
0
;
void
*
buftmp
;
if
(
probe_size
<
offset
)
{
continue
;
}
score
=
probe_size
<
max_probe_size
?
AVPROBE_SCORE_RETRY
:
0
;
/* read probe data */
buftmp
=
av_realloc
(
buf
,
probe_size
+
AVPROBE_PADDING_SIZE
);
...
...
@@ -392,7 +393,7 @@ int av_probe_input_buffer2(AVIOContext *pb, AVInputFormat **fmt,
/* rewind. reuse probe buffer to avoid seeking */
ret
=
ffio_rewind_with_probe_data
(
pb
,
&
buf
,
pd
.
buf_size
);
return
ret
;
return
ret
<
0
?
ret
:
score
;
}
int
av_probe_input_buffer
(
AVIOContext
*
pb
,
AVInputFormat
**
fmt
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment