[vlc-devel] [PATCH 2/5] modules: make use of the special duration value INPUT_UNKNOWN_DURATION

Steve Lhomme robux4 at ycbcr.xyz
Sat Jul 7 09:52:24 CEST 2018

On 2018-07-07 9:15, Rémi Denis-Courmont wrote:
> Le lauantaina 7. heinäkuuta 2018, 10.10.09 EEST Steve Lhomme a écrit :
>> On 2018-07-06 18:29, Rémi Denis-Courmont wrote:
>>> Le perjantaina 6. heinäkuuta 2018, 15.18.53 EEST Steve Lhomme a écrit :
>>>> On 2018-06-23 9:53, Rémi Denis-Courmont wrote:
>>>>> The duration of vlc://nop is *not* unknown. It's zero.
>>>> It's not always the case, in lua/sd and xcb_apps it's initialized to -1.
>>> In those cases, there was confusion whether the item is supposed to
>>> include
>>> the duration of children or not. In XCB apps, the duration of each
>>> children is obviously unknown.
>> You say "obviously" very liberally. It may be obvious to you but since I
>> don't even know what XCB is,
> It *is* obvious that SD items normally have unknown rather than non-zero
> duration.
> What would be the point in having an SD that only publishes empty items?

I still don't understand which is supposed to be what in the input items 
duration. Of course a file is most likely to have a known duration. But 
pretty much everything else doesn't have a duration at all since it's 
not meant to be played at all. And wrappers (node, directory) don't 
count the duration of their children. It would be more logical for these 
to have an unset duration rather than saying it's 0 which is not true 
for their children. We seem to agree on that.

I don't know what "vlc://nop" does exactly but it seems to be a 
placeholder for a dummy items. Right now it's used in:

- libvlc_media_new_as_node() using input_item_New() (duration 0, type 
- parse_vlcnode_node() using input_item_NewDirectory (duration 0, type 
- parse_track_node() using input_item_SetURI() (duration 0 or set, type 
can vary or remains unknown)
- vlclua_sd_create_node() using input_item_NewExt() (duration -1, type node)
- Open() using input_item_NewExt() (duration -1, type node)
input item
- rdh_unflatten() using input_item_NewExt() (duration 0, type directory)

It would seem that a directory uses 0 and a node unset (-1). Directories 
are often created by vlc_readdir_helper_additem() which also uses a 
duration of 0 so that seems coherent. Although it doesn't seem logical 
that a directory would have a duration at all.

For nodes it's less clear as playlist_NodeCreate() creates them with a 
duration of 0. And there's ChangeToNode() which might have an item with 
a duration (which would be wrong, we might assert on that). And the rest 
of the code uses -1.

> -- 
> Rémi Denis-Courmont
> http://www.remlab.net/
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel

More information about the vlc-devel mailing list