[vlc-commits] input: send vout event for spu ESes

Thomas Guillem git at videolan.org
Tue Jun 25 20:55:28 CEST 2019


vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Fri Jun 14 16:02:38 2019 +0200| [8244b917a6b5de9f3ca7ea82d98fc7b23449feed] | committer: Thomas Guillem

input: send vout event for spu ESes

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=8244b917a6b5de9f3ca7ea82d98fc7b23449feed
---

 src/input/decoder.c | 16 ++++++++++++++--
 src/input/player.c  |  4 ++++
 2 files changed, 18 insertions(+), 2 deletions(-)

diff --git a/src/input/decoder.c b/src/input/decoder.c
index 08b5946168..77cae4a419 100644
--- a/src/input/decoder.c
+++ b/src/input/decoder.c
@@ -611,8 +611,10 @@ static subpicture_t *spu_new_buffer( decoder_t *p_dec,
         msg_Warn( p_dec, "no vout found, dropping subpicture" );
         if( p_owner->p_vout )
         {
-            vlc_mutex_lock( &p_owner->lock );
             assert(p_owner->i_spu_channel != VOUT_SPU_CHANNEL_INVALID);
+            decoder_Notify(p_owner, on_vout_deleted, p_owner->p_vout);
+
+            vlc_mutex_lock( &p_owner->lock );
             vout_UnregisterSubpictureChannel(p_owner->p_vout,
                                              p_owner->i_spu_channel);
             p_owner->i_spu_channel = VOUT_SPU_CHANNEL_INVALID;
@@ -626,6 +628,9 @@ static subpicture_t *spu_new_buffer( decoder_t *p_dec,
 
     if( p_owner->p_vout != p_vout )
     {
+        if (p_owner->p_vout) /* notify the previous vout deletion unlocked */
+            decoder_Notify(p_owner, on_vout_deleted, p_owner->p_vout);
+
         vlc_mutex_lock(&p_owner->lock);
 
         if (p_owner->p_vout)
@@ -637,9 +642,10 @@ static subpicture_t *spu_new_buffer( decoder_t *p_dec,
             vout_Release(p_owner->p_vout);
         }
 
+        enum vlc_vout_order channel_order;
         p_owner->i_spu_channel =
             vout_RegisterSubpictureChannelInternal(p_vout, p_owner->p_clock,
-                                                   NULL);
+                                                   &channel_order);
         p_owner->i_spu_order = 0;
 
         if (p_owner->i_spu_channel == VOUT_SPU_CHANNEL_INVALID)
@@ -650,8 +656,12 @@ static subpicture_t *spu_new_buffer( decoder_t *p_dec,
             vout_Release(p_vout);
             return NULL;
         }
+
         p_owner->p_vout = p_vout;
         vlc_mutex_unlock(&p_owner->lock);
+
+        assert(channel_order != VLC_VOUT_ORDER_NONE);
+        decoder_Notify(p_owner, on_vout_added, p_vout, channel_order);
     }
     else
         vout_Release(p_vout);
@@ -1958,6 +1968,8 @@ static void DeleteDecoder( decoder_t * p_dec )
             if( p_owner->p_vout )
             {
                 assert( p_owner->i_spu_channel != VOUT_SPU_CHANNEL_INVALID );
+                decoder_Notify(p_owner, on_vout_deleted, p_owner->p_vout);
+
                 vout_UnregisterSubpictureChannel( p_owner->p_vout,
                                                   p_owner->i_spu_channel );
                 vout_Release(p_owner->p_vout);
diff --git a/src/input/player.c b/src/input/player.c
index 44a1867aa4..0ab3246ba9 100644
--- a/src/input/player.c
+++ b/src/input/player.c
@@ -2059,6 +2059,10 @@ vlc_player_input_HandleVoutEvent(struct vlc_player_input *input,
     if (!trackpriv)
         return;
 
+    const bool is_video_es = trackpriv->t.fmt.i_cat == VIDEO_ES;
+    if (!is_video_es) /* XXX: will be removed on next commits */
+        return;
+
     switch (ev->action)
     {
         case VLC_INPUT_EVENT_VOUT_ADDED:



More information about the vlc-commits mailing list