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
56a10009
Commit
56a10009
authored
Apr 05, 2011
by
Anton Khirnov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavf: if id3v2 tag is present and all else fails, guess by file extension
parent
5371803d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
1 deletion
+12
-1
utils.c
libavformat/utils.c
+12
-1
No files found.
libavformat/utils.c
View file @
56a10009
...
@@ -371,7 +371,7 @@ AVInputFormat *av_probe_input_format2(AVProbeData *pd, int is_opened, int *score
...
@@ -371,7 +371,7 @@ AVInputFormat *av_probe_input_format2(AVProbeData *pd, int is_opened, int *score
{
{
AVProbeData
lpd
=
*
pd
;
AVProbeData
lpd
=
*
pd
;
AVInputFormat
*
fmt1
=
NULL
,
*
fmt
;
AVInputFormat
*
fmt1
=
NULL
,
*
fmt
;
int
score
;
int
score
,
id3
=
0
;
if
(
lpd
.
buf_size
>
10
&&
ff_id3v2_match
(
lpd
.
buf
,
ID3v2_DEFAULT_MAGIC
))
{
if
(
lpd
.
buf_size
>
10
&&
ff_id3v2_match
(
lpd
.
buf
,
ID3v2_DEFAULT_MAGIC
))
{
int
id3len
=
ff_id3v2_tag_len
(
lpd
.
buf
);
int
id3len
=
ff_id3v2_tag_len
(
lpd
.
buf
);
...
@@ -379,6 +379,7 @@ AVInputFormat *av_probe_input_format2(AVProbeData *pd, int is_opened, int *score
...
@@ -379,6 +379,7 @@ AVInputFormat *av_probe_input_format2(AVProbeData *pd, int is_opened, int *score
lpd
.
buf
+=
id3len
;
lpd
.
buf
+=
id3len
;
lpd
.
buf_size
-=
id3len
;
lpd
.
buf_size
-=
id3len
;
}
}
id3
=
1
;
}
}
fmt
=
NULL
;
fmt
=
NULL
;
...
@@ -399,6 +400,16 @@ AVInputFormat *av_probe_input_format2(AVProbeData *pd, int is_opened, int *score
...
@@ -399,6 +400,16 @@ AVInputFormat *av_probe_input_format2(AVProbeData *pd, int is_opened, int *score
}
else
if
(
score
==
*
score_max
)
}
else
if
(
score
==
*
score_max
)
fmt
=
NULL
;
fmt
=
NULL
;
}
}
/* a hack for files with huge id3v2 tags -- try to guess by file extension. */
if
(
!
fmt
&&
id3
&&
*
score_max
<
AVPROBE_SCORE_MAX
/
4
)
{
while
((
fmt
=
av_iformat_next
(
fmt
)))
if
(
fmt
->
extensions
&&
av_match_ext
(
lpd
.
filename
,
fmt
->
extensions
))
{
*
score_max
=
AVPROBE_SCORE_MAX
/
4
;
break
;
}
}
return
fmt
;
return
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