Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-2-2
Commits
157bcc00
Commit
157bcc00
authored
Apr 04, 2013
by
Felix Paul Kühne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
TPCircularBuffer: merge with upstream
parent
81542864
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
1 deletion
+6
-1
modules/audio_output/TPCircularBuffer.h
modules/audio_output/TPCircularBuffer.h
+6
-1
No files found.
modules/audio_output/TPCircularBuffer.h
View file @
157bcc00
...
@@ -24,6 +24,7 @@
...
@@ -24,6 +24,7 @@
#include <libkern/OSAtomic.h>
#include <libkern/OSAtomic.h>
#include <string.h>
#include <string.h>
#include <assert.h>
#ifdef __cplusplus
#ifdef __cplusplus
extern
"C"
{
extern
"C"
{
...
@@ -95,14 +96,16 @@ static __inline__ __attribute__((always_inline)) void* TPCircularBufferTail(TPCi
...
@@ -95,14 +96,16 @@ static __inline__ __attribute__((always_inline)) void* TPCircularBufferTail(TPCi
static
__inline__
__attribute__
((
always_inline
))
void
TPCircularBufferConsume
(
TPCircularBuffer
*
buffer
,
int32_t
amount
)
{
static
__inline__
__attribute__
((
always_inline
))
void
TPCircularBufferConsume
(
TPCircularBuffer
*
buffer
,
int32_t
amount
)
{
buffer
->
tail
=
(
buffer
->
tail
+
amount
)
%
buffer
->
length
;
buffer
->
tail
=
(
buffer
->
tail
+
amount
)
%
buffer
->
length
;
OSAtomicAdd32Barrier
(
-
amount
,
&
buffer
->
fillCount
);
OSAtomicAdd32Barrier
(
-
amount
,
&
buffer
->
fillCount
);
assert
(
buffer
->
fillCount
>=
0
);
}
}
/*!
/*!
* Version of TPCircularBufferConsume without the memory barrier, for more optimal use in single-threaded contexts
* Version of TPCircularBufferConsume without the memory barrier, for more optimal use in single-threaded contexts
*/
*/
static
__inline__
__attribute__
((
always_inline
))
void
TPCircularBufferConsumeNoBarrier
(
TPCircularBuffer
*
buffer
,
int32_t
amount
)
{
static
__inline__
__attribute__
((
always_inline
))
void
TPCircularBufferConsumeNoBarrier
(
TPCircularBuffer
*
buffer
,
int32_t
amount
)
{
buffer
->
tail
=
(
buffer
->
tail
+
amount
)
%
buffer
->
length
;
buffer
->
tail
=
(
buffer
->
tail
+
amount
)
%
buffer
->
length
;
buffer
->
fillCount
-=
amount
;
buffer
->
fillCount
-=
amount
;
assert
(
buffer
->
fillCount
>=
0
);
}
}
/*!
/*!
...
@@ -134,6 +137,7 @@ static __inline__ __attribute__((always_inline)) void* TPCircularBufferHead(TPCi
...
@@ -134,6 +137,7 @@ static __inline__ __attribute__((always_inline)) void* TPCircularBufferHead(TPCi
static
__inline__
__attribute__
((
always_inline
))
void
TPCircularBufferProduce
(
TPCircularBuffer
*
buffer
,
int
amount
)
{
static
__inline__
__attribute__
((
always_inline
))
void
TPCircularBufferProduce
(
TPCircularBuffer
*
buffer
,
int
amount
)
{
buffer
->
head
=
(
buffer
->
head
+
amount
)
%
buffer
->
length
;
buffer
->
head
=
(
buffer
->
head
+
amount
)
%
buffer
->
length
;
OSAtomicAdd32Barrier
(
amount
,
&
buffer
->
fillCount
);
OSAtomicAdd32Barrier
(
amount
,
&
buffer
->
fillCount
);
assert
(
buffer
->
fillCount
<=
buffer
->
length
);
}
}
/*!
/*!
...
@@ -142,6 +146,7 @@ static __inline__ __attribute__((always_inline)) void TPCircularBufferProduce(TP
...
@@ -142,6 +146,7 @@ static __inline__ __attribute__((always_inline)) void TPCircularBufferProduce(TP
static
__inline__
__attribute__
((
always_inline
))
void
TPCircularBufferProduceNoBarrier
(
TPCircularBuffer
*
buffer
,
int
amount
)
{
static
__inline__
__attribute__
((
always_inline
))
void
TPCircularBufferProduceNoBarrier
(
TPCircularBuffer
*
buffer
,
int
amount
)
{
buffer
->
head
=
(
buffer
->
head
+
amount
)
%
buffer
->
length
;
buffer
->
head
=
(
buffer
->
head
+
amount
)
%
buffer
->
length
;
buffer
->
fillCount
+=
amount
;
buffer
->
fillCount
+=
amount
;
assert
(
buffer
->
fillCount
<=
buffer
->
length
);
}
}
/*!
/*!
...
...
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