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
75f55c27
Commit
75f55c27
authored
Oct 16, 2008
by
Laurent Aimar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Store the last displayed picture pointer in vout private structure.
parent
c438a010
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
25 deletions
+31
-25
src/video_output/video_output.c
src/video_output/video_output.c
+20
-17
src/video_output/vout_internal.h
src/video_output/vout_internal.h
+11
-8
No files found.
src/video_output/video_output.c
View file @
75f55c27
...
...
@@ -373,6 +373,7 @@ vout_thread_t * __vout_Create( vlc_object_t *p_parent, video_format_t *p_fmt )
p_vout
->
p_window
=
NULL
;
p_vout
->
p
->
i_par_num
=
p_vout
->
p
->
i_par_den
=
1
;
p_vout
->
p
->
p_picture_displayed
=
NULL
;
/* Initialize locks */
vlc_mutex_init_recursive
(
&
p_vout
->
picture_lock
);
...
...
@@ -716,6 +717,8 @@ static int InitThread( vout_thread_t *p_vout )
if
(
p_vout
->
pf_init
(
p_vout
)
)
return
VLC_EGENERIC
;
p_vout
->
p
->
p_picture_displayed
=
NULL
;
if
(
!
I_OUTPUTPICTURES
)
{
msg_Err
(
p_vout
,
"plugin was unable to allocate at least "
...
...
@@ -886,8 +889,6 @@ static void* RunThread( vlc_object_t *p_this )
vout_thread_t
*
p_vout
=
(
vout_thread_t
*
)
p_this
;
int
i_idle_loops
=
0
;
/* loops without displaying a picture */
picture_t
*
p_last_picture
=
NULL
;
/* last picture */
subpicture_t
*
p_subpic
=
NULL
;
/* subpicture pointer */
bool
b_drop_late
;
...
...
@@ -946,10 +947,10 @@ static void* RunThread( vlc_object_t *p_this )
display_date
=
p_picture
->
date
;
}
}
if
(
p_vout
->
p
->
b_paused
&&
p_
last_picture
!=
NULL
)
if
(
p_vout
->
p
->
b_paused
&&
p_
vout
->
p
->
p_picture_displayed
!=
NULL
)
{
p_picture
=
NULL
;
if
(
p_
last_picture
->
date
==
1
)
if
(
p_
vout
->
p
->
p_picture_displayed
->
date
==
1
)
{
for
(
i_index
=
0
;
i_index
<
I_RENDERPICTURES
;
i_index
++
)
{
...
...
@@ -957,11 +958,11 @@ static void* RunThread( vlc_object_t *p_this )
if
(
p_pic
->
i_status
!=
READY_PICTURE
)
continue
;
if
(
p_pic
->
date
<=
p_
last_picture
->
date
&&
p_pic
!=
p_last_picture
)
if
(
p_pic
->
date
<=
p_
vout
->
p
->
p_picture_displayed
->
date
&&
p_pic
!=
p_vout
->
p
->
p_picture_displayed
)
{
DropPicture
(
p_vout
,
p_pic
);
}
else
if
(
p_pic
->
date
>
p_
last_picture
->
date
&&
(
p_picture
==
NULL
||
p_pic
->
date
<
display_date
)
)
else
if
(
p_pic
->
date
>
p_
vout
->
p
->
p_picture_displayed
->
date
&&
(
p_picture
==
NULL
||
p_pic
->
date
<
display_date
)
)
{
p_picture
=
p_pic
;
display_date
=
p_picture
->
date
;
...
...
@@ -969,22 +970,22 @@ static void* RunThread( vlc_object_t *p_this )
}
}
if
(
!
p_picture
)
p_picture
=
p_
last_picture
;
p_picture
=
p_
vout
->
p
->
p_picture_displayed
;
}
if
(
p_picture
)
{
/* If we met the last picture, parse again to see whether there is
* a more appropriate one. */
if
(
p_picture
==
p_
last_picture
&&
!
p_vout
->
p
->
b_paused
)
if
(
p_picture
==
p_
vout
->
p
->
p_picture_displayed
&&
!
p_vout
->
p
->
b_paused
)
{
for
(
i_index
=
0
;
i_index
<
I_RENDERPICTURES
;
i_index
++
)
{
picture_t
*
p_pic
=
PP_RENDERPICTURE
[
i_index
];
if
(
p_pic
->
i_status
==
READY_PICTURE
&&
p_pic
!=
p_
last_picture
&&
(
p_picture
==
p_
last_picture
||
p_pic
->
date
<
display_date
)
)
p_pic
!=
p_
vout
->
p
->
p_picture_displayed
&&
(
p_picture
==
p_
vout
->
p
->
p_picture_displayed
||
p_pic
->
date
<
display_date
)
)
{
p_picture
=
p_pic
;
display_date
=
p_picture
->
date
;
...
...
@@ -993,10 +994,10 @@ static void* RunThread( vlc_object_t *p_this )
}
/* If we found better than the last picture, destroy it */
if
(
p_
last_picture
&&
p_picture
!=
p_last_picture
)
if
(
p_
vout
->
p
->
p_picture_displayed
&&
p_picture
!=
p_vout
->
p
->
p_picture_displayed
)
{
DropPicture
(
p_vout
,
p_
last_picture
);
p_
last_picture
=
NULL
;
DropPicture
(
p_vout
,
p_
vout
->
p
->
p_picture_displayed
);
p_
vout
->
p
->
p_picture_displayed
=
NULL
;
}
/* Compute FPS rate */
...
...
@@ -1004,7 +1005,7 @@ static void* RunThread( vlc_object_t *p_this )
=
display_date
;
if
(
!
p_picture
->
b_force
&&
p_picture
!=
p_
last_picture
&&
p_picture
!=
p_
vout
->
p
->
p_picture_displayed
&&
display_date
<
current_date
+
p_vout
->
p
->
render_time
&&
b_drop_late
)
{
...
...
@@ -1027,7 +1028,7 @@ static void* RunThread( vlc_object_t *p_this )
p_picture
=
NULL
;
display_date
=
0
;
}
else
if
(
p_picture
==
p_
last_picture
)
else
if
(
p_picture
==
p_
vout
->
p
->
p_picture_displayed
)
{
/* We are asked to repeat the previous picture, but we first
* wait for a couple of idle loops */
...
...
@@ -1044,6 +1045,8 @@ static void* RunThread( vlc_object_t *p_this )
}
}
}
if
(
p_picture
)
p_vout
->
p
->
p_picture_displayed
=
p_picture
;
vlc_mutex_unlock
(
&
p_vout
->
picture_lock
);
if
(
p_picture
==
NULL
)
...
...
@@ -1145,8 +1148,7 @@ static void* RunThread( vlc_object_t *p_this )
/* Tell the vout this was the last picture and that it does not
* need to be forced anymore. */
p_last_picture
=
p_picture
;
p_last_picture
->
b_force
=
false
;
p_picture
->
b_force
=
false
;
}
/* Drop the filtered picture if created by video filters */
...
...
@@ -1190,6 +1192,7 @@ static void* RunThread( vlc_object_t *p_this )
p_vout
->
pf_end
(
p_vout
);
p_vout
->
p
->
p_picture_displayed
=
NULL
;
for
(
i
=
0
;
i
<
I_OUTPUTPICTURES
;
i
++
)
p_vout
->
p_picture
[
i
].
i_status
=
FREE_PICTURE
;
...
...
src/video_output/vout_internal.h
View file @
75f55c27
...
...
@@ -34,6 +34,9 @@
struct
vout_thread_sys_t
{
/* */
picture_t
*
p_picture_displayed
;
/* */
vlc_mutex_t
vfilter_lock
;
/**< video filter2 change lock */
...
...
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