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
49546ed7
Commit
49546ed7
authored
Apr 14, 2007
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Switch to libdca API
parent
4f71b897
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
29 deletions
+29
-29
modules/audio_filter/converter/dtstofloat32.c
modules/audio_filter/converter/dtstofloat32.c
+29
-29
No files found.
modules/audio_filter/converter/dtstofloat32.c
View file @
49546ed7
...
...
@@ -31,7 +31,7 @@
#include <stdlib.h>
/* malloc(), free() */
#include <string.h>
/* strdup() */
#include <d
ts
.h>
/* libdca header file */
#include <d
ca
.h>
/* libdca header file */
#include <vlc_aout.h>
#include <vlc_block.h>
...
...
@@ -66,7 +66,7 @@ static const uint32_t pi_channels_out[] =
*****************************************************************************/
struct
filter_sys_t
{
d
ts_state_t
*
p_libdts
;
/* libdca internal structure */
d
ca_state_t
*
p_libdca
;
/* libdca internal structure */
vlc_bool_t
b_dynrng
;
/* see below */
int
i_flags
;
/* libdca flags, see dtsdec/doc/libdts.txt */
vlc_bool_t
b_dontwarn
;
...
...
@@ -158,50 +158,50 @@ static int Open( vlc_object_t *p_this, filter_sys_t *p_sys,
||
(
output
.
i_original_channels
&
(
AOUT_CHAN_LEFT
|
AOUT_CHAN_RIGHT
))
)
{
p_sys
->
i_flags
=
D
TS
_MONO
;
p_sys
->
i_flags
=
D
CA
_MONO
;
}
break
;
case
AOUT_CHAN_LEFT
|
AOUT_CHAN_RIGHT
:
if
(
output
.
i_original_channels
&
AOUT_CHAN_DOLBYSTEREO
)
{
p_sys
->
i_flags
=
D
TS
_DOLBY
;
p_sys
->
i_flags
=
D
CA
_DOLBY
;
}
else
if
(
input
.
i_original_channels
==
AOUT_CHAN_CENTER
)
{
p_sys
->
i_flags
=
D
TS
_MONO
;
p_sys
->
i_flags
=
D
CA
_MONO
;
}
else
if
(
input
.
i_original_channels
&
AOUT_CHAN_DUALMONO
)
{
p_sys
->
i_flags
=
D
TS
_CHANNEL
;
p_sys
->
i_flags
=
D
CA
_CHANNEL
;
}
else
{
p_sys
->
i_flags
=
D
TS
_STEREO
;
p_sys
->
i_flags
=
D
CA
_STEREO
;
}
break
;
case
AOUT_CHAN_LEFT
|
AOUT_CHAN_RIGHT
|
AOUT_CHAN_CENTER
:
p_sys
->
i_flags
=
D
TS
_3F
;
p_sys
->
i_flags
=
D
CA
_3F
;
break
;
case
AOUT_CHAN_LEFT
|
AOUT_CHAN_RIGHT
|
AOUT_CHAN_REARCENTER
:
p_sys
->
i_flags
=
D
TS
_2F1R
;
p_sys
->
i_flags
=
D
CA
_2F1R
;
break
;
case
AOUT_CHAN_LEFT
|
AOUT_CHAN_RIGHT
|
AOUT_CHAN_CENTER
|
AOUT_CHAN_REARCENTER
:
p_sys
->
i_flags
=
D
TS
_3F1R
;
p_sys
->
i_flags
=
D
CA
_3F1R
;
break
;
case
AOUT_CHAN_LEFT
|
AOUT_CHAN_RIGHT
|
AOUT_CHAN_REARLEFT
|
AOUT_CHAN_REARRIGHT
:
p_sys
->
i_flags
=
D
TS
_2F2R
;
p_sys
->
i_flags
=
D
CA
_2F2R
;
break
;
case
AOUT_CHAN_LEFT
|
AOUT_CHAN_RIGHT
|
AOUT_CHAN_CENTER
|
AOUT_CHAN_REARLEFT
|
AOUT_CHAN_REARRIGHT
:
p_sys
->
i_flags
=
D
TS
_3F2R
;
p_sys
->
i_flags
=
D
CA
_3F2R
;
break
;
default:
...
...
@@ -211,13 +211,13 @@ static int Open( vlc_object_t *p_this, filter_sys_t *p_sys,
}
if
(
output
.
i_physical_channels
&
AOUT_CHAN_LFE
)
{
p_sys
->
i_flags
|=
D
TS
_LFE
;
p_sys
->
i_flags
|=
D
CA
_LFE
;
}
//p_sys->i_flags |= D
TS
_ADJUST_LEVEL;
//p_sys->i_flags |= D
CA
_ADJUST_LEVEL;
/* Initialize libdca */
p_sys
->
p_libd
ts
=
dts
_init
(
0
);
if
(
p_sys
->
p_libd
ts
==
NULL
)
p_sys
->
p_libd
ca
=
dca
_init
(
0
);
if
(
p_sys
->
p_libd
ca
==
NULL
)
{
msg_Err
(
p_this
,
"unable to initialize libdca"
);
return
VLC_EGENERIC
;
...
...
@@ -300,7 +300,7 @@ static void DoWork( aout_instance_t * p_aout, aout_filter_t * p_filter,
/* Needs to be called so the decoder knows which type of bitstream it is
* dealing with. */
int
i_sample_rate
,
i_bit_rate
,
i_frame_length
;
if
(
!
d
ts_syncinfo
(
p_sys
->
p_libdts
,
p_in_buf
->
p_buffer
,
&
i_flags
,
if
(
!
d
ca_syncinfo
(
p_sys
->
p_libdca
,
p_in_buf
->
p_buffer
,
&
i_flags
,
&
i_sample_rate
,
&
i_bit_rate
,
&
i_frame_length
)
)
{
msg_Warn
(
p_aout
,
"libdca couldn't sync on frame"
);
...
...
@@ -309,38 +309,38 @@ static void DoWork( aout_instance_t * p_aout, aout_filter_t * p_filter,
}
i_flags
=
p_sys
->
i_flags
;
d
ts_frame
(
p_sys
->
p_libdts
,
p_in_buf
->
p_buffer
,
d
ca_frame
(
p_sys
->
p_libdca
,
p_in_buf
->
p_buffer
,
&
i_flags
,
&
i_sample_level
,
0
);
if
(
(
i_flags
&
D
TS_CHANNEL_MASK
)
!=
(
p_sys
->
i_flags
&
DTS
_CHANNEL_MASK
)
if
(
(
i_flags
&
D
CA_CHANNEL_MASK
)
!=
(
p_sys
->
i_flags
&
DCA
_CHANNEL_MASK
)
&&
!
p_sys
->
b_dontwarn
)
{
msg_Warn
(
p_aout
,
"libdca couldn't do the requested downmix 0x%x->0x%x"
,
p_sys
->
i_flags
&
D
TS
_CHANNEL_MASK
,
i_flags
&
D
TS
_CHANNEL_MASK
);
p_sys
->
i_flags
&
D
CA
_CHANNEL_MASK
,
i_flags
&
D
CA
_CHANNEL_MASK
);
p_sys
->
b_dontwarn
=
1
;
}
if
(
0
)
//!p_sys->b_dynrng )
{
d
ts_dynrng
(
p_sys
->
p_libdts
,
NULL
,
NULL
);
d
ca_dynrng
(
p_sys
->
p_libdca
,
NULL
,
NULL
);
}
for
(
i
=
0
;
i
<
d
ts_blocks_num
(
p_sys
->
p_libdts
);
i
++
)
for
(
i
=
0
;
i
<
d
ca_blocks_num
(
p_sys
->
p_libdca
);
i
++
)
{
sample_t
*
p_samples
;
if
(
d
ts_block
(
p_sys
->
p_libdts
)
)
if
(
d
ca_block
(
p_sys
->
p_libdca
)
)
{
msg_Warn
(
p_aout
,
"d
ts
_block failed for block %d"
,
i
);
msg_Warn
(
p_aout
,
"d
ca
_block failed for block %d"
,
i
);
break
;
}
p_samples
=
d
ts_samples
(
p_sys
->
p_libdts
);
p_samples
=
d
ca_samples
(
p_sys
->
p_libdca
);
if
(
(
p_sys
->
i_flags
&
D
TS_CHANNEL_MASK
)
==
DTS
_MONO
if
(
(
p_sys
->
i_flags
&
D
CA_CHANNEL_MASK
)
==
DCA
_MONO
&&
(
p_filter
->
output
.
i_physical_channels
&
(
AOUT_CHAN_LEFT
|
AOUT_CHAN_RIGHT
))
)
{
...
...
@@ -373,7 +373,7 @@ static void Destroy( vlc_object_t *p_this )
aout_filter_t
*
p_filter
=
(
aout_filter_t
*
)
p_this
;
filter_sys_t
*
p_sys
=
(
filter_sys_t
*
)
p_filter
->
p_sys
;
d
ts_free
(
p_sys
->
p_libdts
);
d
ca_free
(
p_sys
->
p_libdca
);
free
(
p_sys
);
}
...
...
@@ -427,7 +427,7 @@ static void CloseFilter( vlc_object_t *p_this )
filter_t
*
p_filter
=
(
filter_t
*
)
p_this
;
filter_sys_t
*
p_sys
=
p_filter
->
p_sys
;
d
ts_free
(
p_sys
->
p_libdts
);
d
ca_free
(
p_sys
->
p_libdca
);
free
(
p_sys
);
}
...
...
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