[vlc-devel] [vlc-commits] es_out: remove helpless decoder hold

Thomas Guillem thomas at gllm.fr
Sun Mar 17 09:45:13 CET 2019



On Sun, Mar 17, 2019, at 02:39, Rémi Denis-Courmont wrote:
> vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Fri Mar 
> 15 05:52:34 2019 +0200| [aa3819b55d602d80dc48c3565e0901e917e751b9] | 
> committer: Rémi Denis-Courmont
> 
> es_out: remove helpless decoder hold
> 
> If the decoder is valid for holding, then it is also valid for setting
> a VLC object variable or adding a VLC object variable callback.
> Otherwise, loading the decoder pointer or accessing the decoder is
> undefined.
> 
> Either way, holding then releasing serves no purpose.
> 
> Note: input_GetEsObjects() should probably be removed in favor of the
> new VBI input controls; but those are not currently exposed to input
> managers

It will be removed after the new ui merge. Indeed, the player has it own way to control VBI. 

> 
> > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=aa3819b55d602d80dc48c3565e0901e917e751b9
> ---
> 
>  include/vlc_input.h              | 1 -
>  lib/video.c                      | 1 -
>  modules/gui/qt/input_manager.cpp | 3 ---
>  src/input/es_out.c               | 6 +-----
>  4 files changed, 1 insertion(+), 10 deletions(-)
> 
> diff --git a/include/vlc_input.h b/include/vlc_input.h
> index 47e8ff5766..51bad61e0b 100644
> --- a/include/vlc_input.h
> +++ b/include/vlc_input.h
> @@ -716,7 +716,6 @@ static inline audio_output_t *input_GetAout( 
> input_thread_t *p_input )
>  /**
>   * Returns the objects associated to an ES.
>   *
> - * You must release all non-NULL objects.
>   * You may set pointer of pointer to NULL to avoid retrieving it.
>   */
>  static inline int input_GetEsObjects( input_thread_t *p_input, int 
> i_id,
> diff --git a/lib/video.c b/lib/video.c
> index eadcbbabf4..7f7ff279a2 100644
> --- a/lib/video.c
> +++ b/lib/video.c
> @@ -520,7 +520,6 @@ void libvlc_video_set_teletext( 
> libvlc_media_player_t *p_mi, int i_page )
>                  == VLC_SUCCESS )
>              {
>                  var_SetInteger( p_zvbi, "vbi-page", i_page );
> -                vlc_object_release( p_zvbi );
>              }
>          }
>          else if (!b_key)
> diff --git a/modules/gui/qt/input_manager.cpp 
> b/modules/gui/qt/input_manager.cpp
> index 4ce26ac38d..d62635f609 100644
> --- a/modules/gui/qt/input_manager.cpp
> +++ b/modules/gui/qt/input_manager.cpp
> @@ -578,7 +578,6 @@ void InputManager::UpdateTeletext()
>          {
>              i_page = var_GetInteger( p_input_vbi, "vbi-page" );
>              b_transparent = !var_GetBool( p_input_vbi, "vbi-opaque" );
> -            vlc_object_release( p_input_vbi );
>          }
>          emit newTelexPageSet( i_page );
>          emit teletextTransparencyActivated( b_transparent );
> @@ -814,7 +813,6 @@ void InputManager::telexSetPage( int page )
>              return;
>  
>          var_SetInteger(input_vbi, "vbi-page", page);
> -        vlc_object_release(input_vbi);
>          emit newTelexPageSet(page);
>      }
>  }
> @@ -835,7 +833,6 @@ void InputManager::telexSetTransparency( bool 
> b_transparentTelextext )
>              return;
>  
>          var_SetBool(input_vbi, "vbi-opaque", !b_transparentTelextext);
> -        vlc_object_release(input_vbi);
>          emit teletextTransparencyActivated( b_transparentTelextext );
>      }
>  }
> diff --git a/src/input/es_out.c b/src/input/es_out.c
> index 3b82ee2b5d..2630b011cf 100644
> --- a/src/input/es_out.c
> +++ b/src/input/es_out.c
> @@ -2940,11 +2940,7 @@ static int EsOutVaControlLocked( es_out_t *out, 
> int i_query, va_list args )
>          if( !p_es )
>              return VLC_EGENERIC;
>  
> -        vlc_object_t    **pp_decoder = va_arg( args, vlc_object_t ** );
> -        if( p_es->p_dec )
> -            *pp_decoder = vlc_object_hold( p_es->p_dec );
> -        else
> -            *pp_decoder = NULL;
> +        *va_arg( args, vlc_object_t ** ) = VLC_OBJECT(p_es->p_dec);
>          return VLC_SUCCESS;
>      }
>  
> 
> _______________________________________________
> vlc-commits mailing list
> vlc-commits at videolan.org
> https://mailman.videolan.org/listinfo/vlc-commits
>


More information about the vlc-devel mailing list