After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 705539 - Rhythmbox might fail to play songs when two DAAP shares exist on the same host
Rhythmbox might fail to play songs when two DAAP shares exist on the same host
Status: RESOLVED OBSOLETE
Product: rhythmbox
Classification: Other
Component: DAAP
2.99.x
Other Linux
: Low enhancement
: ---
Assigned To: RhythmBox Maintainers
RhythmBox Maintainers
Depends on:
Blocks:
 
 
Reported: 2013-08-06 02:59 UTC by W. Michael Petullo
Modified: 2018-05-24 17:56 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description W. Michael Petullo 2013-08-06 02:59:13 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.
Comment 1 W. Michael Petullo 2013-08-06 15:51:57 UTC
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).
Comment 2 Jonathan Matthew 2013-08-06 22:47:46 UTC
+       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.
Comment 3 W. Michael Petullo 2013-08-11 21:36:19 UTC
I just pushed some changes to address the comments above.
Comment 4 GNOME Infrastructure Team 2018-05-24 17:56:30 UTC
-- 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.