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
56cb465b
Commit
56cb465b
authored
Apr 09, 2016
by
Carl Eugen Hoyos
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavf/gsmdec: Add raw gsm autodetection.
Fixes bug 555.
parent
d433623f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
0 deletions
+18
-0
gsmdec.c
libavformat/gsmdec.c
+18
-0
No files found.
libavformat/gsmdec.c
View file @
56cb465b
...
...
@@ -34,6 +34,23 @@ typedef struct GSMDemuxerContext {
int
sample_rate
;
}
GSMDemuxerContext
;
static
int
gsm_probe
(
AVProbeData
*
p
)
{
int
valid
=
0
,
invalid
=
0
;
uint8_t
*
b
=
p
->
buf
;
while
(
b
<
p
->
buf
+
p
->
buf_size
-
32
)
{
if
((
*
b
&
0xf0
)
==
0xd0
)
{
valid
++
;
}
else
{
invalid
++
;
}
b
+=
33
;
}
if
(
valid
>>
5
>
invalid
)
return
AVPROBE_SCORE_EXTENSION
+
1
;
return
0
;
}
static
int
gsm_read_packet
(
AVFormatContext
*
s
,
AVPacket
*
pkt
)
{
int
ret
,
size
;
...
...
@@ -91,6 +108,7 @@ AVInputFormat ff_gsm_demuxer = {
.
name
=
"gsm"
,
.
long_name
=
NULL_IF_CONFIG_SMALL
(
"raw GSM"
),
.
priv_data_size
=
sizeof
(
GSMDemuxerContext
),
.
read_probe
=
gsm_probe
,
.
read_header
=
gsm_read_header
,
.
read_packet
=
gsm_read_packet
,
.
flags
=
AVFMT_GENERIC_INDEX
,
...
...
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