[vlc-devel] [PATCH 24/48] decoder: stop the display before saving the free vout
Steve Lhomme
robux4 at ycbcr.xyz
Fri Oct 11 15:33:38 CEST 2019
Rather than telling the resource storage if the vout needs to be stopped in some way.
Incidentally the vout_Cancel is not needed anymore since the vout_StopDisplay, which
is now used, destroys the picture pool.
---
src/input/decoder.c | 2 +-
src/input/resource.c | 8 +++-----
2 files changed, 4 insertions(+), 6 deletions(-)
diff --git a/src/input/decoder.c b/src/input/decoder.c
index 3c7d1ccb880..4e66bec4a6b 100644
--- a/src/input/decoder.c
+++ b/src/input/decoder.c
@@ -2028,7 +2028,7 @@ static void DeleteDecoder( decoder_t * p_dec )
{
/* Reset the cancel state that was set before joining the decoder
* thread */
- vout_Cancel(vout, false);
+ vout_StopDisplay(vout);
p_owner->vout_thread_started = false;
decoder_Notify(p_owner, on_vout_stopped, vout);
input_resource_PutVout(p_owner->p_resource, vout);
diff --git a/src/input/resource.c b/src/input/resource.c
index 486289aee6d..6522ad9056c 100644
--- a/src/input/resource.c
+++ b/src/input/resource.c
@@ -325,7 +325,7 @@ void input_resource_SetInput( input_resource_t *p_resource, input_thread_t *p_in
}
static void input_resource_PutVoutLocked(input_resource_t *p_resource,
- vout_thread_t *vout, bool started)
+ vout_thread_t *vout)
{
assert(vout != NULL);
vlc_mutex_lock(&p_resource->lock_hold);
@@ -338,8 +338,6 @@ static void input_resource_PutVoutLocked(input_resource_t *p_resource,
assert(p_resource->p_vout_free == NULL);
msg_Dbg(p_resource->p_parent, "saving a free vout");
p_resource->p_vout_free = vout;
- if (started)
- vout_StopDisplay(vout);
}
else
{
@@ -362,7 +360,7 @@ void input_resource_PutVout(input_resource_t *p_resource,
vout_thread_t *vout)
{
vlc_mutex_lock( &p_resource->lock );
- input_resource_PutVoutLocked( p_resource, vout, true );
+ input_resource_PutVoutLocked( p_resource, vout );
vlc_mutex_unlock( &p_resource->lock );
}
@@ -442,7 +440,7 @@ int input_resource_StartVout(input_resource_t *p_resource,
{
vlc_mutex_lock( &p_resource->lock );
if (vout_Request(cfg, dec_dev, p_resource->p_input)) {
- input_resource_PutVoutLocked(p_resource, cfg->vout, false);
+ input_resource_PutVoutLocked(p_resource, cfg->vout);
vlc_mutex_unlock(&p_resource->lock);
return -1;
}
--
2.17.1
More information about the vlc-devel
mailing list