Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
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-2-2
Commits
cb792fd5
Commit
cb792fd5
authored
Apr 21, 2014
by
Tristan Matthews
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
speex: cosmetics
parent
08feb323
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
13 deletions
+13
-13
modules/codec/speex.c
modules/codec/speex.c
+13
-13
No files found.
modules/codec/speex.c
View file @
cb792fd5
...
...
@@ -558,18 +558,18 @@ static void *ProcessPacket( decoder_t *p_dec, ogg_packet *p_oggpacket,
i_pcm_output_size
=
p_sys
->
p_header
->
frame_size
;
p_frame_holder
=
(
short
*
)
xmalloc
(
sizeof
(
short
)
*
i_pcm_output_size
);
speex_bits_read_from
(
&
p_sys
->
bits
,
(
char
*
)
p_oggpacket
->
packet
,
speex_bits_read_from
(
&
p_sys
->
bits
,
(
char
*
)
p_oggpacket
->
packet
,
p_oggpacket
->
bytes
);
i_bits_before
=
speex_bits_remaining
(
&
p_sys
->
bits
);
i_bits_before
=
speex_bits_remaining
(
&
p_sys
->
bits
);
speex_decode_int
(
p_sys
->
p_state
,
&
p_sys
->
bits
,
p_frame_holder
);
i_bits_after
=
speex_bits_remaining
(
&
p_sys
->
bits
);
i_bits_in_speex_frame
=
i_bits_before
-
i_bits_after
;
i_bits_in_speex_frame
=
i_bits_before
-
i_bits_after
;
i_bytes_in_speex_frame
=
(
i_bits_in_speex_frame
+
(
8
-
(
i_bits_in_speex_frame
%
8
))
)
/
8
;
/
8
;
p_new_block
=
block_Alloc
(
i_bytes_in_speex_frame
);
p_new_block
=
block_Alloc
(
i_bytes_in_speex_frame
);
memset
(
p_new_block
->
p_buffer
,
0xff
,
i_bytes_in_speex_frame
);
/*
...
...
@@ -644,7 +644,7 @@ static block_t *DecodeRtpSpeexPacket( decoder_t *p_dec, block_t **pp_block )
*/
if
(
p_sys
->
bits
.
buf_size
==
0
)
{
p_sys
->
p_header
=
(
SpeexHeader
*
)
malloc
(
sizeof
(
SpeexHeader
));
p_sys
->
p_header
=
malloc
(
sizeof
(
SpeexHeader
));
if
(
!
p_sys
->
p_header
)
{
msg_Err
(
p_dec
,
"Could not allocate a Speex header."
);
...
...
@@ -654,7 +654,7 @@ static block_t *DecodeRtpSpeexPacket( decoder_t *p_dec, block_t **pp_block )
const
SpeexMode
*
mode
=
speex_lib_get_mode
((
p_sys
->
rtp_rate
/
8000
)
>>
1
);
speex_init_header
(
p_sys
->
p_header
,
p_sys
->
rtp_rate
,
1
,
mode
);
speex_bits_init
(
&
p_sys
->
bits
);
speex_bits_init
(
&
p_sys
->
bits
);
p_sys
->
p_state
=
speex_decoder_init
(
mode
);
if
(
!
p_sys
->
p_state
)
{
...
...
@@ -663,22 +663,22 @@ static block_t *DecodeRtpSpeexPacket( decoder_t *p_dec, block_t **pp_block )
return
NULL
;
}
/*
/*
Assume that variable bit rate is enabled. Also assume
that there is only one frame per packet.
*/
p_sys
->
p_header
->
vbr
=
1
;
p_sys
->
p_header
->
frames_per_packet
=
1
;
p_dec
->
fmt_out
.
audio
.
i_channels
=
p_sys
->
p_header
->
nb_channels
;
p_dec
->
fmt_out
.
audio
.
i_channels
=
p_sys
->
p_header
->
nb_channels
;
p_dec
->
fmt_out
.
audio
.
i_physical_channels
=
p_dec
->
fmt_out
.
audio
.
i_original_channels
=
pi_channels_maps
[
p_sys
->
p_header
->
nb_channels
];
p_dec
->
fmt_out
.
audio
.
i_rate
=
p_sys
->
p_header
->
rate
;
p_dec
->
fmt_out
.
audio
.
i_rate
=
p_sys
->
p_header
->
rate
;
if
(
speex_mode_query
(
&
speex_nb_mode
,
SPEEX_MODE_FRAME_SIZE
,
&
i_speex_frame_size
)
)
if
(
speex_mode_query
(
&
speex_nb_mode
,
SPEEX_MODE_FRAME_SIZE
,
&
i_speex_frame_size
)
)
{
msg_Err
(
p_dec
,
"Could not determine the frame size."
);
speex_decoder_destroy
(
p_sys
->
p_state
);
...
...
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