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
9e78d8cf
Commit
9e78d8cf
authored
Oct 28, 2011
by
Justin Ruggles
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
g726: treat sample rates other than 8kHz as unofficial.
parent
6e8d4a7a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
0 deletions
+15
-0
g726.c
libavcodec/g726.c
+15
-0
No files found.
libavcodec/g726.c
View file @
9e78d8cf
...
@@ -302,6 +302,13 @@ static av_cold int g726_encode_init(AVCodecContext *avctx)
...
@@ -302,6 +302,13 @@ static av_cold int g726_encode_init(AVCodecContext *avctx)
{
{
G726Context
*
c
=
avctx
->
priv_data
;
G726Context
*
c
=
avctx
->
priv_data
;
if
(
avctx
->
strict_std_compliance
>
FF_COMPLIANCE_UNOFFICIAL
&&
avctx
->
sample_rate
!=
8000
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"Sample rates other than 8kHz are not "
"allowed when the compliance level is higher than unofficial. "
"Resample or reduce the compliance level.
\n
"
);
return
AVERROR
(
EINVAL
);
}
if
(
avctx
->
sample_rate
<=
0
)
{
if
(
avctx
->
sample_rate
<=
0
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"Samplerate is invalid
\n
"
);
av_log
(
avctx
,
AV_LOG_ERROR
,
"Samplerate is invalid
\n
"
);
return
-
1
;
return
-
1
;
...
@@ -366,6 +373,14 @@ static av_cold int g726_decode_init(AVCodecContext *avctx)
...
@@ -366,6 +373,14 @@ static av_cold int g726_decode_init(AVCodecContext *avctx)
{
{
G726Context
*
c
=
avctx
->
priv_data
;
G726Context
*
c
=
avctx
->
priv_data
;
if
(
avctx
->
strict_std_compliance
>=
FF_COMPLIANCE_STRICT
&&
avctx
->
sample_rate
!=
8000
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"Only 8kHz sample rate is allowed when "
"the compliance level is strict. Reduce the compliance level "
"if you wish to decode the stream anyway.
\n
"
);
return
AVERROR
(
EINVAL
);
}
if
(
avctx
->
channels
!=
1
){
if
(
avctx
->
channels
!=
1
){
av_log
(
avctx
,
AV_LOG_ERROR
,
"Only mono is supported
\n
"
);
av_log
(
avctx
,
AV_LOG_ERROR
,
"Only mono is supported
\n
"
);
return
-
1
;
return
-
1
;
...
...
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