Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
4244e612
Commit
4244e612
authored
Jul 01, 2020
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
decoder/opus: simplify indentation in HandleAudio()
parent
46eab050
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
24 deletions
+26
-24
OpusDecoderPlugin.cxx
src/decoder/plugins/OpusDecoderPlugin.cxx
+26
-24
No files found.
src/decoder/plugins/OpusDecoderPlugin.cxx
View file @
4244e612
...
...
@@ -250,34 +250,36 @@ MPDOpusDecoder::HandleAudio(const ogg_packet &packet)
packet
.
bytes
,
output_buffer
,
opus_output_buffer_frames
,
0
);
if
(
nframes
<
0
)
throw
FormatRuntimeError
(
"libopus error: %s"
,
opus_strerror
(
nframes
));
if
(
nframes
>
0
)
{
/* apply the "skip" value */
if
(
skip
>=
(
unsigned
)
nframes
)
{
skip
-=
nframes
;
if
(
gcc_unlikely
(
nframes
<=
0
))
{
if
(
nframes
<
0
)
throw
FormatRuntimeError
(
"libopus error: %s"
,
opus_strerror
(
nframes
));
else
return
;
}
}
/* apply the "skip" value */
if
(
skip
>=
(
unsigned
)
nframes
)
{
skip
-=
nframes
;
return
;
}
const
opus_int16
*
data
=
output_buffer
;
data
+=
skip
*
previous_channels
;
nframes
-=
skip
;
skip
=
0
;
const
opus_int16
*
data
=
output_buffer
;
data
+=
skip
*
previous_channels
;
nframes
-=
skip
;
skip
=
0
;
/* submit decoded samples to the DecoderClient */
const
size_t
nbytes
=
nframes
*
frame_size
;
auto
cmd
=
client
.
SubmitData
(
input_stream
,
data
,
nbytes
,
0
);
if
(
cmd
!=
DecoderCommand
::
NONE
)
throw
cmd
;
/* submit decoded samples to the DecoderClient */
const
size_t
nbytes
=
nframes
*
frame_size
;
auto
cmd
=
client
.
SubmitData
(
input_stream
,
data
,
nbytes
,
0
);
if
(
cmd
!=
DecoderCommand
::
NONE
)
throw
cmd
;
if
(
packet
.
granulepos
>
0
)
client
.
SubmitTimestamp
(
FloatDuration
(
packet
.
granulepos
-
pre_skip
)
/
opus_sample_rate
);
}
if
(
packet
.
granulepos
>
0
)
client
.
SubmitTimestamp
(
FloatDuration
(
packet
.
granulepos
-
pre_skip
)
/
opus_sample_rate
);
}
bool
...
...
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