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
ef48ac65
Commit
ef48ac65
authored
Apr 14, 2014
by
Carl Eugen Hoyos
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Set the bitrate when decoding speex.
The bitrate of the first frame is used as bitrate for the speex stream.
parent
63c03ea9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
1 deletion
+4
-1
libspeexdec.c
libavcodec/libspeexdec.c
+4
-1
No files found.
libavcodec/libspeexdec.c
View file @
ef48ac65
...
@@ -43,7 +43,7 @@ static av_cold int libspeex_decode_init(AVCodecContext *avctx)
...
@@ -43,7 +43,7 @@ static av_cold int libspeex_decode_init(AVCodecContext *avctx)
SpeexHeader
*
header
=
NULL
;
SpeexHeader
*
header
=
NULL
;
int
spx_mode
;
int
spx_mode
;
avctx
->
sample_fmt
=
AV_SAMPLE_FMT_
S16
;
avctx
->
sample_fmt
=
AV_SAMPLE_FMT_
NONE
;
if
(
avctx
->
extradata
&&
avctx
->
extradata_size
>=
80
)
{
if
(
avctx
->
extradata
&&
avctx
->
extradata_size
>=
80
)
{
header
=
speex_packet_to_header
(
avctx
->
extradata
,
header
=
speex_packet_to_header
(
avctx
->
extradata
,
avctx
->
extradata_size
);
avctx
->
extradata_size
);
...
@@ -125,6 +125,7 @@ static int libspeex_decode_frame(AVCodecContext *avctx, void *data,
...
@@ -125,6 +125,7 @@ static int libspeex_decode_frame(AVCodecContext *avctx, void *data,
AVFrame
*
frame
=
data
;
AVFrame
*
frame
=
data
;
int16_t
*
output
;
int16_t
*
output
;
int
ret
,
consumed
=
0
;
int
ret
,
consumed
=
0
;
avctx
->
sample_fmt
=
AV_SAMPLE_FMT_S16
;
/* get output buffer */
/* get output buffer */
frame
->
nb_samples
=
s
->
frame_size
;
frame
->
nb_samples
=
s
->
frame_size
;
...
@@ -159,6 +160,8 @@ static int libspeex_decode_frame(AVCodecContext *avctx, void *data,
...
@@ -159,6 +160,8 @@ static int libspeex_decode_frame(AVCodecContext *avctx, void *data,
*
got_frame_ptr
=
1
;
*
got_frame_ptr
=
1
;
if
(
!
avctx
->
bit_rate
)
speex_decoder_ctl
(
s
->
dec_state
,
SPEEX_GET_BITRATE
,
&
avctx
->
bit_rate
);
return
consumed
;
return
consumed
;
}
}
...
...
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