[vlc-devel] commit: Lua SD: let the user know we are working (Fabio Ritrovato )

Pierre d'Herbemont pdherbemont at free.fr
Wed Feb 24 13:54:39 CET 2010


On Wed, Feb 24, 2010 at 10:00 AM, Jakob Leben <jakob.leben at gmail.com> wrote:

> On Wed, Feb 24, 2010 at 12:34 AM, Fabio Ritrovato <exsephiroth87 at gmail.com
> > wrote:
>
>> I worked on your patch a bit, that's as far as I could go at the
>> moment in qt4...
>> I'm still not really sure if it's useful, but if you're ok j-b said it
>> can be merged...
>>
>
> +void
>> +services_discovery_SetLoading ( services_discovery_t * p_sd, bool loading
>> )
>> +{
>> +    vlc_event_t event;
>> +    event.type = vlc_ServicesDiscoveryLoadingChanged;
>> +    event.u.services_discovery_loading_changed.new_value = loading;
>> +
>> +    vlc_event_send( &p_sd->event_manager, &event );
>> +}
>> +
>>
>> +/* A certain sd is loading */
>> +static void playlist_sd_loading_changed( const vlc_event_t *p_event, void
>> *user_data )
>> +{
>> +    bool isLoading =
>> p_event->u.services_discovery_loading_changed.new_value;
>> +    vlc_sd_internal_t *p_sds = user_data;
>> +    playlist_t *p_playlist = p_sds->p_node->p_playlist;
>> +    p_sds->p_sd->b_loading = isLoading;
>> +    var_SetAddress(  p_playlist, "sd-loading", p_sds->p_sd );
>> +}
>>
>
> Hi Fabio, here is my opinions on the patch:
>
> I believe the services_discovery_t: b_loading field should be protected by
> some mutex, which services_discovery_t does not have yet.
>
> I would suggest to:
>
> A. Either move the b_loading field into playlist's struct vlc_sd_internal_t
> and use playlist lock to protect it, while adding a public function
> playlist_IsServicesDiscoveryLoading( ).
>

Was going to suggest the same thing. Except, put it in the (just added)
services_discovery's private member. And use services_discovery_IsLoading().

B: Or remove the b_loading field and pass the loading state as bool through
> callbacks all the way until Qt intf.
>

As you want :)

Pierre.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20100224/74187d11/attachment.html>


More information about the vlc-devel mailing list