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
2e648b57
Commit
2e648b57
authored
Apr 12, 2008
by
Max Kellermann
Committed by
Eric Wong
Apr 12, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added outputBufferShift()
Hiding OutputBuffer internals, yet again. Two more assertions. git-svn-id:
https://svn.musicpd.org/mpd/trunk@7274
09075e82-0dd4-0310-85a5-a0d7c8717e4f
parent
11a5728e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
4 deletions
+13
-4
decode.c
src/decode.c
+1
-4
outputBuffer.c
src/outputBuffer.c
+10
-0
outputBuffer.h
src/outputBuffer.h
+2
-0
No files found.
src/decode.c
View file @
2e648b57
...
...
@@ -557,10 +557,7 @@ static void decodeParent(PlayerControl * pc, DecoderControl * dc, OutputBuffer *
break
;
pc
->
totalPlayTime
+=
sizeToTime
*
beginChunk
->
chunkSize
;
if
((
unsigned
)
cb
->
begin
+
1
>=
buffered_chunks
)
{
cb
->
begin
=
0
;
}
else
cb
->
begin
++
;
outputBufferShift
(
cb
);
player_wakeup_decoder_nb
();
}
else
if
(
!
outputBufferEmpty
(
cb
)
&&
cb
->
begin
==
next
)
{
/* at the beginning of a new song */
...
...
src/outputBuffer.c
View file @
2e648b57
...
...
@@ -56,6 +56,16 @@ int outputBufferEmpty(const OutputBuffer * cb)
return
cb
->
begin
==
cb
->
end
;
}
void
outputBufferShift
(
OutputBuffer
*
cb
)
{
assert
(
cb
->
begin
!=
cb
->
end
);
assert
(
cb
->
begin
<
buffered_chunks
);
++
cb
->
begin
;
if
(
cb
->
begin
>=
buffered_chunks
)
cb
->
begin
=
0
;
}
unsigned
int
outputBufferRelative
(
const
OutputBuffer
*
cb
,
unsigned
i
)
{
if
(
i
>=
cb
->
begin
)
...
...
src/outputBuffer.h
View file @
2e648b57
...
...
@@ -65,6 +65,8 @@ void flushOutputBuffer(OutputBuffer * cb);
/** is the buffer empty? */
int
outputBufferEmpty
(
const
OutputBuffer
*
cb
);
void
outputBufferShift
(
OutputBuffer
*
cb
);
/**
* what is the position of the specified chunk number, relative to
* the first chunk in use?
...
...
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