[vlc-commits] [Git][videolan/vlc][master] input: use input format for category

Jean-Baptiste Kempf (@jbk) gitlab at videolan.org
Tue Oct 19 15:33:45 UTC 2021



Jean-Baptiste Kempf pushed to branch master at VideoLAN / VLC


Commits:
1f5c0b6c by RĂ©mi Denis-Courmont at 2021-10-19T15:19:49+00:00
input: use input format for category

The input format is fixed for the lifetime of the decoder thread.
The output format is not always available as the packetiser or the
decoder may delay the determination of their output format until they
start outputting packets.

The downside is the assumption that input and output category are the
same. This assumption is already enforced by an assertion, and relied
heavily upon by the ES output for track selection, so it is hardly a
problem.

Fixes #21975

- - - - -


1 changed file:

- src/input/decoder.c


Changes:

=====================================
src/input/decoder.c
=====================================
@@ -1495,12 +1495,12 @@ static void DecoderThread_Flush( vlc_input_decoder_t *p_owner )
         sout_InputFlush( p_owner->p_sout, p_owner->p_sout_input );
     }
 #endif
-    if( p_dec->fmt_out.i_cat == AUDIO_ES )
+    if( p_dec->fmt_in.i_cat == AUDIO_ES )
     {
         if( p_owner->p_aout )
             aout_DecFlush( p_owner->p_aout );
     }
-    else if( p_dec->fmt_out.i_cat == VIDEO_ES )
+    else if( p_dec->fmt_in.i_cat == VIDEO_ES )
     {
         if( p_owner->p_vout && p_owner->vout_started )
             vout_FlushAll( p_owner->p_vout );
@@ -1510,7 +1510,7 @@ static void DecoderThread_Flush( vlc_input_decoder_t *p_owner )
         if( p_owner->out_pool != NULL )
             picture_pool_Cancel( p_owner->out_pool, false );
     }
-    else if( p_dec->fmt_out.i_cat == SPU_ES )
+    else if( p_dec->fmt_in.i_cat == SPU_ES )
     {
         if( p_owner->p_vout )
         {
@@ -1528,7 +1528,7 @@ static void DecoderThread_ChangePause( vlc_input_decoder_t *p_owner, bool paused
     decoder_t *p_dec = &p_owner->dec;
 
     msg_Dbg( p_dec, "toggling %s", paused ? "resume" : "pause" );
-    switch( p_dec->fmt_out.i_cat )
+    switch( p_dec->fmt_in.i_cat )
     {
         case VIDEO_ES:
             vlc_mutex_lock( &p_owner->lock );
@@ -1555,7 +1555,7 @@ static void DecoderThread_ChangeRate( vlc_input_decoder_t *p_owner, float rate )
 
     msg_Dbg( p_dec, "changing rate: %f", rate );
     vlc_mutex_lock( &p_owner->lock );
-    switch( p_dec->fmt_out.i_cat )
+    switch( p_dec->fmt_in.i_cat )
     {
         case VIDEO_ES:
             if( p_owner->p_vout != NULL && p_owner->vout_started )
@@ -1586,7 +1586,7 @@ static void DecoderThread_ChangeDelay( vlc_input_decoder_t *p_owner, vlc_tick_t
 
     msg_Dbg( p_dec, "changing delay: %"PRId64, delay );
 
-    switch( p_dec->fmt_out.i_cat )
+    switch( p_dec->fmt_in.i_cat )
     {
         case VIDEO_ES:
             vlc_mutex_lock( &p_owner->lock );
@@ -1726,7 +1726,7 @@ static void *DecoderThread( void *p_data )
 
         DecoderThread_ProcessInput( p_owner, p_block );
 
-        if( p_block == NULL && p_owner->dec.fmt_out.i_cat == AUDIO_ES )
+        if( p_block == NULL && p_owner->dec.fmt_in.i_cat == AUDIO_ES )
         {   /* Draining: the decoder is drained and all decoded buffers are
              * queued to the output at this point. Now drain the output. */
             if( p_owner->p_aout != NULL )



View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/1f5c0b6ca21c4f20454e074813330d840d625d26

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/1f5c0b6ca21c4f20454e074813330d840d625d26
You're receiving this email because of your account on code.videolan.org.




More information about the vlc-commits mailing list