[vlc-commits] [Git][videolan/vlc][master] 3 commits: es_out: remove unused variables

Thomas Guillem (@tguillem) gitlab at videolan.org
Fri Oct 13 08:44:04 UTC 2023



Thomas Guillem pushed to branch master at VideoLAN / VLC


Commits:
f1fc1514 by Thomas Guillem at 2023-10-13T05:04:00+00:00
es_out: remove unused variables

- - - - -
603a767b by Thomas Guillem at 2023-10-13T05:04:00+00:00
es_out: do the drain wait hack only where it's needed

It's only needed from the ES_OUT_SET_ES_FMT control and when the demuxer
is deleting an ES.

The normal drain polling is done via ES_OUT_GET_EMPTY.

Both solutions are not good, but it's not for VLC 4.0...

- - - - -
236d2c3b by Thomas Guillem at 2023-10-13T05:04:00+00:00
es_out: call the drain helper function

This fix EsOutDrainCCChannels() not being called in the nominal case.

But this does not fix any issues since the es_out don't have access to CC
dec pointers: EsOutDrainCCChannels() is a noop (will be fixed in a next
commit).

- - - - -


1 changed file:

- src/input/es_out.c


Changes:

=====================================
src/input/es_out.c
=====================================
@@ -3003,16 +3003,20 @@ static int EsOutSend( es_out_t *out, es_out_id_t *es, block_t *p_block )
 }
 
 static void
-EsOutDrainDecoder( es_out_t *out, es_out_id_t *es )
+EsOutDrainDecoder(es_out_t *out, es_out_id_t *es, bool wait)
 {
     es_out_sys_t *p_sys = container_of(out, es_out_sys_t, out);
     assert( es->p_dec );
 
+    vlc_input_decoder_Drain( es->p_dec );
+    EsOutDrainCCChannels( es );
+
+    if (!wait)
+        return;
+
     /* FIXME: This might hold the ES output caller (i.e. the demux), and
      * the corresponding thread (typically the input thread), for a little
      * bit too long if the ES is deleted in the middle of a stream. */
-    vlc_input_decoder_Drain( es->p_dec );
-    EsOutDrainCCChannels( es );
     while( !input_Stopped(p_sys->p_input) && !p_sys->b_buffering )
     {
         if( vlc_input_decoder_IsEmpty( es->p_dec ) &&
@@ -3037,7 +3041,7 @@ static void EsOutDelLocked( es_out_t *out, es_out_id_t *es )
     /* We don't try to reselect */
     if( es->p_dec )
     {
-        EsOutDrainDecoder( out, es );
+        EsOutDrainDecoder(out, es, true);
         EsOutUnselectEs( out, es, es->p_pgrm == p_sys->p_pgrm );
     }
 
@@ -3492,7 +3496,7 @@ static int EsOutVaControlLocked( es_out_t *out, input_source_t *source,
         const bool b_was_selected = EsIsSelected( es );
         if( es->p_dec )
         {
-            EsOutDrainDecoder( out, es );
+            EsOutDrainDecoder(out, es, true);
             EsDeleteCCChannels( out, es );
             EsOutDestroyDecoder( out, es );
         }
@@ -3961,7 +3965,7 @@ static int EsOutVaPrivControlLocked( es_out_t *out, input_source_t *source,
         es_out_id_t *id;
         foreach_es_then_es_slaves(id)
             if (id->p_dec != NULL)
-                vlc_input_decoder_Drain(id->p_dec);
+                EsOutDrainDecoder(out, id, false);
         return VLC_SUCCESS;
     }
     case ES_OUT_PRIV_SET_VBI_PAGE:
@@ -4203,9 +4207,7 @@ static int LanguageArrayIndex( char **ppsz_langs, const char *psz_lang )
 static int EsOutEsUpdateFmt(es_out_t *out, es_out_id_t *es,
                             const es_format_t *fmt)
 {
-    es_out_sys_t *p_sys = container_of(out, es_out_sys_t, out);
-    input_thread_t *p_input = p_sys->p_input;
-
+    (void) out;
     assert(es->fmt.i_cat == fmt->i_cat);
 
     es_format_t update = *fmt;



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/253e81b30cc33e5eb709d6dba241c4a4a3529e92...236d2c3b224070e53d6223018bc7c2df2ddd311b

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/253e81b30cc33e5eb709d6dba241c4a4a3529e92...236d2c3b224070e53d6223018bc7c2df2ddd311b
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list