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
a86dbb3b
Commit
a86dbb3b
authored
Sep 15, 2012
by
Edward Wang
Committed by
Jean-Baptiste Kempf
Sep 18, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
visual: use mutexes
Signed-off-by:
Jean-Baptiste Kempf
<
jb@videolan.org
>
parent
c42c4107
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
1 deletion
+10
-1
modules/visualization/visual/visual.c
modules/visualization/visual/visual.c
+9
-1
modules/visualization/visual/visual.h
modules/visualization/visual/visual.h
+1
-0
No files found.
modules/visualization/visual/visual.c
View file @
a86dbb3b
...
@@ -197,6 +197,7 @@ static int Open( vlc_object_t *p_this )
...
@@ -197,6 +197,7 @@ static int Open( vlc_object_t *p_this )
if
(
(
p_sys
->
i_height
%
2
)
!=
0
)
p_sys
->
i_height
--
;
if
(
(
p_sys
->
i_height
%
2
)
!=
0
)
p_sys
->
i_height
--
;
if
(
(
p_sys
->
i_width
%
2
)
!=
0
)
p_sys
->
i_width
--
;
if
(
(
p_sys
->
i_width
%
2
)
!=
0
)
p_sys
->
i_width
--
;
vlc_mutex_init
(
&
p_sys
->
lock
);
p_sys
->
b_close
=
false
;
p_sys
->
b_close
=
false
;
p_sys
->
i_effect
=
0
;
p_sys
->
i_effect
=
0
;
p_sys
->
effect
=
NULL
;
p_sys
->
effect
=
NULL
;
...
@@ -325,7 +326,10 @@ static block_t *DoWork( filter_t *p_filter, block_t *p_in_buf )
...
@@ -325,7 +326,10 @@ static block_t *DoWork( filter_t *p_filter, block_t *p_in_buf )
/* First, get a new picture */
/* First, get a new picture */
do
do
{
{
if
(
p_sys
->
b_close
)
vlc_mutex_lock
(
&
p_sys
->
lock
);
bool
close
=
p_sys
->
b_close
;
vlc_mutex_unlock
(
&
p_sys
->
lock
);
if
(
close
)
return
NULL
;
return
NULL
;
msleep
(
VOUT_OUTMEM_SLEEP
);
msleep
(
VOUT_OUTMEM_SLEEP
);
}
}
...
@@ -364,7 +368,9 @@ static void Close( vlc_object_t *p_this )
...
@@ -364,7 +368,9 @@ static void Close( vlc_object_t *p_this )
filter_t
*
p_filter
=
(
filter_t
*
)
p_this
;
filter_t
*
p_filter
=
(
filter_t
*
)
p_this
;
filter_sys_t
*
p_sys
=
p_filter
->
p_sys
;
filter_sys_t
*
p_sys
=
p_filter
->
p_sys
;
vlc_mutex_lock
(
&
p_sys
->
lock
);
p_sys
->
b_close
=
true
;
p_sys
->
b_close
=
true
;
vlc_mutex_unlock
(
&
p_sys
->
lock
);
if
(
p_filter
->
p_sys
->
p_vout
)
if
(
p_filter
->
p_sys
->
p_vout
)
{
{
...
@@ -399,4 +405,6 @@ static void Close( vlc_object_t *p_this )
...
@@ -399,4 +405,6 @@ static void Close( vlc_object_t *p_this )
free
(
p_sys
->
effect
);
free
(
p_sys
->
effect
);
free
(
p_filter
->
p_sys
);
free
(
p_filter
->
p_sys
);
vlc_mutex_destroy
(
&
p_sys
->
lock
);
}
}
modules/visualization/visual/visual.h
View file @
a86dbb3b
...
@@ -64,6 +64,7 @@ typedef struct
...
@@ -64,6 +64,7 @@ typedef struct
struct
filter_sys_t
struct
filter_sys_t
{
{
vout_thread_t
*
p_vout
;
vout_thread_t
*
p_vout
;
vlc_mutex_t
lock
;
bool
b_close
;
bool
b_close
;
int
i_width
;
int
i_width
;
...
...
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