[vlc-devel] [PATCH] input: process start time seek before demux loop (fix #9063)

Zhao Zhili quinkblack at foxmail.com
Thu Oct 19 18:07:09 CEST 2017


> On 19 Oct 2017, at 8:12 PM, Rémi Denis-Courmont <remi at remlab.net> wrote:
> 
> Le 19 octobre 2017 14:04:59 GMT+03:00, Zhao Zhili <quinkblack at foxmail.com> a écrit :
>> 
>> 
>> On 2017年10月19日 17:41, Rémi Denis-Courmont wrote:
>>> Le 19 octobre 2017 11:40:13 GMT+03:00, Francois Cartegnie
>> <fcvlcdev at free.fr> a écrit :
>>>> as controls are processed after first demux call, data is always
>>>> going to es_out / decoders / sout even if it's not wanted.
>>>> ---
>>>> src/input/input.c | 14 +++++++++-----
>>>> 1 file changed, 9 insertions(+), 5 deletions(-)
>>>> 
>>>> diff --git a/src/input/input.c b/src/input/input.c
>>>> index 1b22a6281e..505a17811f 100644
>>>> --- a/src/input/input.c
>>>> +++ b/src/input/input.c
>>>> @@ -696,6 +696,15 @@ static void MainLoop( input_thread_t *p_input,
>>>> bool b_interactive )
>>>>     demux_t *p_demux = input_priv(p_input)->master->p_demux;
>>>>     const bool b_can_demux = p_demux->pf_demux != NULL;
>>>> 
>>>> +    /* Process start seek offset */
>>>> +    if( input_priv(p_input)->i_start > 0 &&
>>>> !input_priv(p_input)->master->b_eof )
>>>> +    {
>>>> +        vlc_value_t val;
>>>> +        val.i_int = input_priv(p_input)->i_start;
>>>> +        Control( p_input, INPUT_CONTROL_SET_TIME, val );
>>>> +        /* TODO don't skip if time < es_out buffering */
>>>> +    }
>>>> +
>>>> while( !input_Stopped( p_input ) && input_priv(p_input)->i_state !=
>>>> ERROR_S )
>>>>     {
>>>>         mtime_t i_wakeup = -1;
>>>> @@ -946,13 +955,8 @@ static void StartTitle( input_thread_t *
>> p_input )
>>>> 
>>>>     if( priv->i_start > 0 )
>>>>     {
>>>> -        vlc_value_t s;
>>>> -
>>>>         msg_Dbg( p_input, "starting at time: %"PRId64"s",
>>>>                  priv->i_start / CLOCK_FREQ );
>>>> -
>>>> -        s.i_int = priv->i_start;
>>>> -        input_ControlPush( p_input, INPUT_CONTROL_SET_TIME, &s );
>>>>     }
>>>>     if( priv->i_stop > 0 && priv->i_stop <= priv->i_start )
>>>>     {
>>>> -- 
>>>> 2.13.6
>>>> 
>>>> _______________________________________________
>>>> vlc-devel mailing list
>>>> To unsubscribe or modify your subscription options:
>>>> https://mailman.videolan.org/listinfo/vlc-devel
>>> We can also move all controls before demux. But that cannot fix the
>> bug, since demuxers can run asynchronously.
>> 
>> How about pause the decoder immediately after create?
>> 
>> diff --git a/src/input/es_out.c b/src/input/es_out.c
>> index 227f15f..c5e8bd0 100644
>> --- a/src/input/es_out.c
>> +++ b/src/input/es_out.c
>> @@ -1686,6 +1686,8 @@ static void EsCreateDecoder( es_out_t *out, 
>> es_out_id_t *p_es )
>>     {
>>         if( p_sys->b_buffering )
>>             input_DecoderStartWait( p_es->p_dec );
>> +        if( p_sys->b_paused )
>> +            input_DecoderChangePause( p_es->p_dec, p_sys->b_paused, 
>> p_sys->i_pause_date );
>> 
>>         if( !p_es->p_master && p_sys->p_sout_record )
>>         {
>> 
>> 
>> _______________________________________________
>> vlc-devel mailing list
>> To unsubscribe or modify your subscription options:
>> https://mailman.videolan.org/listinfo/vlc-devel
> 
> That makes no difference to the underlying issue, and it slows things down
> -- 
> Envoyé de mon appareil Android avec Courriel K-9 Mail. Veuillez excuser ma brièveté.
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel


Ok, I mixed "start-time" and "start-paused" up. Is it possible to resolve the current issue
by implement "start-time" as pause + seek + start?



More information about the vlc-devel mailing list