Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-1.1
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-1.1
Commits
9fcd7b2f
Commit
9fcd7b2f
authored
Dec 20, 2009
by
Laurent Aimar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed invalid locking order when activating visualization.
parent
27a5042b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
42 additions
and
31 deletions
+42
-31
src/audio_output/aout_internal.h
src/audio_output/aout_internal.h
+1
-0
src/audio_output/dec.c
src/audio_output/dec.c
+6
-0
src/audio_output/input.c
src/audio_output/input.c
+35
-31
No files found.
src/audio_output/aout_internal.h
View file @
9fcd7b2f
...
...
@@ -108,6 +108,7 @@ int aout_InputNew( aout_instance_t * p_aout, aout_input_t * p_input, const aout_
int
aout_InputDelete
(
aout_instance_t
*
p_aout
,
aout_input_t
*
p_input
);
int
aout_InputPlay
(
aout_instance_t
*
p_aout
,
aout_input_t
*
p_input
,
aout_buffer_t
*
p_buffer
,
int
i_input_rate
);
void
aout_InputCheckAndRestart
(
aout_instance_t
*
p_aout
,
aout_input_t
*
p_input
);
/* From filters.c : */
int
aout_FiltersCreatePipeline
(
aout_instance_t
*
p_aout
,
filter_t
**
pp_filters
,
int
*
pi_nb_filters
,
const
audio_sample_format_t
*
p_input_format
,
const
audio_sample_format_t
*
p_output_format
);
...
...
src/audio_output/dec.c
View file @
9fcd7b2f
...
...
@@ -305,11 +305,14 @@ int aout_DecPlay( aout_instance_t * p_aout, aout_input_t * p_input,
p_buffer
->
i_length
=
(
mtime_t
)
p_buffer
->
i_nb_samples
*
1000000
/
p_input
->
input
.
i_rate
;
aout_lock_mixer
(
p_aout
);
aout_lock_input
(
p_aout
,
p_input
);
if
(
p_input
->
b_error
)
{
aout_unlock_input
(
p_aout
,
p_input
);
aout_unlock_mixer
(
p_aout
);
aout_BufferFree
(
p_buffer
);
return
-
1
;
}
...
...
@@ -333,6 +336,9 @@ int aout_DecPlay( aout_instance_t * p_aout, aout_input_t * p_input,
p_input
->
b_changed
=
false
;
}
aout_InputCheckAndRestart
(
p_aout
,
p_input
);
aout_unlock_mixer
(
p_aout
);
int
i_ret
=
aout_InputPlay
(
p_aout
,
p_input
,
p_buffer
,
i_input_rate
);
aout_unlock_input
(
p_aout
,
p_input
);
...
...
src/audio_output/input.c
View file @
9fcd7b2f
...
...
@@ -456,7 +456,6 @@ int aout_InputNew( aout_instance_t * p_aout, aout_input_t * p_input, const aout_
/* Success */
p_input
->
b_error
=
false
;
p_input
->
b_restart
=
false
;
p_input
->
i_last_input_rate
=
INPUT_RATE_DEFAULT
;
return
0
;
...
...
@@ -493,48 +492,53 @@ int aout_InputDelete( aout_instance_t * p_aout, aout_input_t * p_input )
}
/*****************************************************************************
* aout_Input
Play : play a buffer
* aout_Input
CheckAndRestart : restart an input
*****************************************************************************
* This function must be entered with the input lock.
* This function must be entered with the input
and mixer
lock.
*****************************************************************************/
/* XXX Do not activate it !! */
//#define AOUT_PROCESS_BEFORE_CHEKS
int
aout_InputPlay
(
aout_instance_t
*
p_aout
,
aout_input_t
*
p_input
,
aout_buffer_t
*
p_buffer
,
int
i_input_rate
)
void
aout_InputCheckAndRestart
(
aout_instance_t
*
p_aout
,
aout_input_t
*
p_input
)
{
mtime_t
start_date
;
AOUT_ASSERT_MIXER_LOCKED
;
AOUT_ASSERT_INPUT_LOCKED
;
if
(
p_input
->
b_restart
)
{
aout_fifo_t
fifo
;
uint8_t
*
p_first_byte_to_mix
;
bool
b_paused
;
mtime_t
i_pause_date
;
if
(
!
p_input
->
b_restart
)
return
;
aout_lock_mixer
(
p_aout
);
aout_lock_input_fifos
(
p_aout
);
aout_lock_input_fifos
(
p_aout
);
/* A little trick to avoid loosing our input fifo and properties */
/* A little trick to avoid loosing our input fifo and properties */
p_first_byte_to_mix
=
p_input
->
mixer
.
begin
;
fifo
=
p_input
->
mixer
.
fifo
;
b_paused
=
p_input
->
b_paused
;
i_pause_date
=
p_input
->
i_pause_date
;
uint8_t
*
p_first_byte_to_mix
=
p_input
->
mixer
.
begin
;
aout_fifo_t
fifo
=
p_input
->
mixer
.
fifo
;
bool
b_paused
=
p_input
->
b_paused
;
mtime_t
i_pause_date
=
p_input
->
i_pause_date
;
aout_FifoInit
(
p_aout
,
&
p_input
->
mixer
.
fifo
,
p_aout
->
mixer_format
.
i_rate
);
aout_FifoInit
(
p_aout
,
&
p_input
->
mixer
.
fifo
,
p_aout
->
mixer_format
.
i_rate
);
aout_InputDelete
(
p_aout
,
p_input
);
aout_InputDelete
(
p_aout
,
p_input
);
aout_InputNew
(
p_aout
,
p_input
,
&
p_input
->
request_vout
);
p_input
->
mixer
.
begin
=
p_first_byte_to_mix
;
p_input
->
mixer
.
fifo
=
fifo
;
p_input
->
b_paused
=
b_paused
;
p_input
->
i_pause_date
=
i_pause_date
;
aout_InputNew
(
p_aout
,
p_input
,
&
p_input
->
request_vout
);
p_input
->
mixer
.
begin
=
p_first_byte_to_mix
;
p_input
->
mixer
.
fifo
=
fifo
;
p_input
->
b_paused
=
b_paused
;
p_input
->
i_pause_date
=
i_pause_date
;
aout_unlock_input_fifos
(
p_aout
);
aout_unlock_mixer
(
p_aout
);
}
p_input
->
b_restart
=
false
;
aout_unlock_input_fifos
(
p_aout
);
}
/*****************************************************************************
* aout_InputPlay : play a buffer
*****************************************************************************
* This function must be entered with the input lock.
*****************************************************************************/
/* XXX Do not activate it !! */
//#define AOUT_PROCESS_BEFORE_CHEKS
int
aout_InputPlay
(
aout_instance_t
*
p_aout
,
aout_input_t
*
p_input
,
aout_buffer_t
*
p_buffer
,
int
i_input_rate
)
{
mtime_t
start_date
;
AOUT_ASSERT_INPUT_LOCKED
;
if
(
i_input_rate
!=
INPUT_RATE_DEFAULT
&&
p_input
->
p_playback_rate_filter
==
NULL
)
{
...
...
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