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
7e028434
Commit
7e028434
authored
Apr 11, 2012
by
Jean-Baptiste Kempf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Vorbis: code cosmetics
parent
99800d92
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
13 deletions
+8
-13
modules/codec/vorbis.c
modules/codec/vorbis.c
+8
-13
No files found.
modules/codec/vorbis.c
View file @
7e028434
/*****************************************************************************
* vorbis.c: vorbis decoder/encoder/packetizer module using of libvorbis.
*****************************************************************************
* Copyright (C) 2001-20
03
the VideoLAN team
* Copyright (C) 2001-20
12
the VideoLAN team
* Copyright (C) 2007 Société des arts technologiques
* Copyright (C) 2007 Savoir-faire Linux
*
...
...
@@ -233,12 +233,11 @@ static int OpenDecoder( vlc_object_t *p_this )
decoder_sys_t
*
p_sys
;
if
(
p_dec
->
fmt_in
.
i_codec
!=
VLC_CODEC_VORBIS
)
{
return
VLC_EGENERIC
;
}
/* Allocate the memory needed to store the decoder's structure */
if
(
(
p_dec
->
p_sys
=
p_sys
=
malloc
(
sizeof
(
*
p_sys
)
)
)
==
NULL
)
p_dec
->
p_sys
=
p_sys
=
malloc
(
sizeof
(
*
p_sys
)
);
if
(
unlikely
(
!
p_sys
)
)
return
VLC_ENOMEM
;
/* Misc init */
...
...
@@ -474,10 +473,8 @@ static void *ProcessPacket( decoder_t *p_dec, ogg_packet *p_oggpacket,
static
void
Interleave
(
INTERLEAVE_TYPE
*
p_out
,
const
INTERLEAVE_TYPE
**
pp_in
,
int
i_nb_channels
,
int
i_samples
,
int
*
pi_chan_table
)
{
int
i
,
j
;
for
(
j
=
0
;
j
<
i_samples
;
j
++
)
for
(
i
=
0
;
i
<
i_nb_channels
;
i
++
)
for
(
int
j
=
0
;
j
<
i_samples
;
j
++
)
for
(
int
i
=
0
;
i
<
i_nb_channels
;
i
++
)
p_out
[
j
*
i_nb_channels
+
pi_chan_table
[
i
]]
=
pp_in
[
i
][
j
]
#ifdef MODULE_NAME_IS_tremor
*
(
FIXED32_ONE
>>
24
)
...
...
@@ -743,7 +740,7 @@ static int OpenEncoder( vlc_object_t *p_this )
p_enc
->
p_sys
=
p_sys
;
p_enc
->
pf_encode_audio
=
Encode
;
p_enc
->
fmt_in
.
i_codec
=
VLC_CODEC_FL32
;
p_enc
->
fmt_in
.
i_codec
=
VLC_CODEC_FL32
;
p_enc
->
fmt_out
.
i_codec
=
VLC_CODEC_VORBIS
;
config_ChainParse
(
p_enc
,
ENC_CFG_PREFIX
,
ppsz_enc_options
,
p_enc
->
p_cfg
);
...
...
@@ -850,8 +847,6 @@ static block_t *Encode( encoder_t *p_enc, aout_buffer_t *p_aout_buf )
ogg_packet
oggpacket
;
block_t
*
p_block
,
*
p_chain
=
NULL
;
float
**
buffer
;
unsigned
int
i
;
unsigned
int
j
;
mtime_t
i_pts
=
p_aout_buf
->
i_pts
-
(
mtime_t
)
1000000
*
(
mtime_t
)
p_sys
->
i_samples_delay
/
...
...
@@ -862,9 +857,9 @@ static block_t *Encode( encoder_t *p_enc, aout_buffer_t *p_aout_buf )
buffer
=
vorbis_analysis_buffer
(
&
p_sys
->
vd
,
p_aout_buf
->
i_nb_samples
);
/* convert samples to float and uninterleave */
for
(
i
=
0
;
i
<
p_sys
->
i_channels
;
i
++
)
for
(
unsigned
int
i
=
0
;
i
<
p_sys
->
i_channels
;
i
++
)
{
for
(
j
=
0
;
j
<
p_aout_buf
->
i_nb_samples
;
j
++
)
for
(
unsigned
int
j
=
0
;
j
<
p_aout_buf
->
i_nb_samples
;
j
++
)
{
buffer
[
i
][
j
]
=
((
float
*
)
p_aout_buf
->
p_buffer
)
[
j
*
p_sys
->
i_channels
+
p_sys
->
pi_chan_table
[
i
]];
...
...
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