[vlc-devel] [PATCH 3/3] httpd: Start new clients only at keyframes.

Rafaël Carré funman at videolan.org
Thu Sep 5 18:28:06 CEST 2013


Hello,

Le 16/08/2013 16:42, Steinar H. Gunderson a écrit :
> When the mux is capable of marking blocks as containing keyframes
> (currently only the avformat mux), start new clients only on such
> frames. This makes sure they do not get anything they might not
> decode at the beginning of the stream.
> 
> This patch completes WebM streaming support.
> ---
>  include/vlc_httpd.h          |    2 +-
>  modules/access_output/http.c |    6 ++--
>  src/network/httpd.c          |   71 +++++++++++++++++++++++++++++++++---------
>  3 files changed, 61 insertions(+), 18 deletions(-)


> @@ -850,6 +870,26 @@ int httpd_StreamSend( httpd_stream_t *stream, uint8_t *p_data, int i_data )
>      }
>  
>      stream->i_buffer_pos += i_data;
> +}
> +
> +int httpd_StreamSend( httpd_stream_t *stream, uint8_t *p_data, int i_data, bool b_header, bool b_keyframe )

b_header is not used here

BTW since you are modifying the prototype, wouldn't it make more sense
to pass the block_t directly ?

> +{
> +    if( i_data < 0 || p_data == NULL )
> +    {
> +        return VLC_SUCCESS;
> +    }
> +    vlc_mutex_lock( &stream->lock );
> +
> +    /* save this pointer (to be used by new connection) */
> +    stream->i_buffer_last_pos = stream->i_buffer_pos;
> +
> +    if( b_keyframe )
> +    {
> +        stream->b_has_keyframes = true;
> +        stream->i_last_keyframe_seen_pos = stream->i_buffer_pos;
> +    }
> +
> +    httpd_AppendData( stream, p_data, i_data );
>  
>      vlc_mutex_unlock( &stream->lock );
>      return VLC_SUCCESS;





More information about the vlc-devel mailing list