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
e0f8be64
Commit
e0f8be64
authored
Mar 25, 2013
by
Diego Biurrun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avformat: Add AVPROBE_SCORE_EXTENSION define and use where appropriate
parent
4d7ed3e7
Hide whitespace changes
Inline
Side-by-side
Showing
36 changed files
with
55 additions
and
53 deletions
+55
-53
aacdec.c
libavformat/aacdec.c
+3
-3
ac3dec.c
libavformat/ac3dec.c
+3
-3
avformat.h
libavformat/avformat.h
+3
-1
avidec.c
libavformat/avidec.c
+1
-1
avs.c
libavformat/avs.c
+1
-1
cavsvideodec.c
libavformat/cavsvideodec.c
+1
-1
dtsdec.c
libavformat/dtsdec.c
+1
-1
flacdec.c
libavformat/flacdec.c
+1
-1
h261dec.c
libavformat/h261dec.c
+2
-2
h263dec.c
libavformat/h263dec.c
+2
-2
h264dec.c
libavformat/h264dec.c
+1
-1
idcin.c
libavformat/idcin.c
+1
-1
img2dec.c
libavformat/img2dec.c
+1
-1
m4vdec.c
libavformat/m4vdec.c
+1
-1
matroskadec.c
libavformat/matroskadec.c
+1
-1
mm.c
libavformat/mm.c
+1
-1
mov.c
libavformat/mov.c
+1
-1
mp3dec.c
libavformat/mp3dec.c
+3
-3
mpc8.c
libavformat/mpc8.c
+1
-1
mpeg.c
libavformat/mpeg.c
+4
-4
mpegvideodec.c
libavformat/mpegvideodec.c
+1
-1
mtv.c
libavformat/mtv.c
+2
-2
nsvdec.c
libavformat/nsvdec.c
+1
-1
omadec.c
libavformat/omadec.c
+1
-1
psxstr.c
libavformat/psxstr.c
+1
-1
pva.c
libavformat/pva.c
+1
-1
rtsp.c
libavformat/rtsp.c
+1
-1
sierravmd.c
libavformat/sierravmd.c
+1
-1
spdifdec.c
libavformat/spdifdec.c
+2
-2
takdec.c
libavformat/takdec.c
+1
-1
tta.c
libavformat/tta.c
+1
-1
utils.c
libavformat/utils.c
+5
-5
vc1test.c
libavformat/vc1test.c
+1
-1
vqf.c
libavformat/vqf.c
+1
-1
westwood_aud.c
libavformat/westwood_aud.c
+1
-1
xa.c
libavformat/xa.c
+1
-1
No files found.
libavformat/aacdec.c
View file @
e0f8be64
...
...
@@ -54,9 +54,9 @@ static int adts_aac_probe(AVProbeData *p)
if
(
buf
==
buf0
)
first_frames
=
frames
;
}
if
(
first_frames
>=
3
)
return
AVPROBE_SCORE_
MAX
/
2
+
1
;
else
if
(
max_frames
>
500
)
return
AVPROBE_SCORE_
MAX
/
2
;
else
if
(
max_frames
>=
3
)
return
AVPROBE_SCORE_
MAX
/
4
;
if
(
first_frames
>=
3
)
return
AVPROBE_SCORE_
EXTENSION
+
1
;
else
if
(
max_frames
>
500
)
return
AVPROBE_SCORE_
EXTENSION
;
else
if
(
max_frames
>=
3
)
return
AVPROBE_SCORE_
EXTENSION
/
2
;
else
if
(
max_frames
>=
1
)
return
1
;
else
return
0
;
}
...
...
libavformat/ac3dec.c
View file @
e0f8be64
...
...
@@ -57,7 +57,7 @@ static int ac3_eac3_probe(AVProbeData *p, enum AVCodecID expected_codec_id)
if
(
codec_id
!=
expected_codec_id
)
return
0
;
// keep this in sync with mp3 probe, both need to avoid
// issues with MPEG-files!
if
(
first_frames
>=
4
)
return
AVPROBE_SCORE_
MAX
/
2
+
1
;
if
(
first_frames
>=
4
)
return
AVPROBE_SCORE_
EXTENSION
+
1
;
if
(
max_frames
)
{
int
pes
=
0
,
i
;
...
...
@@ -78,8 +78,8 @@ static int ac3_eac3_probe(AVProbeData *p, enum AVCodecID expected_codec_id)
if
(
pes
)
max_frames
=
(
max_frames
+
pes
-
1
)
/
pes
;
}
if
(
max_frames
>
500
)
return
AVPROBE_SCORE_
MAX
/
2
;
else
if
(
max_frames
>=
4
)
return
AVPROBE_SCORE_
MAX
/
4
;
if
(
max_frames
>
500
)
return
AVPROBE_SCORE_
EXTENSION
;
else
if
(
max_frames
>=
4
)
return
AVPROBE_SCORE_
EXTENSION
/
2
;
else
if
(
max_frames
>=
1
)
return
1
;
else
return
0
;
}
...
...
libavformat/avformat.h
View file @
e0f8be64
...
...
@@ -337,7 +337,9 @@ typedef struct AVProbeData {
int
buf_size
;
/**< Size of buf except extra allocated bytes */
}
AVProbeData
;
#define AVPROBE_SCORE_MAX 100 ///< maximum score, half of that is used for file-extension-based detection
#define AVPROBE_SCORE_EXTENSION 50 ///< score for file extension
#define AVPROBE_SCORE_MAX 100 ///< maximum score
#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/avidec.c
View file @
e0f8be64
...
...
@@ -758,7 +758,7 @@ static int avi_read_header(AVFormatContext *s)
static
int
read_gab2_sub
(
AVStream
*
st
,
AVPacket
*
pkt
)
{
if
(
!
strcmp
(
pkt
->
data
,
"GAB2"
)
&&
AV_RL16
(
pkt
->
data
+
5
)
==
2
)
{
uint8_t
desc
[
256
];
int
score
=
AVPROBE_SCORE_
MAX
/
2
,
ret
;
int
score
=
AVPROBE_SCORE_
EXTENSION
,
ret
;
AVIStream
*
ast
=
st
->
priv_data
;
AVInputFormat
*
sub_demuxer
;
AVRational
time_base
;
...
...
libavformat/avs.c
View file @
e0f8be64
...
...
@@ -50,7 +50,7 @@ static int avs_probe(AVProbeData * p)
d
=
p
->
buf
;
if
(
d
[
0
]
==
'w'
&&
d
[
1
]
==
'W'
&&
d
[
2
]
==
0x10
&&
d
[
3
]
==
0
)
return
50
;
return
AVPROBE_SCORE_EXTENSION
;
return
0
;
}
...
...
libavformat/cavsvideodec.c
View file @
e0f8be64
...
...
@@ -61,7 +61,7 @@ static int cavsvideo_probe(AVProbeData *p)
}
}
if
(
seq
&&
seq
*
9
<=
pic
*
10
)
return
AVPROBE_SCORE_
MAX
/
2
;
return
AVPROBE_SCORE_
EXTENSION
;
return
0
;
}
...
...
libavformat/dtsdec.c
View file @
e0f8be64
...
...
@@ -60,7 +60,7 @@ static int dts_probe(AVProbeData *p)
max
=
markers
[
2
]
>
markers
[
max
]
?
2
:
max
;
if
(
markers
[
max
]
>
3
&&
p
->
buf_size
/
markers
[
max
]
<
32
*
1024
&&
markers
[
max
]
*
4
>
sum
*
3
)
return
AVPROBE_SCORE_
MAX
/
2
+
1
;
return
AVPROBE_SCORE_
EXTENSION
+
1
;
return
0
;
}
...
...
libavformat/flacdec.c
View file @
e0f8be64
...
...
@@ -281,7 +281,7 @@ static int flac_probe(AVProbeData *p)
{
if
(
p
->
buf_size
<
4
||
memcmp
(
p
->
buf
,
"fLaC"
,
4
))
return
0
;
return
AVPROBE_SCORE_
MAX
/
2
;
return
AVPROBE_SCORE_
EXTENSION
;
}
AVInputFormat
ff_flac_demuxer
=
{
...
...
libavformat/h261dec.c
View file @
e0f8be64
...
...
@@ -56,9 +56,9 @@ static int h261_probe(AVProbeData *p)
}
}
if
(
valid_psc
>
2
*
invalid_psc
+
6
){
return
50
;
return
AVPROBE_SCORE_EXTENSION
;
}
else
if
(
valid_psc
>
2
*
invalid_psc
+
2
)
return
25
;
return
AVPROBE_SCORE_EXTENSION
/
2
;
return
0
;
}
...
...
libavformat/h263dec.c
View file @
e0f8be64
...
...
@@ -56,9 +56,9 @@ static int h263_probe(AVProbeData *p)
}
}
if
(
valid_psc
>
2
*
invalid_psc
+
2
*
res_change
+
3
){
return
50
;
return
AVPROBE_SCORE_EXTENSION
;
}
else
if
(
valid_psc
>
2
*
invalid_psc
)
return
25
;
return
AVPROBE_SCORE_EXTENSION
/
2
;
return
0
;
}
...
...
libavformat/h264dec.c
View file @
e0f8be64
...
...
@@ -63,7 +63,7 @@ static int h264_probe(AVProbeData *p)
}
}
if
(
sps
&&
pps
&&
(
idr
||
sli
>
3
)
&&
res
<
(
sps
+
pps
+
idr
))
return
AVPROBE_SCORE_
MAX
/
2
+
1
;
// +1 for
.mpg
return
AVPROBE_SCORE_
EXTENSION
+
1
;
// 1 more than
.mpg
return
0
;
}
...
...
libavformat/idcin.c
View file @
e0f8be64
...
...
@@ -137,7 +137,7 @@ static int idcin_probe(AVProbeData *p)
return
0
;
/* return half certainty since this check is a bit sketchy */
return
AVPROBE_SCORE_
MAX
/
2
;
return
AVPROBE_SCORE_
EXTENSION
;
}
static
int
idcin_read_header
(
AVFormatContext
*
s
)
...
...
libavformat/img2dec.c
View file @
e0f8be64
...
...
@@ -130,7 +130,7 @@ static int img_read_probe(AVProbeData *p)
if
(
av_filename_number_test
(
p
->
filename
))
return
AVPROBE_SCORE_MAX
;
else
return
AVPROBE_SCORE_
MAX
/
2
;
return
AVPROBE_SCORE_
EXTENSION
;
}
return
0
;
}
...
...
libavformat/m4vdec.c
View file @
e0f8be64
...
...
@@ -45,7 +45,7 @@ static int mpeg4video_probe(AVProbeData *probe_packet)
}
if
(
VOP
>=
VISO
&&
VOP
>=
VOL
&&
VO
>=
VOL
&&
VOL
>
0
&&
res
==
0
)
return
AVPROBE_SCORE_
MAX
/
2
;
return
AVPROBE_SCORE_
EXTENSION
;
return
0
;
}
...
...
libavformat/matroskadec.c
View file @
e0f8be64
...
...
@@ -962,7 +962,7 @@ static int matroska_probe(AVProbeData *p)
}
// probably valid EBML header but no recognized doctype
return
AVPROBE_SCORE_
MAX
/
2
;
return
AVPROBE_SCORE_
EXTENSION
;
}
static
MatroskaTrack
*
matroska_find_track_by_num
(
MatroskaDemuxContext
*
matroska
,
...
...
libavformat/mm.c
View file @
e0f8be64
...
...
@@ -79,7 +79,7 @@ static int probe(AVProbeData *p)
return
0
;
/* only return half certainty since this check is a bit sketchy */
return
AVPROBE_SCORE_
MAX
/
2
;
return
AVPROBE_SCORE_
EXTENSION
;
}
static
int
read_header
(
AVFormatContext
*
s
)
...
...
libavformat/mov.c
View file @
e0f8be64
...
...
@@ -2639,7 +2639,7 @@ static int mov_probe(AVProbeData *p)
case
MKTAG
(
'p'
,
'r'
,
'f'
,
'l'
):
offset
=
AV_RB32
(
p
->
buf
+
offset
)
+
offset
;
/* if we only find those cause probedata is too small at least rate them */
score
=
AVPROBE_SCORE_
MAX
-
50
;
score
=
AVPROBE_SCORE_
EXTENSION
;
break
;
default:
/* unrecognized tag */
...
...
libavformat/mp3dec.c
View file @
e0f8be64
...
...
@@ -73,7 +73,7 @@ static int mp3_read_probe(AVProbeData *p)
}
// keep this in sync with ac3 probe, both need to avoid
// issues with MPEG-files!
if
(
first_frames
>=
4
)
return
AVPROBE_SCORE_
MAX
/
2
+
1
;
if
(
first_frames
>=
4
)
return
AVPROBE_SCORE_
EXTENSION
+
1
;
if
(
max_frames
)
{
int
pes
=
0
,
i
;
...
...
@@ -94,8 +94,8 @@ static int mp3_read_probe(AVProbeData *p)
if
(
pes
)
max_frames
=
(
max_frames
+
pes
-
1
)
/
pes
;
}
if
(
max_frames
>
500
)
return
AVPROBE_SCORE_
MAX
/
2
;
else
if
(
max_frames
>=
4
)
return
AVPROBE_SCORE_
MAX
/
4
;
if
(
max_frames
>
500
)
return
AVPROBE_SCORE_
EXTENSION
;
else
if
(
max_frames
>=
4
)
return
AVPROBE_SCORE_
EXTENSION
/
2
;
else
if
(
max_frames
>=
1
)
return
1
;
else
return
0
;
//mpegps_mp3_unrecognized_format.mpg has max_frames=3
...
...
libavformat/mpc8.c
View file @
e0f8be64
...
...
@@ -92,7 +92,7 @@ static int mpc8_probe(AVProbeData *p)
if
(
size
<
2
)
return
0
;
if
(
bs
+
size
-
2
>=
bs_end
)
return
AVPROBE_SCORE_
MAX
/
4
-
1
;
//
seems to be valid MPC but no header yet
return
AVPROBE_SCORE_
EXTENSION
-
1
;
//
seems to be valid MPC but no header yet
if
(
header_found
)
{
if
(
size
<
11
||
size
>
28
)
return
0
;
...
...
libavformat/mpeg.c
View file @
e0f8be64
...
...
@@ -82,14 +82,14 @@ static int mpegps_probe(AVProbeData *p)
}
if
(
vid
+
audio
>
invalid
)
/* invalid VDR files nd short PES streams */
score
=
AVPROBE_SCORE_MAX
/
4
;
score
=
AVPROBE_SCORE_EXTENSION
/
2
;
if
(
sys
>
invalid
&&
sys
*
9
<=
pspack
*
10
)
return
pspack
>
2
?
AVPROBE_SCORE_
MAX
/
2
+
2
:
AVPROBE_SCORE_MAX
/
4
;
// +1 for
.mpg
return
pspack
>
2
?
AVPROBE_SCORE_
EXTENSION
+
2
:
AVPROBE_SCORE_EXTENSION
/
2
;
// 1 more than
.mpg
if
(
pspack
>
invalid
&&
(
priv1
+
vid
+
audio
)
*
10
>=
pspack
*
9
)
return
pspack
>
2
?
AVPROBE_SCORE_
MAX
/
2
+
2
:
AVPROBE_SCORE_MAX
/
4
;
// +1 for
.mpg
return
pspack
>
2
?
AVPROBE_SCORE_
EXTENSION
+
2
:
AVPROBE_SCORE_EXTENSION
/
2
;
// 1 more than
.mpg
if
((
!!
vid
^
!!
audio
)
&&
(
audio
>
4
||
vid
>
1
)
&&
!
sys
&&
!
pspack
&&
p
->
buf_size
>
2048
&&
vid
+
audio
>
invalid
)
/* PES stream */
return
(
audio
>
12
||
vid
>
3
)
?
AVPROBE_SCORE_
MAX
/
2
+
2
:
AVPROBE_SCORE_MAX
/
4
;
return
(
audio
>
12
||
vid
>
3
)
?
AVPROBE_SCORE_
EXTENSION
+
2
:
AVPROBE_SCORE_EXTENSION
/
2
;
//02-Penguin.flac has sys:0 priv1:0 pspack:0 vid:0 audio:1
//mp3_misidentified_2.mp3 has sys:0 priv1:0 pspack:0 vid:0 audio:6
...
...
libavformat/mpegvideodec.c
View file @
e0f8be64
...
...
@@ -51,7 +51,7 @@ static int mpegvideo_probe(AVProbeData *p)
}
}
if
(
seq
&&
seq
*
9
<=
pic
*
10
&&
pic
*
9
<=
slice
*
10
&&
!
pspack
&&
!
pes
)
return
pic
>
1
?
AVPROBE_SCORE_
MAX
/
2
+
1
:
AVPROBE_SCORE_MAX
/
4
;
// +1 for
.mpg
return
pic
>
1
?
AVPROBE_SCORE_
EXTENSION
+
1
:
AVPROBE_SCORE_EXTENSION
/
2
;
// 1 more than
.mpg
return
0
;
}
...
...
libavformat/mtv.c
View file @
e0f8be64
...
...
@@ -64,13 +64,13 @@ static int mtv_probe(AVProbeData *p)
if
(
!
AV_RL16
(
&
p
->
buf
[
52
])
||
!
AV_RL16
(
&
p
->
buf
[
54
]))
{
if
(
!!
AV_RL16
(
&
p
->
buf
[
56
]))
return
AVPROBE_SCORE_
MAX
/
2
;
return
AVPROBE_SCORE_
EXTENSION
;
else
return
0
;
}
if
(
p
->
buf
[
51
]
!=
16
)
return
AVPROBE_SCORE_
MAX
/
4
;
// But we are going to assume 16bpp anyway ..
return
AVPROBE_SCORE_
EXTENSION
/
2
;
// But we are going to assume 16bpp anyway ..
return
AVPROBE_SCORE_MAX
;
}
...
...
libavformat/nsvdec.c
View file @
e0f8be64
...
...
@@ -791,7 +791,7 @@ static int nsv_probe(AVProbeData *p)
}
/* so we'll have more luck on extension... */
if
(
av_match_ext
(
p
->
filename
,
"nsv"
))
return
AVPROBE_SCORE_
MAX
/
2
;
return
AVPROBE_SCORE_
EXTENSION
;
/* FIXME: add mime-type check */
return
score
;
}
...
...
libavformat/omadec.c
View file @
e0f8be64
...
...
@@ -428,7 +428,7 @@ static int oma_read_probe(AVProbeData *p)
/* This check cannot overflow as tag_len has at most 28 bits */
if
(
p
->
buf_size
<
tag_len
+
5
)
/* EA3 header comes late, might be outside of the probe buffer */
return
AVPROBE_SCORE_
MAX
/
2
;
return
AVPROBE_SCORE_
EXTENSION
;
buf
+=
tag_len
;
...
...
libavformat/psxstr.c
View file @
e0f8be64
...
...
@@ -94,7 +94,7 @@ static int str_probe(AVProbeData *p)
/* MPEG files (like those ripped from VCDs) can also look like this;
* only return half certainty */
return
50
;
return
AVPROBE_SCORE_EXTENSION
;
}
static
int
str_read_header
(
AVFormatContext
*
s
)
...
...
libavformat/pva.c
View file @
e0f8be64
...
...
@@ -36,7 +36,7 @@ static int pva_probe(AVProbeData * pd) {
unsigned
char
*
buf
=
pd
->
buf
;
if
(
AV_RB16
(
buf
)
==
PVA_MAGIC
&&
buf
[
2
]
&&
buf
[
2
]
<
3
&&
buf
[
4
]
==
0x55
)
return
AVPROBE_SCORE_
MAX
/
2
;
return
AVPROBE_SCORE_
EXTENSION
;
return
0
;
}
...
...
libavformat/rtsp.c
View file @
e0f8be64
...
...
@@ -2032,7 +2032,7 @@ static int sdp_probe(AVProbeData *p1)
while
(
p
<
p_end
&&
*
p
!=
'\0'
)
{
if
(
p
+
sizeof
(
"c=IN IP"
)
-
1
<
p_end
&&
av_strstart
(
p
,
"c=IN IP"
,
NULL
))
return
AVPROBE_SCORE_
MAX
/
2
;
return
AVPROBE_SCORE_
EXTENSION
;
while
(
p
<
p_end
-
1
&&
*
p
!=
'\n'
)
p
++
;
if
(
++
p
>=
p_end
)
...
...
libavformat/sierravmd.c
View file @
e0f8be64
...
...
@@ -76,7 +76,7 @@ static int vmd_probe(AVProbeData *p)
return
0
;
/* only return half certainty since this check is a bit sketchy */
return
AVPROBE_SCORE_
MAX
/
2
;
return
AVPROBE_SCORE_
EXTENSION
;
}
static
int
vmd_read_header
(
AVFormatContext
*
s
)
...
...
libavformat/spdifdec.c
View file @
e0f8be64
...
...
@@ -149,10 +149,10 @@ static int spdif_probe(AVProbeData *p)
if
(
sync_codes
>=
6
)
/* good amount of sync codes but with unexpected offsets */
return
AVPROBE_SCORE_
MAX
/
2
;
return
AVPROBE_SCORE_
EXTENSION
;
/* some sync codes were found */
return
AVPROBE_SCORE_
MAX
/
8
;
return
AVPROBE_SCORE_
EXTENSION
/
4
;
}
static
int
spdif_read_header
(
AVFormatContext
*
s
)
...
...
libavformat/takdec.c
View file @
e0f8be64
...
...
@@ -33,7 +33,7 @@ typedef struct TAKDemuxContext {
static
int
tak_probe
(
AVProbeData
*
p
)
{
if
(
!
memcmp
(
p
->
buf
,
"tBaK"
,
4
))
return
AVPROBE_SCORE_
MAX
/
2
;
return
AVPROBE_SCORE_
EXTENSION
;
return
0
;
}
...
...
libavformat/tta.c
View file @
e0f8be64
...
...
@@ -36,7 +36,7 @@ static int tta_probe(AVProbeData *p)
const
uint8_t
*
d
=
p
->
buf
;
if
(
d
[
0
]
==
'T'
&&
d
[
1
]
==
'T'
&&
d
[
2
]
==
'A'
&&
d
[
3
]
==
'1'
)
return
8
0
;
return
AVPROBE_SCORE_EXTENSION
+
3
0
;
return
0
;
}
...
...
libavformat/utils.c
View file @
e0f8be64
...
...
@@ -309,7 +309,7 @@ AVInputFormat *av_probe_input_format2(AVProbeData *pd, int is_opened, int *score
score
=
fmt1
->
read_probe
(
&
lpd
);
}
else
if
(
fmt1
->
extensions
)
{
if
(
av_match_ext
(
lpd
.
filename
,
fmt1
->
extensions
))
{
score
=
50
;
score
=
AVPROBE_SCORE_EXTENSION
;
}
}
if
(
score
>
*
score_max
)
{
...
...
@@ -320,18 +320,18 @@ AVInputFormat *av_probe_input_format2(AVProbeData *pd, int is_opened, int *score
}
/* a hack for files with huge id3v2 tags -- try to guess by file extension. */
if
(
!
fmt
&&
is_opened
&&
*
score_max
<
AVPROBE_SCORE_
MAX
/
4
)
{
if
(
!
fmt
&&
is_opened
&&
*
score_max
<
AVPROBE_SCORE_
EXTENSION
/
2
)
{
while
((
fmt
=
av_iformat_next
(
fmt
)))
if
(
fmt
->
extensions
&&
av_match_ext
(
lpd
.
filename
,
fmt
->
extensions
))
{
*
score_max
=
AVPROBE_SCORE_
MAX
/
4
;
*
score_max
=
AVPROBE_SCORE_
EXTENSION
/
2
;
break
;
}
}
if
(
!
fmt
&&
id3
&&
*
score_max
<
AVPROBE_SCORE_
MAX
/
4
-
1
)
{
if
(
!
fmt
&&
id3
&&
*
score_max
<
AVPROBE_SCORE_
EXTENSION
/
2
-
1
)
{
while
((
fmt
=
av_iformat_next
(
fmt
)))
if
(
fmt
->
extensions
&&
av_match_ext
(
"mp3"
,
fmt
->
extensions
))
{
*
score_max
=
AVPROBE_SCORE_
MAX
/
4
-
1
;
*
score_max
=
AVPROBE_SCORE_
EXTENSION
/
2
-
1
;
break
;
}
}
...
...
libavformat/vc1test.c
View file @
e0f8be64
...
...
@@ -39,7 +39,7 @@ static int vc1t_probe(AVProbeData *p)
if
(
p
->
buf
[
3
]
!=
0xC5
||
AV_RL32
(
&
p
->
buf
[
4
])
!=
4
||
AV_RL32
(
&
p
->
buf
[
20
])
!=
0xC
)
return
0
;
return
AVPROBE_SCORE_
MAX
/
2
;
return
AVPROBE_SCORE_
EXTENSION
;
}
static
int
vc1t_read_header
(
AVFormatContext
*
s
)
...
...
libavformat/vqf.c
View file @
e0f8be64
...
...
@@ -43,7 +43,7 @@ static int vqf_probe(AVProbeData *probe_packet)
if
(
!
memcmp
(
probe_packet
->
buf
+
4
,
"00052200"
,
8
))
return
AVPROBE_SCORE_MAX
;
return
AVPROBE_SCORE_
MAX
/
2
;
return
AVPROBE_SCORE_
EXTENSION
;
}
static
void
add_metadata
(
AVFormatContext
*
s
,
uint32_t
tag
,
...
...
libavformat/westwood_aud.c
View file @
e0f8be64
...
...
@@ -79,7 +79,7 @@ static int wsaud_probe(AVProbeData *p)
return
0
;
/* return 1/2 certainty since this file check is a little sketchy */
return
AVPROBE_SCORE_
MAX
/
2
;
return
AVPROBE_SCORE_
EXTENSION
;
}
static
int
wsaud_read_header
(
AVFormatContext
*
s
)
...
...
libavformat/xa.c
View file @
e0f8be64
...
...
@@ -59,7 +59,7 @@ static int xa_probe(AVProbeData *p)
if
(
!
channels
||
channels
>
8
||
!
srate
||
srate
>
192000
||
bits_per_sample
<
4
||
bits_per_sample
>
32
)
return
0
;
return
AVPROBE_SCORE_
MAX
/
2
;
return
AVPROBE_SCORE_
EXTENSION
;
}
static
int
xa_read_header
(
AVFormatContext
*
s
)
...
...
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