Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-gpu
Commits
6c101d63
Commit
6c101d63
authored
Jun 25, 2011
by
Laurent Aimar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed blu-ray LPCM support for non even channels count (closed #4957).
parent
9acd8e26
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
8 deletions
+34
-8
modules/codec/lpcm.c
modules/codec/lpcm.c
+34
-8
No files found.
modules/codec/lpcm.c
View file @
6c101d63
...
...
@@ -180,10 +180,12 @@ static int AobHeader( unsigned *pi_rate,
static
void
AobExtract
(
aout_buffer_t
*
,
block_t
*
,
unsigned
i_bits
,
aob_group_t
p_group
[
2
]
);
/* */
static
int
BdHeader
(
unsigned
*
pi_rate
,
unsigned
*
pi_channels
,
unsigned
*
pi_original_channels
,
unsigned
*
pi_channels
,
unsigned
*
pi_channels_padding
,
unsigned
*
pi_original_channels
,
unsigned
*
pi_bits
,
const
uint8_t
*
p_header
);
static
void
BdExtract
(
aout_buffer_t
*
,
block_t
*
);
static
void
BdExtract
(
aout_buffer_t
*
,
block_t
*
,
unsigned
,
unsigned
,
unsigned
,
unsigned
);
/*****************************************************************************
...
...
@@ -319,6 +321,7 @@ static void *DecodeFrame( decoder_t *p_dec, block_t **pp_block )
}
int
i_ret
;
unsigned
i_channels_padding
=
0
;
unsigned
i_padding
=
0
;
aob_group_t
p_aob_group
[
2
];
switch
(
p_sys
->
i_type
)
...
...
@@ -333,7 +336,7 @@ static void *DecodeFrame( decoder_t *p_dec, block_t **pp_block )
p_block
->
p_buffer
);
break
;
case
LPCM_BD
:
i_ret
=
BdHeader
(
&
i_rate
,
&
i_channels
,
&
i_original_channels
,
&
i_bits
,
i_ret
=
BdHeader
(
&
i_rate
,
&
i_channels
,
&
i_
channels_padding
,
&
i_
original_channels
,
&
i_bits
,
p_block
->
p_buffer
);
break
;
default:
...
...
@@ -358,7 +361,8 @@ static void *DecodeFrame( decoder_t *p_dec, block_t **pp_block )
p_dec
->
fmt_out
.
audio
.
i_original_channels
=
i_original_channels
;
p_dec
->
fmt_out
.
audio
.
i_physical_channels
=
i_original_channels
&
AOUT_CHAN_PHYSMASK
;
i_frame_length
=
(
p_block
->
i_buffer
-
p_sys
->
i_header_size
-
i_padding
)
/
i_channels
*
8
/
i_bits
;
i_frame_length
=
(
p_block
->
i_buffer
-
p_sys
->
i_header_size
-
i_padding
)
/
(
i_channels
+
i_channels_padding
)
*
8
/
i_bits
;
if
(
p_sys
->
b_packetizer
)
{
...
...
@@ -409,7 +413,7 @@ static void *DecodeFrame( decoder_t *p_dec, block_t **pp_block )
default:
assert
(
0
);
case
LPCM_BD
:
BdExtract
(
p_aout_buffer
,
p_block
);
BdExtract
(
p_aout_buffer
,
p_block
,
i_frame_length
,
i_channels
,
i_channels_padding
,
i_bits
);
break
;
}
...
...
@@ -815,7 +819,9 @@ static int AobHeader( unsigned *pi_rate,
}
static
int
BdHeader
(
unsigned
*
pi_rate
,
unsigned
*
pi_channels
,
unsigned
*
pi_original_channels
,
unsigned
*
pi_channels
,
unsigned
*
pi_channels_padding
,
unsigned
*
pi_original_channels
,
unsigned
*
pi_bits
,
const
uint8_t
*
p_header
)
{
...
...
@@ -876,6 +882,8 @@ static int BdHeader( unsigned *pi_rate,
default:
return
-
1
;
}
*
pi_channels_padding
=
*
pi_channels
&
1
;
switch
(
(
h
>>
6
)
&
0x03
)
{
case
1
:
...
...
@@ -1027,8 +1035,26 @@ static void AobExtract( aout_buffer_t *p_aout_buffer,
}
}
static
void
BdExtract
(
aout_buffer_t
*
p_aout_buffer
,
block_t
*
p_block
)
static
void
BdExtract
(
aout_buffer_t
*
p_aout_buffer
,
block_t
*
p_block
,
unsigned
i_frame_length
,
unsigned
i_channels
,
unsigned
i_channels_padding
,
unsigned
i_bits
)
{
memcpy
(
p_aout_buffer
->
p_buffer
,
p_block
->
p_buffer
,
p_block
->
i_buffer
);
if
(
i_channels_padding
>
0
)
{
uint8_t
*
p_src
=
p_block
->
p_buffer
;
uint8_t
*
p_dst
=
p_aout_buffer
->
p_buffer
;
while
(
i_frame_length
>
0
)
{
memcpy
(
p_dst
,
p_src
,
i_channels
*
i_bits
/
8
);
p_src
+=
(
i_channels
+
i_channels_padding
)
*
i_bits
/
8
;
p_dst
+=
(
i_channels
+
0
)
*
i_bits
/
8
;
i_frame_length
--
;
}
}
else
{
memcpy
(
p_aout_buffer
->
p_buffer
,
p_block
->
p_buffer
,
p_block
->
i_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