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
c5b8acad
Commit
c5b8acad
authored
Oct 22, 2012
by
Justin Ruggles
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
libgsmdec: always set channel layout and sample rate at initialization
Only mono 8kHz is supported.
parent
a346aaf1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
13 deletions
+5
-13
libgsm.c
libavcodec/libgsm.c
+5
-13
No files found.
libavcodec/libgsm.c
View file @
c5b8acad
...
@@ -29,6 +29,7 @@
...
@@ -29,6 +29,7 @@
#include <gsm/gsm.h>
#include <gsm/gsm.h>
#include "libavutil/audioconvert.h"
#include "avcodec.h"
#include "avcodec.h"
#include "internal.h"
#include "internal.h"
#include "gsm.h"
#include "gsm.h"
...
@@ -149,19 +150,10 @@ typedef struct LibGSMDecodeContext {
...
@@ -149,19 +150,10 @@ typedef struct LibGSMDecodeContext {
static
av_cold
int
libgsm_decode_init
(
AVCodecContext
*
avctx
)
{
static
av_cold
int
libgsm_decode_init
(
AVCodecContext
*
avctx
)
{
LibGSMDecodeContext
*
s
=
avctx
->
priv_data
;
LibGSMDecodeContext
*
s
=
avctx
->
priv_data
;
if
(
avctx
->
channels
>
1
)
{
avctx
->
channels
=
1
;
av_log
(
avctx
,
AV_LOG_ERROR
,
"Mono required for GSM, got %d channels
\n
"
,
avctx
->
channel_layout
=
AV_CH_LAYOUT_MONO
;
avctx
->
channels
);
avctx
->
sample_rate
=
8000
;
return
-
1
;
avctx
->
sample_fmt
=
AV_SAMPLE_FMT_S16
;
}
if
(
!
avctx
->
channels
)
avctx
->
channels
=
1
;
if
(
!
avctx
->
sample_rate
)
avctx
->
sample_rate
=
8000
;
avctx
->
sample_fmt
=
AV_SAMPLE_FMT_S16
;
s
->
state
=
gsm_create
();
s
->
state
=
gsm_create
();
...
...
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