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
7b39d853
Commit
7b39d853
authored
Apr 10, 2015
by
Carl Eugen Hoyos
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavf/flac: Autodetect raw flac files.
parent
3553b815
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
0 deletions
+18
-0
flacdec.c
libavformat/flacdec.c
+18
-0
No files found.
libavformat/flacdec.c
View file @
7b39d853
...
...
@@ -176,8 +176,26 @@ fail:
return
ret
;
}
static
int
raw_flac_probe
(
AVProbeData
*
p
)
{
if
((
p
->
buf
[
2
]
&
0xF0
)
==
0
)
// blocksize code invalid
return
0
;
if
((
p
->
buf
[
2
]
&
0x0F
)
==
0x0F
)
// sample rate code invalid
return
0
;
if
((
p
->
buf
[
3
]
&
0xF0
)
>=
FLAC_MAX_CHANNELS
+
FLAC_CHMODE_MID_SIDE
<<
4
)
// channel mode invalid
return
0
;
if
((
p
->
buf
[
3
]
&
0x06
)
==
0x06
)
// bits per sample code invalid
return
0
;
if
((
p
->
buf
[
3
]
&
0x01
)
==
0x01
)
// reserved bit set
return
0
;
return
AVPROBE_SCORE_EXTENSION
/
4
+
1
;
}
static
int
flac_probe
(
AVProbeData
*
p
)
{
if
((
AV_RB16
(
p
->
buf
)
&
0xFFFE
)
==
0xFFF8
)
return
raw_flac_probe
(
p
);
if
(
p
->
buf_size
<
4
||
memcmp
(
p
->
buf
,
"fLaC"
,
4
))
return
0
;
return
AVPROBE_SCORE_EXTENSION
;
...
...
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