[vlc-devel] [PATCH] decoder: stop the display before saving the free vout

Steve Lhomme robux4 at ycbcr.xyz
Thu Oct 10 10:54:57 CEST 2019


Rather than telling the resource storage if it needs to be stopped in some way.

Incidentally the vout_Cancel is not needed anymore since the vout_StopDisplay
destroys the picture pool anyway.
---
 src/input/decoder.c  | 2 +-
 src/input/resource.c | 6 ++----
 2 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/src/input/decoder.c b/src/input/decoder.c
index 53aca540d86..c6a1d252ff7 100644
--- a/src/input/decoder.c
+++ b/src/input/decoder.c
@@ -1942,7 +1942,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);
                 decoder_Notify(p_owner, on_vout_deleted, vout);
                 input_resource_PutVout(p_owner->p_resource, vout);
             }
diff --git a/src/input/resource.c b/src/input/resource.c
index 727b7e940a7..3e1ffb54300 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 );
 }
 
-- 
2.19.1.windows.1



More information about the vlc-devel mailing list