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
e7cd2376
Commit
e7cd2376
authored
Oct 24, 2008
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jack: optimize local variables
Merge the variables "avail_data" and "avail_frames" into "available". Both variables are never used at the same time.
parent
0a670442
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
9 deletions
+8
-9
audioOutput_jack.c
src/audioOutputs/audioOutput_jack.c
+8
-9
No files found.
src/audioOutputs/audioOutput_jack.c
View file @
e7cd2376
...
...
@@ -125,25 +125,24 @@ static int process(jack_nframes_t nframes, void *arg)
{
JackData
*
jd
=
(
JackData
*
)
arg
;
jack_default_audio_sample_t
*
out
;
size_t
avail
_data
,
avail_frames
;
size_t
avail
able
;
if
(
nframes
<=
0
)
return
0
;
for
(
unsigned
i
=
0
;
i
<
2
;
++
i
)
{
avail_data
=
jack_ringbuffer_read_space
(
jd
->
ringbuffer
[
i
]);
if
(
avail_data
>
nframes
*
sample_size
)
avail_data
=
nframes
*
sample_size
;
avail_frames
=
avail_data
/
sample_size
;
available
=
jack_ringbuffer_read_space
(
jd
->
ringbuffer
[
i
]);
available
/=
sample_size
;
if
(
available
>
nframes
)
available
=
nframes
;
out
=
jack_port_get_buffer
(
jd
->
ports
[
i
],
nframes
);
jack_ringbuffer_read
(
jd
->
ringbuffer
[
i
],
(
char
*
)
out
,
avail
_data
);
(
char
*
)
out
,
avail
able
*
sample_size
);
while
(
avail
_frames
<
nframes
)
while
(
avail
able
<
nframes
)
/* ringbuffer underrun, fill with silence */
out
[
avail
_frames
++
]
=
0
.
0
;
out
[
avail
able
++
]
=
0
.
0
;
}
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