Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
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
Commits
9ef7e90e
Commit
9ef7e90e
authored
Jun 18, 2009
by
Laurent Aimar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Used a weaker lock scheme for input_resource_HoldAout.
parent
01bec007
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
11 deletions
+23
-11
src/input/resource.c
src/input/resource.c
+23
-11
No files found.
src/input/resource.c
View file @
9ef7e90e
...
@@ -51,7 +51,6 @@ struct input_resource_t
...
@@ -51,7 +51,6 @@ struct input_resource_t
sout_instance_t
*
p_sout
;
sout_instance_t
*
p_sout
;
vout_thread_t
*
p_vout_free
;
vout_thread_t
*
p_vout_free
;
aout_instance_t
*
p_aout
;
/* This lock is used to protect vout resources access (for hold)
/* This lock is used to protect vout resources access (for hold)
* It is a special case because of embed video (possible deadlock
* It is a special case because of embed video (possible deadlock
...
@@ -61,8 +60,11 @@ struct input_resource_t
...
@@ -61,8 +60,11 @@ struct input_resource_t
/* You need lock+lock_hold to write to the following variables and
/* You need lock+lock_hold to write to the following variables and
* only lock or lock_hold to read them */
* only lock or lock_hold to read them */
int
i_vout
;
int
i_vout
;
vout_thread_t
**
pp_vout
;
vout_thread_t
**
pp_vout
;
aout_instance_t
*
p_aout
;
};
};
/* */
/* */
...
@@ -324,9 +326,13 @@ static void DestroyAout( input_resource_t *p_resource )
...
@@ -324,9 +326,13 @@ static void DestroyAout( input_resource_t *p_resource )
}
}
static
aout_instance_t
*
DetachAout
(
input_resource_t
*
p_resource
)
static
aout_instance_t
*
DetachAout
(
input_resource_t
*
p_resource
)
{
{
vlc_mutex_lock
(
&
p_resource
->
lock_hold
);
aout_instance_t
*
p_aout
=
p_resource
->
p_aout
;
aout_instance_t
*
p_aout
=
p_resource
->
p_aout
;
p_resource
->
p_aout
=
NULL
;
p_resource
->
p_aout
=
NULL
;
vlc_mutex_unlock
(
&
p_resource
->
lock_hold
);
return
p_aout
;
return
p_aout
;
}
}
...
@@ -342,34 +348,40 @@ static aout_instance_t *RequestAout( input_resource_t *p_resource, aout_instance
...
@@ -342,34 +348,40 @@ static aout_instance_t *RequestAout( input_resource_t *p_resource, aout_instance
}
}
else
else
{
{
if
(
!
p_resource
->
p_aout
)
p_aout
=
p_resource
->
p_aout
;
if
(
!
p_aout
)
{
{
msg_Dbg
(
p_resource
->
p_input
,
"creating aout"
);
msg_Dbg
(
p_resource
->
p_input
,
"creating aout"
);
p_resource
->
p_aout
=
aout_New
(
p_resource
->
p_input
);
p_aout
=
aout_New
(
p_resource
->
p_input
);
vlc_mutex_lock
(
&
p_resource
->
lock_hold
);
p_resource
->
p_aout
=
p_aout
;
vlc_mutex_unlock
(
&
p_resource
->
lock_hold
);
}
}
else
else
{
{
msg_Dbg
(
p_resource
->
p_input
,
"reusing aout"
);
msg_Dbg
(
p_resource
->
p_input
,
"reusing aout"
);
}
}
if
(
!
p_
resource
->
p_
aout
)
if
(
!
p_aout
)
return
NULL
;
return
NULL
;
vlc_object_detach
(
p_
resource
->
p_
aout
);
vlc_object_detach
(
p_aout
);
vlc_object_attach
(
p_
resource
->
p_
aout
,
p_resource
->
p_input
);
vlc_object_attach
(
p_aout
,
p_resource
->
p_input
);
vlc_object_hold
(
p_
resource
->
p_
aout
);
vlc_object_hold
(
p_aout
);
return
p_
resource
->
p_
aout
;
return
p_aout
;
}
}
}
}
static
aout_instance_t
*
HoldAout
(
input_resource_t
*
p_resource
)
static
aout_instance_t
*
HoldAout
(
input_resource_t
*
p_resource
)
{
{
if
(
!
p_resource
->
p_aout
)
vlc_mutex_lock
(
&
p_resource
->
lock_hold
);
return
NULL
;
aout_instance_t
*
p_aout
=
p_resource
->
p_aout
;
aout_instance_t
*
p_aout
=
p_resource
->
p_aout
;
if
(
p_aout
)
vlc_object_hold
(
p_aout
);
vlc_object_hold
(
p_aout
);
vlc_mutex_unlock
(
&
p_resource
->
lock_hold
);
return
p_aout
;
return
p_aout
;
}
}
...
...
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