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
d96d8e12
Commit
d96d8e12
authored
Nov 21, 2014
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avcodec/libspeexdec: support zygoaudio
Fixes Ticket1873 Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
2ae2c605
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
2 deletions
+11
-2
libspeexdec.c
libavcodec/libspeexdec.c
+11
-2
No files found.
libavcodec/libspeexdec.c
View file @
d96d8e12
...
@@ -33,6 +33,7 @@ typedef struct {
...
@@ -33,6 +33,7 @@ typedef struct {
SpeexStereoState
stereo
;
SpeexStereoState
stereo
;
void
*
dec_state
;
void
*
dec_state
;
int
frame_size
;
int
frame_size
;
int
pktsize
;
}
LibSpeexContext
;
}
LibSpeexContext
;
...
@@ -50,14 +51,20 @@ static av_cold int libspeex_decode_init(AVCodecContext *avctx)
...
@@ -50,14 +51,20 @@ static av_cold int libspeex_decode_init(AVCodecContext *avctx)
av_log
(
avctx
,
AV_LOG_WARNING
,
"Invalid Speex header
\n
"
);
av_log
(
avctx
,
AV_LOG_WARNING
,
"Invalid Speex header
\n
"
);
}
}
if
(
avctx
->
codec_tag
==
MKTAG
(
'S'
,
'P'
,
'X'
,
'N'
))
{
if
(
avctx
->
codec_tag
==
MKTAG
(
'S'
,
'P'
,
'X'
,
'N'
))
{
int
quality
;
if
(
!
avctx
->
extradata
||
avctx
->
extradata
&&
avctx
->
extradata_size
<
47
)
{
if
(
!
avctx
->
extradata
||
avctx
->
extradata
&&
avctx
->
extradata_size
<
47
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"Missing or invalid extradata.
\n
"
);
av_log
(
avctx
,
AV_LOG_ERROR
,
"Missing or invalid extradata.
\n
"
);
return
AVERROR_INVALIDDATA
;
return
AVERROR_INVALIDDATA
;
}
}
if
(
avctx
->
extradata
[
37
]
!=
10
)
{
quality
=
avctx
->
extradata
[
37
];
if
(
quality
>
10
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"Unsupported quality mode.
\n
"
);
av_log
(
avctx
,
AV_LOG_ERROR
,
"Unsupported quality mode.
\n
"
);
return
AVERROR_PATCHWELCOME
;
return
AVERROR_PATCHWELCOME
;
}
}
s
->
pktsize
=
((
int
[]){
5
,
10
,
15
,
20
,
20
,
28
,
28
,
38
,
38
,
46
,
62
})[
quality
];
spx_mode
=
0
;
spx_mode
=
0
;
}
else
if
(
header
)
{
}
else
if
(
header
)
{
avctx
->
sample_rate
=
header
->
rate
;
avctx
->
sample_rate
=
header
->
rate
;
...
@@ -143,9 +150,11 @@ static int libspeex_decode_frame(AVCodecContext *avctx, void *data,
...
@@ -143,9 +150,11 @@ static int libspeex_decode_frame(AVCodecContext *avctx, void *data,
*
got_frame_ptr
=
0
;
*
got_frame_ptr
=
0
;
return
buf_size
;
return
buf_size
;
}
}
if
(
s
->
pktsize
&&
buf_size
==
62
)
buf_size
=
s
->
pktsize
;
/* set new buffer */
/* set new buffer */
speex_bits_read_from
(
&
s
->
bits
,
buf
,
buf_size
);
speex_bits_read_from
(
&
s
->
bits
,
buf
,
buf_size
);
consumed
=
buf_
size
;
consumed
=
avpkt
->
size
;
}
}
/* decode a single frame */
/* decode a single frame */
...
...
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