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
e1bd2c65
Commit
e1bd2c65
authored
Mar 09, 2009
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
music_pipe: added music_pipe_contains()
parent
9f79c05e
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
0 deletions
+30
-0
pipe.c
src/pipe.c
+21
-0
pipe.h
src/pipe.h
+9
-0
No files found.
src/pipe.c
View file @
e1bd2c65
...
...
@@ -70,6 +70,7 @@ music_pipe_free(struct music_pipe *mp)
}
#ifndef NDEBUG
bool
music_pipe_check_format
(
const
struct
music_pipe
*
pipe
,
const
struct
audio_format
*
audio_format
)
...
...
@@ -80,6 +81,26 @@ music_pipe_check_format(const struct music_pipe *pipe,
return
!
audio_format_defined
(
&
pipe
->
audio_format
)
||
audio_format_equals
(
&
pipe
->
audio_format
,
audio_format
);
}
bool
music_pipe_contains
(
const
struct
music_pipe
*
mp
,
const
struct
music_chunk
*
chunk
)
{
g_mutex_lock
(
mp
->
mutex
);
for
(
const
struct
music_chunk
*
i
=
mp
->
head
;
i
!=
NULL
;
i
=
i
->
next
)
{
if
(
i
==
chunk
)
{
g_mutex_unlock
(
mp
->
mutex
);
return
true
;
}
}
g_mutex_unlock
(
mp
->
mutex
);
return
false
;
}
#endif
const
struct
music_chunk
*
...
...
src/pipe.h
View file @
e1bd2c65
...
...
@@ -47,6 +47,7 @@ void
music_pipe_free
(
struct
music_pipe
*
mp
);
#ifndef NDEBUG
/**
* Checks if the audio format if the chunk is equal to the specified
* audio_format.
...
...
@@ -54,6 +55,14 @@ music_pipe_free(struct music_pipe *mp);
bool
music_pipe_check_format
(
const
struct
music_pipe
*
pipe
,
const
struct
audio_format
*
audio_format
);
/**
* Checks if the specified chunk is enqueued in the music pipe.
*/
bool
music_pipe_contains
(
const
struct
music_pipe
*
mp
,
const
struct
music_chunk
*
chunk
);
#endif
/**
...
...
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