[vlc-devel] [PATCH 1/2] transcode: add support for flush operations

Rémi Denis-Courmont remi at remlab.net
Mon Feb 15 19:21:19 UTC 2021


Le maanantaina 15. helmikuuta 2021, 13.38.22 EET Alaric Senat a écrit :
> Previously flushing the transcode stream was left unimplemented.

Yes.

> Flushing out the stream while transcoding makes sense especially to
> support seeking operations.

No. Flushing is a questionable (and now questioned) operation that does not 
achieve seeking. In the general case, seeking cannot work at all. And in other 
cases, seeking is possible (with glitch) but not through flushing.

For instance RTP would require changing the SSRC of each media. This is done 
by deleting the elementary streams and recreating them - *not* by flushing.

> While seeking in transcoding is far from being fully supported in vlc
> this allows to at least change the starting time before transcoding a
> media without major modifications to the input loop.

Seeking in stream output is not supported, and I don't think it will ever be.

> ---
>  modules/stream_out/transcode/transcode.c | 13 ++++++++++++-
>  1 file changed, 12 insertions(+), 1 deletion(-)
> 
> diff --git a/modules/stream_out/transcode/transcode.c
> b/modules/stream_out/transcode/transcode.c index ceca2df1e5..acee6d5ec0
> 100644
> --- a/modules/stream_out/transcode/transcode.c
> +++ b/modules/stream_out/transcode/transcode.c
> @@ -377,8 +377,19 @@ static int Control( sout_stream_t *p_stream, int
> i_query, va_list args ) return VLC_EGENERIC;
>  }
> 
> +/**************************************************************************
> *** + * Flush
> +
> ***************************************************************************
> **/ +static void Flush( sout_stream_t *p_stream, void *_id )

Reserved identifier.

> +{
> +
> +    const sout_stream_id_sys_t *id = (sout_stream_id_sys_t*)_id;

Useless cast.

> +    if ( id->downstream_id )
> +        sout_StreamFlush( p_stream->p_next, id->downstream_id );
> +}
> +
>  static const struct sout_stream_operations ops = {
> -    Add, Del, Send, Control, NULL,
> +    Add, Del, Send, Control, Flush,
>  };
> 
>  /**************************************************************************
> ***


-- 
Реми Дёни-Курмон
http://www.remlab.net/





More information about the vlc-devel mailing list