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
afffa217
Commit
afffa217
authored
Jul 25, 2008
by
Laurent Aimar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cosmetics (factorize code).
parent
a95520f9
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
42 additions
and
61 deletions
+42
-61
src/video_output/video_output.c
src/video_output/video_output.c
+42
-61
No files found.
src/video_output/video_output.c
View file @
afffa217
...
...
@@ -510,6 +510,7 @@ static void vout_Destructor( vlc_object_t * p_this )
*****************************************************************************/
static
int
ChromaCreate
(
vout_thread_t
*
p_vout
);
static
void
ChromaDestroy
(
vout_thread_t
*
p_vout
);
static
void
DropPicture
(
vout_thread_t
*
p_vout
,
picture_t
*
p_picture
);
static
int
InitThread
(
vout_thread_t
*
p_vout
)
{
...
...
@@ -744,7 +745,7 @@ static void RunThread( vout_thread_t *p_vout)
* Main loop - it is not executed if an error occurred during
* initialization
*/
while
(
(
vlc_object_alive
(
p_vout
))
&&
(
!
p_vout
->
b_error
)
)
while
(
vlc_object_alive
(
p_vout
)
&&
!
p_vout
->
b_error
)
{
/* Initialize loop variables */
p_picture
=
NULL
;
...
...
@@ -816,17 +817,7 @@ static void RunThread( vout_thread_t *p_vout)
/* If we found better than the last picture, destroy it */
if
(
p_last_picture
&&
p_picture
!=
p_last_picture
)
{
vlc_mutex_lock
(
&
p_vout
->
picture_lock
);
if
(
p_last_picture
->
i_refcount
)
{
p_last_picture
->
i_status
=
DISPLAYED_PICTURE
;
}
else
{
p_last_picture
->
i_status
=
DESTROYED_PICTURE
;
p_vout
->
i_heap_size
--
;
}
vlc_mutex_unlock
(
&
p_vout
->
picture_lock
);
DropPicture
(
p_vout
,
p_last_picture
);
p_last_picture
=
NULL
;
}
...
...
@@ -841,24 +832,10 @@ static void RunThread( vout_thread_t *p_vout)
{
/* Picture is late: it will be destroyed and the thread
* will directly choose the next picture */
vlc_mutex_lock
(
&
p_vout
->
picture_lock
);
if
(
p_picture
->
i_refcount
)
{
/* Pretend we displayed the picture, but don't destroy
* it since the decoder might still need it. */
p_picture
->
i_status
=
DISPLAYED_PICTURE
;
}
else
{
/* Destroy the picture without displaying it */
p_picture
->
i_status
=
DESTROYED_PICTURE
;
p_vout
->
i_heap_size
--
;
}
DropPicture
(
p_vout
,
p_picture
);
i_lost
++
;
msg_Warn
(
p_vout
,
"late picture skipped (%"
PRId64
")"
,
current_date
-
display_date
);
i_lost
++
;
vlc_mutex_unlock
(
&
p_vout
->
picture_lock
);
continue
;
}
...
...
@@ -866,25 +843,11 @@ static void RunThread( vout_thread_t *p_vout)
current_date
+
p_vout
->
i_pts_delay
+
VOUT_BOGUS_DELAY
)
{
/* Picture is waaay too early: it will be destroyed */
vlc_mutex_lock
(
&
p_vout
->
picture_lock
);
if
(
p_picture
->
i_refcount
)
{
/* Pretend we displayed the picture, but don't destroy
* it since the decoder might still need it. */
p_picture
->
i_status
=
DISPLAYED_PICTURE
;
}
else
{
/* Destroy the picture without displaying it */
p_picture
->
i_status
=
DESTROYED_PICTURE
;
p_vout
->
i_heap_size
--
;
}
DropPicture
(
p_vout
,
p_picture
);
i_lost
++
;
msg_Warn
(
p_vout
,
"vout warning: early picture skipped "
"(%"
PRId64
")"
,
display_date
-
current_date
-
p_vout
->
i_pts_delay
);
vlc_mutex_unlock
(
&
p_vout
->
picture_lock
);
continue
;
}
...
...
@@ -1299,6 +1262,24 @@ static void ChromaDestroy( vout_thread_t *p_vout )
p_vout
->
p_chroma
=
NULL
;
}
static
void
DropPicture
(
vout_thread_t
*
p_vout
,
picture_t
*
p_picture
)
{
vlc_mutex_lock
(
&
p_vout
->
picture_lock
);
if
(
p_picture
->
i_refcount
)
{
/* Pretend we displayed the picture, but don't destroy
* it since the decoder might still need it. */
p_picture
->
i_status
=
DISPLAYED_PICTURE
;
}
else
{
/* Destroy the picture without displaying it */
p_picture
->
i_status
=
DESTROYED_PICTURE
;
p_vout
->
i_heap_size
--
;
}
vlc_mutex_unlock
(
&
p_vout
->
picture_lock
);
}
/* following functions are local */
...
...
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