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
c58cece6
Commit
c58cece6
authored
Mar 01, 2009
by
Laurent Aimar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed race condition with input ressource and input_Control.
parent
26d5c931
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
51 additions
and
3 deletions
+51
-3
src/input/input.c
src/input/input.c
+2
-3
src/input/resource.c
src/input/resource.c
+42
-0
src/input/resource.h
src/input/resource.h
+7
-0
No files found.
src/input/input.c
View file @
c58cece6
...
...
@@ -444,10 +444,9 @@ input_resource_t *input_DetachResource( input_thread_t *p_input )
{
assert
(
p_input
->
b_dead
);
input_resource_t
*
p_resource
=
p_input
->
p
->
p_resource
;
input_resource_SetInput
(
p_resource
,
NULL
);
input_resource_SetInput
(
p_input
->
p
->
p_resource
,
NULL
);
p_input
->
p
->
p_resource
=
NULL
;
input_resource_t
*
p_resource
=
input_resource_Detach
(
p_input
->
p
->
p_resource
)
;
p_input
->
p
->
p_sout
=
NULL
;
return
p_resource
;
...
...
src/input/resource.c
View file @
c58cece6
...
...
@@ -70,6 +70,15 @@ static void DestroySout( input_resource_t *p_resource )
#endif
p_resource
->
p_sout
=
NULL
;
}
static
sout_instance_t
*
DetachSout
(
input_resource_t
*
p_resource
)
{
sout_instance_t
*
p_sout
=
p_resource
->
p_sout
;
p_resource
->
p_sout
=
NULL
;
return
p_sout
;
}
static
sout_instance_t
*
RequestSout
(
input_resource_t
*
p_resource
,
sout_instance_t
*
p_sout
,
const
char
*
psz_sout
)
{
...
...
@@ -135,6 +144,15 @@ static void DestroyVout( input_resource_t *p_resource )
p_resource
->
p_vout_free
=
NULL
;
}
static
vout_thread_t
*
DetachVout
(
input_resource_t
*
p_resource
)
{
assert
(
p_resource
->
i_vout
==
0
);
vout_thread_t
*
p_vout
=
p_resource
->
p_vout_free
;
p_resource
->
p_vout_free
=
NULL
;
return
p_vout
;
}
static
void
DisplayVoutTitle
(
input_resource_t
*
p_resource
,
vout_thread_t
*
p_vout
)
{
...
...
@@ -303,6 +321,14 @@ static void DestroyAout( input_resource_t *p_resource )
vlc_object_release
(
p_resource
->
p_aout
);
p_resource
->
p_aout
=
NULL
;
}
static
aout_instance_t
*
DetachAout
(
input_resource_t
*
p_resource
)
{
aout_instance_t
*
p_aout
=
p_resource
->
p_aout
;
p_resource
->
p_aout
=
NULL
;
return
p_aout
;
}
static
aout_instance_t
*
RequestAout
(
input_resource_t
*
p_resource
,
aout_instance_t
*
p_aout
)
{
assert
(
p_resource
->
p_input
);
...
...
@@ -392,6 +418,22 @@ void input_resource_SetInput( input_resource_t *p_resource, input_thread_t *p_in
vlc_mutex_unlock
(
&
p_resource
->
lock
);
}
input_resource_t
*
input_resource_Detach
(
input_resource_t
*
p_resource
)
{
input_resource_t
*
p_ret
=
input_resource_New
();
if
(
!
p_ret
)
return
NULL
;
vlc_mutex_lock
(
&
p_resource
->
lock
);
assert
(
!
p_resource
->
p_input
);
p_ret
->
p_sout
=
DetachSout
(
p_resource
);
p_ret
->
p_vout_free
=
DetachVout
(
p_resource
);
p_ret
->
p_aout
=
DetachAout
(
p_resource
);
vlc_mutex_unlock
(
&
p_resource
->
lock
);
return
p_ret
;
}
vout_thread_t
*
input_resource_RequestVout
(
input_resource_t
*
p_resource
,
vout_thread_t
*
p_vout
,
video_format_t
*
p_fmt
,
bool
b_recycle
)
{
...
...
src/input/resource.h
View file @
c58cece6
...
...
@@ -40,6 +40,13 @@ input_resource_t *input_resource_New( void );
*/
void
input_resource_SetInput
(
input_resource_t
*
,
input_thread_t
*
);
/**
* This function return a input_resource_t with all resources detach from the
* given input_resource_t.
* It must not be associated to an input.
*/
input_resource_t
*
input_resource_Detach
(
input_resource_t
*
);
/**
* This function handles sout request.
*/
...
...
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