Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
FFmpeg
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
libremedia
Tethys
FFmpeg
Commits
0e9c01fd
Commit
0e9c01fd
authored
6 years ago
by
Cameron Cawley
Committed by
Paul B Mahol
6 years ago
Browse files
Options
Downloads
Patches
Plain Diff
avformat/rpl: Support files containing 8 bit PCM or VIDC audio
Signed-off-by:
Cameron Cawley
<
ccawley2011@gmail.com
>
parent
22238d0b
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
libavformat/rpl.c
+16
-1
16 additions, 1 deletion
libavformat/rpl.c
with
16 additions
and
1 deletion
libavformat/rpl.c
+
16
−
1
View file @
0e9c01fd
...
...
@@ -119,6 +119,8 @@ static int rpl_read_header(AVFormatContext *s)
AVStream
*
vst
=
NULL
,
*
ast
=
NULL
;
int
total_audio_size
;
int
error
=
0
;
const
char
*
endptr
;
char
audio_type
[
RPL_LINE_LENGTH
];
uint32_t
i
;
...
...
@@ -188,7 +190,9 @@ static int rpl_read_header(AVFormatContext *s)
ast
->
codecpar
->
codec_tag
=
audio_format
;
ast
->
codecpar
->
sample_rate
=
read_line_and_int
(
pb
,
&
error
);
// audio bitrate
ast
->
codecpar
->
channels
=
read_line_and_int
(
pb
,
&
error
);
// number of audio channels
ast
->
codecpar
->
bits_per_coded_sample
=
read_line_and_int
(
pb
,
&
error
);
// audio bits per sample
error
|=
read_line
(
pb
,
line
,
sizeof
(
line
));
ast
->
codecpar
->
bits_per_coded_sample
=
read_int
(
line
,
&
endptr
,
&
error
);
// audio bits per sample
strcpy
(
audio_type
,
endptr
);
// At least one sample uses 0 for ADPCM, which is really 4 bits
// per sample.
if
(
ast
->
codecpar
->
bits_per_coded_sample
==
0
)
...
...
@@ -205,6 +209,17 @@ static int rpl_read_header(AVFormatContext *s)
// 16-bit audio is always signed
ast
->
codecpar
->
codec_id
=
AV_CODEC_ID_PCM_S16LE
;
break
;
}
else
if
(
ast
->
codecpar
->
bits_per_coded_sample
==
8
)
{
if
(
strstr
(
audio_type
,
"unsigned"
)
!=
NULL
)
{
ast
->
codecpar
->
codec_id
=
AV_CODEC_ID_PCM_U8
;
break
;
}
else
if
(
strstr
(
audio_type
,
"linear"
)
!=
NULL
)
{
ast
->
codecpar
->
codec_id
=
AV_CODEC_ID_PCM_S8
;
break
;
}
else
{
ast
->
codecpar
->
codec_id
=
AV_CODEC_ID_PCM_VIDC
;
break
;
}
}
// There are some other formats listed as legal per the spec;
// samples needed.
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment