Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
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-2-2
Commits
f99ed598
Commit
f99ed598
authored
Sep 07, 2009
by
Laurent Aimar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed some missing unlock() in picture_pool.
parent
0eb8d331
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
7 deletions
+21
-7
src/misc/picture_pool.c
src/misc/picture_pool.c
+21
-7
No files found.
src/misc/picture_pool.c
View file @
f99ed598
...
...
@@ -58,7 +58,9 @@ struct picture_pool_t {
picture_t
**
picture
;
};
static
void
PicturePoolPictureRelease
(
picture_t
*
);
static
void
Release
(
picture_t
*
);
static
int
Lock
(
picture_t
*
);
static
void
Unlock
(
picture_t
*
);
picture_pool_t
*
picture_pool_NewExtended
(
const
picture_pool_configuration_t
*
cfg
)
{
...
...
@@ -92,7 +94,7 @@ picture_pool_t *picture_pool_NewExtended(const picture_pool_configuration_t *cfg
/* */
picture
->
i_refcount
=
0
;
picture
->
pf_release
=
PicturePoolPicture
Release
;
picture
->
pf_release
=
Release
;
picture
->
p_release_sys
=
release_sys
;
/* */
...
...
@@ -165,8 +167,7 @@ picture_t *picture_pool_Get(picture_pool_t *pool)
if
(
picture
->
i_refcount
>
0
)
continue
;
picture_release_sys_t
*
release_sys
=
picture
->
p_release_sys
;
if
(
release_sys
->
lock
&&
release_sys
->
lock
(
picture
))
if
(
Lock
(
picture
))
continue
;
/* */
...
...
@@ -185,7 +186,8 @@ void picture_pool_NonEmpty(picture_pool_t *pool, bool reset)
picture_t
*
picture
=
pool
->
picture
[
i
];
if
(
reset
)
{
/* TODO pf_unlock */
if
(
picture
->
i_refcount
>
0
)
Unlock
(
picture
);
picture
->
i_refcount
=
0
;
}
else
if
(
picture
->
i_refcount
==
0
)
{
return
;
...
...
@@ -194,18 +196,30 @@ void picture_pool_NonEmpty(picture_pool_t *pool, bool reset)
}
}
if
(
!
reset
&&
old
)
{
/* TODO pf_unlock */
if
(
old
->
i_refcount
>
0
)
Unlock
(
old
);
old
->
i_refcount
=
0
;
}
}
static
void
PicturePoolPicture
Release
(
picture_t
*
picture
)
static
void
Release
(
picture_t
*
picture
)
{
assert
(
picture
->
i_refcount
>
0
);
if
(
--
picture
->
i_refcount
>
0
)
return
;
Unlock
(
picture
);
}
static
int
Lock
(
picture_t
*
picture
)
{
picture_release_sys_t
*
release_sys
=
picture
->
p_release_sys
;
if
(
release_sys
->
lock
)
return
release_sys
->
lock
(
picture
);
return
VLC_SUCCESS
;
}
static
void
Unlock
(
picture_t
*
picture
)
{
picture_release_sys_t
*
release_sys
=
picture
->
p_release_sys
;
if
(
release_sys
->
unlock
)
release_sys
->
unlock
(
picture
);
...
...
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