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
d40dab90
Commit
d40dab90
authored
Oct 22, 2012
by
Justin Ruggles
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
libopencore-amr: set channel layout for amr-nb or if not set by the user
parent
30f8da29
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
5 deletions
+9
-5
libopencore-amr.c
libavcodec/libopencore-amr.c
+9
-5
No files found.
libavcodec/libopencore-amr.c
View file @
d40dab90
...
@@ -19,6 +19,7 @@
...
@@ -19,6 +19,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
*/
#include "libavutil/audioconvert.h"
#include "avcodec.h"
#include "avcodec.h"
#include "libavutil/avstring.h"
#include "libavutil/avstring.h"
#include "libavutil/common.h"
#include "libavutil/common.h"
...
@@ -30,12 +31,15 @@ static void amr_decode_fix_avctx(AVCodecContext *avctx)
...
@@ -30,12 +31,15 @@ static void amr_decode_fix_avctx(AVCodecContext *avctx)
{
{
const
int
is_amr_wb
=
1
+
(
avctx
->
codec_id
==
AV_CODEC_ID_AMR_WB
);
const
int
is_amr_wb
=
1
+
(
avctx
->
codec_id
==
AV_CODEC_ID_AMR_WB
);
if
(
!
avctx
->
sample_rate
)
avctx
->
sample_rate
=
8000
*
is_amr_wb
;
avctx
->
sample_rate
=
8000
*
is_amr_wb
;
if
(
!
avctx
->
channels
)
if
(
avctx
->
channels
>
1
)
{
avctx
->
channels
=
1
;
av_log_missing_feature
(
avctx
,
"multi-channel AMR"
,
0
);
return
AVERROR_PATCHWELCOME
;
}
avctx
->
channels
=
1
;
avctx
->
channel_layout
=
AV_CH_LAYOUT_MONO
;
avctx
->
sample_fmt
=
AV_SAMPLE_FMT_S16
;
avctx
->
sample_fmt
=
AV_SAMPLE_FMT_S16
;
}
}
...
...
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