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
94f5470a
Commit
94f5470a
authored
Oct 10, 2012
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavf: add a AVPROBE_SCORE_RETRY instead of using hardcoded values.
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
9586db6a
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
3 deletions
+4
-3
avformat.h
libavformat/avformat.h
+1
-0
utils.c
libavformat/utils.c
+3
-3
No files found.
libavformat/avformat.h
View file @
94f5470a
...
...
@@ -336,6 +336,7 @@ typedef struct AVProbeData {
}
AVProbeData
;
#define AVPROBE_SCORE_MAX 100 ///< maximum score, half of that is used for file-extension-based detection
#define AVPROBE_SCORE_RETRY (AVPROBE_SCORE_MAX/4)
#define AVPROBE_PADDING_SIZE 32 ///< extra allocated bytes at the end of the probe buffer
/// Demuxer will use avio_open, no opened file should be provided by the caller.
...
...
libavformat/utils.c
View file @
94f5470a
...
...
@@ -425,7 +425,7 @@ int av_probe_input_buffer(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_
MAX
/
4
:
0
;
int
score
=
probe_size
<
max_probe_size
?
AVPROBE_SCORE_
RETRY
:
0
;
int
buf_offset
=
(
probe_size
==
PROBE_BUF_MIN
)
?
0
:
probe_size
>>
1
;
void
*
buftmp
;
...
...
@@ -457,7 +457,7 @@ int av_probe_input_buffer(AVIOContext *pb, AVInputFormat **fmt,
/* guess file format */
*
fmt
=
av_probe_input_format2
(
&
pd
,
1
,
&
score
);
if
(
*
fmt
){
if
(
score
<=
AVPROBE_SCORE_
MAX
/
4
){
//this can only be true in the last iteration
if
(
score
<=
AVPROBE_SCORE_
RETRY
){
//this can only be true in the last iteration
av_log
(
logctx
,
AV_LOG_WARNING
,
"Format %s detected only with low score of %d, misdetection possible!
\n
"
,
(
*
fmt
)
->
name
,
score
);
}
else
av_log
(
logctx
,
AV_LOG_DEBUG
,
"Format %s probed with size=%d and score=%d
\n
"
,
(
*
fmt
)
->
name
,
probe_size
,
score
);
...
...
@@ -656,7 +656,7 @@ no_packet:
if
(
end
||
av_log2
(
pd
->
buf_size
)
!=
av_log2
(
pd
->
buf_size
-
pkt
->
size
)){
int
score
=
set_codec_from_probe_data
(
s
,
st
,
pd
);
if
(
(
st
->
codec
->
codec_id
!=
AV_CODEC_ID_NONE
&&
score
>
AVPROBE_SCORE_
MAX
/
4
)
if
(
(
st
->
codec
->
codec_id
!=
AV_CODEC_ID_NONE
&&
score
>
AVPROBE_SCORE_
RETRY
)
||
end
){
pd
->
buf_size
=
0
;
av_freep
(
&
pd
->
buf
);
...
...
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