GNOME Bugzilla – Bug 705539
Rhythmbox might fail to play songs when two DAAP shares exist on the same host
Last modified: 2018-05-24 17:56:30 UTC
rb_daap_plugin_find_source_for_uri() looks up a source for a given DAAP record URI. It presently does this by looking at each item in the hash table of sources and comparing the item's host to the host in the given URI. This obviously might return the wrong source in the case that a host has two DAAP shares listening on two ports, because the port is not considered. I need to: 1. Modify rb_daap_plugin_find_source_for_uri() to provide a host+port to source_host_find, 2. Modify source_host_find to consider ports when making a comparison (and rename the function), and 3. Make a failed call to rb_daap_plugin_find_source_for_uri() from rb_daap_src_change_state() print a useful error.
Fixed (1) and (2) above. I still need to modify Rhythmbox so that it provides better feedback to the user if something goes wrong (3).
+ if (source == NULL || host_and_port == NULL) { + goto out; this is before anything can possibly have been allocated, so the 'goto out' isn't very useful. + if (NULL != source_host) { + g_free (source_host); + } + + if (NULL != source_host_and_port) { + g_free (source_host_and_port); + } g_free () checks for NULL internally, so you don't need the 'if (NULL != thing)' checks. + host_and_port = strdup (uri + 7); /* Skip daap://. */ + if (NULL == host_and_port) { + goto out; + } should use g_strdup here, not strdup, and remove the check for it returning NULL (g_strdup will abort on allocation failure). calling g_free on strings allocated by non-glib functions is also a bad idea.
I just pushed some changes to address the comments above.
-- GitLab Migration Automatic Message -- This bug has been migrated to GNOME's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/rhythmbox/issues/1297.