[vlc-devel] [PATCH] input: Propagate duration updates to the input_item_t

Thomas Guillem thomas at gllm.fr
Thu Aug 29 10:32:18 CEST 2019


On Thu, Aug 29, 2019, at 10:18, Rémi Denis-Courmont wrote:
> Hi,
> 
> It makes sense for on-demand media, but it won't work for live streams / capture devices whose duration may vary across runs.

In that case, the item duration will change more than one time and item events will be sent.

By the way, this is a regression from d23b4527c2489fa47d236205d4f915229b6a65ee.
So, this should be merged. 

> 
> Le 29 août 2019 11:07:54 GMT+03:00, "Hugo Beauzée-Luyssen" <hugo at beauzee.fr> a écrit :
>>  src/input/item.c   | 3 +++
>>  src/player/input.c | 1 +
>>  2 files changed, 4 insertions(+)
>> 
>> diff --git a/src/input/item.c b/src/input/item.c
>> index b1b92cdf9b..a93c24eaf3 100644
>> --- a/src/input/item.c
>> +++ b/src/input/item.c
>> @@ -1361,6 +1361,9 @@ input_item_parser_InputEvent(input_thread_t *input,
>>  
>>      switch (event->type)
>>      {
>> +        case INPUT_EVENT_TIMES:
>> +            input_item_SetDuration(input_GetItem(input), event->times.length);
>> +            break;
>>          case INPUT_EVENT_STATE:
>>              parser->state = event->state;
>>              break;
>> diff --git a/src/player/input.c b/src/player/input.c
>> index 3014916963..334ee41a03 100644
>> --- a/src/player/input.c
>> +++ b/src/player/input.c
>> @@ -666,6 +666,7 @@ input_thread_Events(input_thread_t *input_thread,
>>              if (input->length != event->times.length)
>>              {
>>                  input->length = event->times.length;
>> +                input_item_SetDuration(input_GetItem(input->thread), event->times.length);
>>                  vlc_player_SendEvent(player, on_length_changed, input->length);
>>              }
>>              break;
> 
> -- 
> 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20190829/24766610/attachment.html>


More information about the vlc-devel mailing list