Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
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
Commits
87119399
Commit
87119399
authored
Apr 08, 2005
by
Christophe Massiot
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* modules/audio_filter/converter/mpgatofixed32 : Fixed a major bug with
downmixing ; completed downmixing options.
parent
03404c72
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
56 additions
and
17 deletions
+56
-17
modules/audio_filter/converter/mpgatofixed32.c
modules/audio_filter/converter/mpgatofixed32.c
+56
-17
No files found.
modules/audio_filter/converter/mpgatofixed32.c
View file @
87119399
...
...
@@ -2,7 +2,7 @@
* mpgatofixed32.c: MPEG-1 & 2 audio layer I, II, III + MPEG 2.5 decoder,
* using MAD (MPEG Audio Decoder)
*****************************************************************************
* Copyright (C) 2001
by Jean-Paul Saman
* Copyright (C) 2001
-2005 VideoLAN
* $Id$
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
...
...
@@ -126,7 +126,7 @@ static void DoWork( aout_instance_t * p_aout, aout_filter_t * p_filter,
p_out_buf
->
i_nb_samples
=
p_in_buf
->
i_nb_samples
;
p_out_buf
->
i_nb_bytes
=
p_in_buf
->
i_nb_samples
*
sizeof
(
vlc_fixed_t
)
*
aout_FormatNbChannels
(
&
p_filter
->
in
put
);
aout_FormatNbChannels
(
&
p_filter
->
out
put
);
/* Do the actual decoding now. */
mad_stream_buffer
(
&
p_sys
->
mad_stream
,
p_in_buf
->
p_buffer
,
...
...
@@ -165,17 +165,37 @@ static void DoWork( aout_instance_t * p_aout, aout_filter_t * p_filter,
switch
(
p_pcm
->
channels
)
{
case
2
:
if
(
p_filter
->
output
.
i_original_channels
==
AOUT_CHAN_CENTER
)
if
(
p_filter
->
output
.
i_physical_channels
==
AOUT_CHAN_CENTER
)
{
while
(
i_samples
--
)
{
*
p_samples
++
=
(
*
p_left
++
>>
1
)
+
(
*
p_right
++
>>
1
);
}
}
else
if
(
p_filter
->
output
.
i_original_channels
==
AOUT_CHAN_LEFT
)
{
while
(
i_samples
--
)
{
*
p_samples
++
=
*
p_left
;
*
p_samples
++
=
*
p_left
++
;
}
}
else
if
(
p_filter
->
output
.
i_original_channels
==
AOUT_CHAN_RIGHT
)
{
while
(
i_samples
--
)
{
*
p_samples
++
=
*
p_right
;
*
p_samples
++
=
*
p_right
++
;
}
}
else
{
while
(
i_samples
--
)
{
*
p_samples
++
=
*
p_left
++
;
*
p_samples
++
=
*
p_right
++
;
}
}
break
;
case
1
:
...
...
@@ -201,18 +221,38 @@ static void DoWork( aout_instance_t * p_aout, aout_filter_t * p_filter,
switch
(
p_pcm
->
channels
)
{
case
2
:
if
(
p_filter
->
output
.
i_original_channels
==
AOUT_CHAN_CENTER
)
if
(
p_filter
->
output
.
i_physical_channels
==
AOUT_CHAN_CENTER
)
{
while
(
i_samples
--
)
{
*
p_samples
++
=
(
float
)
*
p_left
++
/
f_temp
/
2
+
(
float
)
*
p_right
++
/
f_temp
/
2
;
}
}
else
if
(
p_filter
->
output
.
i_original_channels
==
AOUT_CHAN_LEFT
)
{
while
(
i_samples
--
)
{
*
p_samples
++
=
(
float
)
*
p_left
/
f_temp
;
*
p_samples
++
=
(
float
)
*
p_left
++
/
f_temp
;
}
}
else
if
(
p_filter
->
output
.
i_original_channels
==
AOUT_CHAN_RIGHT
)
{
while
(
i_samples
--
)
{
*
p_samples
++
=
(
float
)
*
p_right
/
f_temp
;
*
p_samples
++
=
(
float
)
*
p_right
++
/
f_temp
;
}
}
else
{
while
(
i_samples
--
)
{
*
p_samples
++
=
(
float
)
*
p_left
++
/
f_temp
;
*
p_samples
++
=
(
float
)
*
p_right
++
/
f_temp
;
}
}
break
;
case
1
:
...
...
@@ -279,13 +319,12 @@ static int OpenFilter( vlc_object_t *p_this )
p_filter
->
fmt_out
.
i_codec
=
VLC_FOURCC
(
'f'
,
'i'
,
'3'
,
'2'
);
p_filter
->
fmt_out
.
audio
.
i_format
=
p_filter
->
fmt_out
.
i_codec
;
p_filter
->
fmt_out
.
audio
.
i_bitspersample
=
sizeof
(
float
);
p_filter
->
fmt_out
.
audio
.
i_rate
=
p_filter
->
fmt_in
.
audio
.
i_rate
;
msg_Dbg
(
p_this
,
"%4.4s->%4.4s, bits per sample: %i"
,
(
char
*
)
&
p_filter
->
fmt_in
.
i_codec
,
(
char
*
)
&
p_filter
->
fmt_out
.
i_codec
,
p_filter
->
fmt_
out
.
audio
.
i_bitspersample
);
p_filter
->
fmt_
in
.
audio
.
i_bitspersample
);
return
0
;
}
...
...
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