<div class="gmail_quote">On Wed, Feb 24, 2010 at 12:34 AM, Fabio Ritrovato <span dir="ltr"><<a href="mailto:exsephiroth87@gmail.com">exsephiroth87@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
I worked on your patch a bit, that's as far as I could go at the<br>
moment in qt4...<br>
I'm still not really sure if it's useful, but if you're ok j-b said it<br>
can be merged...<br></blockquote></div><br><blockquote style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;" class="gmail_quote">+void<br>+services_discovery_SetLoading ( services_discovery_t * p_sd, bool loading )<br>
+{<br>+    vlc_event_t event;<br>+    event.type = vlc_ServicesDiscoveryLoadingChanged;<br>+    event.u.services_discovery_loading_changed.new_value = loading;<br>+<br>+    vlc_event_send( &p_sd->event_manager, &event );<br>
+}<br>+<br><br>+/* A certain sd is loading */<br>+static void playlist_sd_loading_changed( const vlc_event_t *p_event, void *user_data )<br>+{<br>+    bool isLoading = p_event->u.services_discovery_loading_changed.new_value;<br>
+    vlc_sd_internal_t *p_sds = user_data;<br>+    playlist_t *p_playlist = p_sds->p_node->p_playlist;<br>+    p_sds->p_sd->b_loading = isLoading;<br>+    var_SetAddress(  p_playlist, "sd-loading", p_sds->p_sd );<br>
+}<br></blockquote><br>Hi Fabio, here is my opinions on the patch:<br><br>I believe the services_discovery_t: b_loading
field should be
protected by some mutex, which services_discovery_t does not have yet.<br><br>I would suggest to:<br><br>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( ).<br>
<br>B: Or remove the b_loading field and pass the loading state as bool through callbacks all the way until Qt intf.<br><br><br>Otherwise It looks ok and I think it is quite useful!<br><br>Cheers, Jakob<br><br><br><br>