Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
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-gpu
Commits
85aa03d0
Commit
85aa03d0
authored
Aug 04, 2011
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
aout: use separate lock for the packet FIFO (fix #5131)
parent
9b8e8006
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
10 deletions
+21
-10
include/vlc_aout.h
include/vlc_aout.h
+8
-7
src/audio_output/output.c
src/audio_output/output.c
+13
-3
No files found.
include/vlc_aout.h
View file @
85aa03d0
...
...
@@ -260,13 +260,14 @@ struct aout_fifo_t
/* Legacy packet-oriented audio output helpers */
typedef
struct
{
aout_fifo_t
partial
;
/**< Audio blocks before packetization */
aout_fifo_t
fifo
;
/**< Packetized audio blocks */
mtime_t
pause_date
;
/**< Date when paused or VLC_TS_INVALID */
unsigned
samples
;
/**< Samples per packet */
bool
starving
;
/* Indicates whether the audio output is currently starving, to avoid
* printing a 1,000 "output is starving" messages. */
vlc_mutex_t
lock
;
aout_fifo_t
partial
;
/**< Audio blocks before packetization */
aout_fifo_t
fifo
;
/**< Packetized audio blocks */
mtime_t
pause_date
;
/**< Date when paused or VLC_TS_INVALID */
unsigned
samples
;
/**< Samples per packet */
bool
starving
;
/* Indicates whether the audio output is currently starving, to avoid
* printing a 1,000 "output is starving" messages. */
}
aout_packet_t
;
VLC_API
void
aout_PacketInit
(
audio_output_t
*
,
aout_packet_t
*
,
unsigned
);
...
...
src/audio_output/output.c
View file @
85aa03d0
...
...
@@ -373,6 +373,7 @@ void aout_PacketInit (audio_output_t *aout, aout_packet_t *p, unsigned samples)
{
assert
(
p
==
aout_packet
(
aout
));
vlc_mutex_init
(
&
p
->
lock
);
aout_FifoInit
(
aout
,
&
p
->
partial
,
aout
->
format
.
i_rate
);
aout_FifoInit
(
aout
,
&
p
->
fifo
,
aout
->
format
.
i_rate
);
p
->
pause_date
=
VLC_TS_INVALID
;
...
...
@@ -386,6 +387,7 @@ void aout_PacketDestroy (audio_output_t *aout)
aout_FifoDestroy
(
&
p
->
partial
);
aout_FifoDestroy
(
&
p
->
fifo
);
vlc_mutex_destroy
(
&
p
->
lock
);
}
static
block_t
*
aout_OutputSlice
(
audio_output_t
*
);
...
...
@@ -394,9 +396,11 @@ void aout_PacketPlay (audio_output_t *aout, block_t *block)
{
aout_packet_t
*
p
=
aout_packet
(
aout
);
vlc_mutex_lock
(
&
p
->
lock
);
aout_FifoPush
(
&
p
->
partial
,
block
);
while
((
block
=
aout_OutputSlice
(
aout
))
!=
NULL
)
aout_FifoPush
(
&
p
->
fifo
,
block
);
vlc_mutex_unlock
(
&
p
->
lock
);
}
void
aout_PacketPause
(
audio_output_t
*
aout
,
bool
pause
,
mtime_t
date
)
...
...
@@ -415,8 +419,10 @@ void aout_PacketPause (audio_output_t *aout, bool pause, mtime_t date)
mtime_t
duration
=
date
-
p
->
pause_date
;
p
->
pause_date
=
VLC_TS_INVALID
;
vlc_mutex_lock
(
&
p
->
lock
);
aout_FifoMoveDates
(
&
p
->
partial
,
duration
);
aout_FifoMoveDates
(
&
p
->
fifo
,
duration
);
vlc_mutex_unlock
(
&
p
->
lock
);
}
}
...
...
@@ -424,8 +430,11 @@ void aout_PacketFlush (audio_output_t *aout, bool drain)
{
aout_packet_t
*
p
=
aout_packet
(
aout
);
vlc_mutex_lock
(
&
p
->
lock
);
aout_FifoReset
(
&
p
->
partial
);
aout_FifoReset
(
&
p
->
fifo
);
vlc_mutex_unlock
(
&
p
->
lock
);
(
void
)
drain
;
/* TODO */
}
...
...
@@ -442,7 +451,7 @@ static block_t *aout_OutputSlice (audio_output_t *p_aout)
const
unsigned
samples
=
p
->
samples
;
assert
(
samples
>
0
);
aout_assert_locked
(
p_aout
);
vlc_assert_locked
(
&
p
->
lock
);
/* Retrieve the date of the next buffer. */
date_t
exact_start_date
=
p
->
fifo
.
end_date
;
...
...
@@ -597,7 +606,7 @@ aout_buffer_t * aout_OutputNextBuffer( audio_output_t * p_aout,
aout_buffer_t
*
p_buffer
;
mtime_t
now
=
mdate
();
aout_lock
(
p_aout
);
vlc_mutex_lock
(
&
p
->
lock
);
/* Drop the audio sample if the audio output is really late.
* In the case of b_can_sleek, we don't use a resampler so we need to be
...
...
@@ -653,8 +662,9 @@ aout_buffer_t * aout_OutputNextBuffer( audio_output_t * p_aout,
aout_FifoMoveDates
(
&
p
->
partial
,
delta
);
aout_FifoMoveDates
(
p_fifo
,
delta
);
#warning FIXME: feed back to input for resampling!!!
}
out:
aout_unlock
(
p_aout
);
vlc_mutex_unlock
(
&
p
->
lock
);
return
p_buffer
;
}
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