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
21fd2f84
Commit
21fd2f84
authored
Aug 30, 2013
by
Christian Schmidt
Committed by
Luca Barbato
Aug 31, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pcm_bluray: cosmetics
parent
0d6549d8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
6 deletions
+8
-6
pcm-bluray.c
libavcodec/pcm-bluray.c
+8
-6
No files found.
libavcodec/pcm-bluray.c
View file @
21fd2f84
...
...
@@ -46,7 +46,7 @@
*/
/**
* Parse the header of a LPCM frame read from a MPEG-TS stream
* Parse the header of a LPCM frame read from a
Blu-ray
MPEG-TS stream
* @param avctx the codec context
* @param header pointer to the first four bytes of the data packet
*/
...
...
@@ -56,8 +56,9 @@ static int pcm_bluray_parse_header(AVCodecContext *avctx,
static
const
uint8_t
bits_per_samples
[
4
]
=
{
0
,
16
,
20
,
24
};
static
const
uint32_t
channel_layouts
[
16
]
=
{
0
,
AV_CH_LAYOUT_MONO
,
0
,
AV_CH_LAYOUT_STEREO
,
AV_CH_LAYOUT_SURROUND
,
AV_CH_LAYOUT_2_1
,
AV_CH_LAYOUT_4POINT0
,
AV_CH_LAYOUT_2_2
,
AV_CH_LAYOUT_5POINT0
,
AV_CH_LAYOUT_5POINT1
,
AV_CH_LAYOUT_7POINT0
,
AV_CH_LAYOUT_7POINT1
,
0
,
0
,
0
,
0
AV_CH_LAYOUT_2_1
,
AV_CH_LAYOUT_4POINT0
,
AV_CH_LAYOUT_2_2
,
AV_CH_LAYOUT_5POINT0
,
AV_CH_LAYOUT_5POINT1
,
AV_CH_LAYOUT_7POINT0
,
AV_CH_LAYOUT_7POINT1
,
0
,
0
,
0
,
0
};
static
const
uint8_t
channels
[
16
]
=
{
0
,
1
,
0
,
2
,
3
,
3
,
4
,
4
,
5
,
6
,
7
,
8
,
0
,
0
,
0
,
0
...
...
@@ -74,8 +75,8 @@ static int pcm_bluray_parse_header(AVCodecContext *avctx,
av_log
(
avctx
,
AV_LOG_ERROR
,
"reserved sample depth (0)
\n
"
);
return
AVERROR_INVALIDDATA
;
}
avctx
->
sample_fmt
=
avctx
->
bits_per_coded_sample
==
16
?
AV_SAMPLE_FMT_S16
:
AV_SAMPLE_FMT_S32
;
avctx
->
sample_fmt
=
avctx
->
bits_per_coded_sample
==
16
?
AV_SAMPLE_FMT_S16
:
AV_SAMPLE_FMT_S32
;
avctx
->
bits_per_raw_sample
=
avctx
->
bits_per_coded_sample
;
/* get the sample rate. Not all values are used. */
...
...
@@ -147,7 +148,8 @@ static int pcm_bluray_decode_frame(AVCodecContext *avctx, void *data,
/* There's always an even number of channels in the source */
num_source_channels
=
FFALIGN
(
avctx
->
channels
,
2
);
sample_size
=
(
num_source_channels
*
(
avctx
->
sample_fmt
==
AV_SAMPLE_FMT_S16
?
16
:
24
))
>>
3
;
sample_size
=
(
num_source_channels
*
(
avctx
->
sample_fmt
==
AV_SAMPLE_FMT_S16
?
16
:
24
))
>>
3
;
samples
=
buf_size
/
sample_size
;
/* get output buffer */
...
...
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