Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
VLC
Manage
Activity
Members
Labels
Plan
Issues
4k
Issue boards
Milestones
Code
Merge requests
454
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Contributor analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
VideoLAN
VLC
Commits
39b79bfe
Commit
39b79bfe
authored
4 years ago
by
Steve Lhomme
Browse files
Options
Downloads
Patches
Plain Diff
picture_fifo: store the picture chain using vlc_picture_chain_t
parent
e5a4e71e
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/misc/picture_fifo.c
+8
-10
8 additions, 10 deletions
src/misc/picture_fifo.c
with
8 additions
and
10 deletions
src/misc/picture_fifo.c
+
8
−
10
View file @
39b79bfe
...
...
@@ -38,23 +38,21 @@
*****************************************************************************/
struct
picture_fifo_t
{
vlc_mutex_t
lock
;
picture_t
*
first
;
picture_t
*
tail
;
vlc_picture_chain_t
pics
;
};
static
void
PictureFifoReset
(
picture_fifo_t
*
fifo
)
{
fifo
->
first
=
NULL
;
fifo
->
tail
=
NULL
;
vlc_picture_chain_Init
(
&
fifo
->
pics
);
}
static
void
PictureFifoPush
(
picture_fifo_t
*
fifo
,
picture_t
*
picture
)
{
assert
(
!
picture_HasChainedPics
(
picture
));
fifo
->
tail
=
vlc_picture_chain_Append
(
&
fifo
->
firs
t
,
fifo
->
tail
,
picture
);
fifo
->
pics
.
tail
=
vlc_picture_chain_Append
(
&
fifo
->
pics
.
fron
t
,
fifo
->
pics
.
tail
,
picture
);
}
static
picture_t
*
PictureFifoPop
(
picture_fifo_t
*
fifo
)
{
return
vlc_picture_chain_PopFront
(
&
fifo
->
firs
t
);
return
vlc_picture_chain_PopFront
(
&
fifo
->
pics
.
fron
t
);
}
picture_fifo_t
*
picture_fifo_New
(
void
)
...
...
@@ -85,7 +83,7 @@ picture_t *picture_fifo_Pop(picture_fifo_t *fifo)
bool
picture_fifo_IsEmpty
(
picture_fifo_t
*
fifo
)
{
vlc_mutex_lock
(
&
fifo
->
lock
);
bool
empty
=
fifo
->
first
==
NULL
;
bool
empty
=
vlc_picture_chain_IsEmpty
(
&
fifo
->
pics
)
;
vlc_mutex_unlock
(
&
fifo
->
lock
);
return
empty
;
...
...
@@ -96,14 +94,14 @@ void picture_fifo_Flush(picture_fifo_t *fifo, vlc_tick_t date, bool flush_before
vlc_mutex_lock
(
&
fifo
->
lock
);
picture_t
*
old_chain
=
fifo
->
first
;
vlc_
picture_
chain_
t
old_chain
=
fifo
->
pics
;
PictureFifoReset
(
fifo
);
picture_fifo_t
tmp
;
PictureFifoReset
(
&
tmp
);
while
(
old_chain
)
{
picture_t
*
picture
=
vlc_picture_chain_PopFront
(
&
old_chain
);
while
(
!
vlc_picture_chain_IsEmpty
(
&
old_chain
)
)
{
picture_t
*
picture
=
vlc_picture_chain_PopFront
(
&
old_chain
.
front
);
if
((
date
==
VLC_TICK_INVALID
)
||
(
flush_before
&&
picture
->
date
<=
date
)
||
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment