[vlc-devel] [PATCH 2/2] decoder: always release the vout

Thomas Guillem thomas at gllm.fr
Fri Jun 26 13:26:02 CEST 2020


The vout was released only when already started. This fixes the
"assert( p_resource->i_vout == 0 || p_resource->p_vout_free == p_resource->pp_vout[0] );"
from input_resource_SetInput() when the vout failed to start.
---
 src/input/decoder.c | 19 +++++++++++--------
 1 file changed, 11 insertions(+), 8 deletions(-)

diff --git a/src/input/decoder.c b/src/input/decoder.c
index dd901f77b0c..57b13c14fb3 100644
--- a/src/input/decoder.c
+++ b/src/input/decoder.c
@@ -2001,15 +2001,18 @@ static void DeleteDecoder( vlc_input_decoder_t *p_owner )
         case VIDEO_ES: {
             vout_thread_t *vout = p_owner->p_vout;
 
-            if (vout != NULL && p_owner->vout_thread_started)
+            if (vout != NULL)
             {
-                /* Reset the cancel state that was set before joining the decoder
-                 * thread */
-                if (p_owner->out_pool)
-                    picture_pool_Cancel( p_owner->out_pool, false );
-                vout_StopDisplay(vout);
-                p_owner->vout_thread_started = false;
-                decoder_Notify(p_owner, on_vout_stopped, vout);
+                if( p_owner->vout_thread_started)
+                {
+                    /* Reset the cancel state that was set before joining the
+                     * decoder thread */
+                    if (p_owner->out_pool)
+                        picture_pool_Cancel( p_owner->out_pool, 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);
             }
             break;
-- 
2.20.1



More information about the vlc-devel mailing list