[vlc-devel] [vlc-commits] dec: update pause/rate when the output is restarted
Thomas Guillem
thomas at gllm.fr
Wed Jul 4 10:17:29 CEST 2018
I removed this commit with a push force, it's not good in the current state because I need to make sure that aout/vout functions are called from the DecoderThread and from the Vout in the sametime.
On Wed, Jul 4, 2018, at 09:37, Thomas Guillem wrote:
> vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Wed Jul 4
> 09:29:58 2018 +0200| [8cd57b71893a5740fe60a83d4cc28959228fe39b] |
> committer: Thomas Guillem
>
> dec: update pause/rate when the output is restarted
>
> The aout/vout paused/rate state was not set if the output was restarted within
> the lifetime of the decoder.
>
> > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=8cd57b71893a5740fe60a83d4cc28959228fe39b
> ---
>
> src/input/decoder.c | 18 ++++++++++++++++++
> 1 file changed, 18 insertions(+)
>
> diff --git a/src/input/decoder.c b/src/input/decoder.c
> index e9b96dfe80..b522868d27 100644
> --- a/src/input/decoder.c
> +++ b/src/input/decoder.c
> @@ -324,6 +324,20 @@ static void OutputChangeRate( decoder_t *p_dec,
> float rate )
> /
> *****************************************************************************
> * Buffers allocation callbacks for the decoders
>
> *****************************************************************************/
> +static void out_change_state( decoder_t *p_dec )
> +{
> + struct decoder_owner *p_owner = dec_get_owner( p_dec );
> +
> + vlc_fifo_Lock( p_owner->p_fifo );
> + float rate = p_owner->rate;
> + vlc_tick_t pause_date = p_owner->pause_date;
> + bool paused = p_owner->paused;
> + vlc_fifo_Unlock( p_owner->p_fifo );
> +
> + OutputChangePause( p_dec, paused, pause_date );
> + OutputChangeRate( p_dec, rate );
> +}
> +
> static vout_thread_t *aout_request_vout( void *p_private,
> vout_thread_t *p_vout,
> const video_format_t *p_fmt,
> bool b_recyle )
> @@ -446,6 +460,8 @@ static int aout_update_format( decoder_t *p_dec )
> p_owner->fmt.audio.i_bytes_per_frame;
> p_dec->fmt_out.audio.i_frame_length =
> p_owner->fmt.audio.i_frame_length;
> +
> + out_change_state( p_dec );
> }
> return 0;
> }
> @@ -578,6 +594,8 @@ static int vout_update_format( decoder_t *p_dec )
> msg_Err( p_dec, "failed to create video output" );
> return -1;
> }
> +
> + out_change_state( p_dec );
> }
>
> if ( memcmp( &p_dec->fmt_out.video.mastering,
>
> _______________________________________________
> vlc-commits mailing list
> vlc-commits at videolan.org
> https://mailman.videolan.org/listinfo/vlc-commits
More information about the vlc-devel
mailing list