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
f95c928f
Commit
f95c928f
authored
Nov 22, 2018
by
Igor Derzhavin
Committed by
Carl Eugen Hoyos
Nov 24, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avformat/pcmdec: endianness for audio/L16 mime type
parent
b058617f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
2 deletions
+10
-2
pcmdec.c
libavformat/pcmdec.c
+10
-2
No files found.
libavformat/pcmdec.c
View file @
f95c928f
...
...
@@ -50,9 +50,9 @@ static int pcm_read_header(AVFormatContext *s)
av_opt_get
(
s
->
pb
,
"mime_type"
,
AV_OPT_SEARCH_CHILDREN
,
&
mime_type
);
if
(
mime_type
&&
s
->
iformat
->
mime_type
)
{
int
rate
=
0
,
channels
=
0
;
int
rate
=
0
,
channels
=
0
,
little_endian
=
0
;
size_t
len
=
strlen
(
s
->
iformat
->
mime_type
);
if
(
!
av_strncasecmp
(
s
->
iformat
->
mime_type
,
mime_type
,
len
))
{
if
(
!
av_strncasecmp
(
s
->
iformat
->
mime_type
,
mime_type
,
len
))
{
/* audio/L16 */
uint8_t
*
options
=
mime_type
+
len
;
len
=
strlen
(
mime_type
);
while
(
options
<
mime_type
+
len
)
{
...
...
@@ -63,6 +63,12 @@ static int pcm_read_header(AVFormatContext *s)
sscanf
(
options
,
" rate=%d"
,
&
rate
);
if
(
!
channels
)
sscanf
(
options
,
" channels=%d"
,
&
channels
);
if
(
!
little_endian
)
{
char
val
[
14
];
/* sizeof("little-endian") == 14 */
if
(
sscanf
(
options
,
" endianness=%13s"
,
val
)
==
1
)
{
little_endian
=
strcmp
(
val
,
"little-endian"
)
==
0
;
}
}
}
if
(
rate
<=
0
)
{
av_log
(
s
,
AV_LOG_ERROR
,
...
...
@@ -74,6 +80,8 @@ static int pcm_read_header(AVFormatContext *s)
st
->
codecpar
->
sample_rate
=
rate
;
if
(
channels
>
0
)
st
->
codecpar
->
channels
=
channels
;
if
(
little_endian
)
st
->
codecpar
->
codec_id
=
AV_CODEC_ID_PCM_S16LE
;
}
}
av_freep
(
&
mime_type
);
...
...
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