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
6d7eaba8
Commit
6d7eaba8
authored
Aug 23, 2014
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
decoder/dsdiff: refactor the main decoder loop
Check for STOP before decoding the first chunk. This reduces the command latency.
parent
4259b17b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
17 deletions
+4
-17
DsdiffDecoderPlugin.cxx
src/decoder/plugins/DsdiffDecoderPlugin.cxx
+4
-17
No files found.
src/decoder/plugins/DsdiffDecoderPlugin.cxx
View file @
6d7eaba8
...
...
@@ -365,8 +365,9 @@ dsdiff_decode_chunk(Decoder &decoder, InputStream &is,
const
unsigned
buffer_frames
=
sizeof
(
buffer
)
/
frame_size
;
const
size_t
buffer_size
=
buffer_frames
*
frame_size
;
auto
cmd
=
decoder_get_command
(
decoder
);
for
(
offset_type
remaining_bytes
=
total_bytes
;
remaining_bytes
>=
frame_size
;)
{
remaining_bytes
>=
frame_size
&&
cmd
!=
DecoderCommand
::
STOP
;)
{
/* see how much aligned data from the remaining chunk
fits into the local buffer */
size_t
now_size
=
buffer_size
;
...
...
@@ -384,22 +385,8 @@ dsdiff_decode_chunk(Decoder &decoder, InputStream &is,
if
(
lsbitfirst
)
bit_reverse_buffer
(
buffer
,
buffer
+
nbytes
);
const
auto
cmd
=
decoder_data
(
decoder
,
is
,
buffer
,
nbytes
,
sample_rate
/
1000
);
switch
(
cmd
)
{
case
DecoderCommand
:
:
NONE
:
break
;
case
DecoderCommand
:
:
START
:
case
DecoderCommand
:
:
STOP
:
return
false
;
case
DecoderCommand
:
:
SEEK
:
/* Not implemented yet */
decoder_seek_error
(
decoder
);
break
;
}
cmd
=
decoder_data
(
decoder
,
is
,
buffer
,
nbytes
,
sample_rate
/
1000
);
}
return
true
;
...
...
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