- dnssd = dnssd_init(NULL);
- dnssd_register_raop(dnssd, name, raop_port, hwaddr, sizeof(hwaddr));
+ raop_set_log_level(raop, RAOP_LOG_DEBUG);
+ raop_set_log_callback(raop, &raop_log_callback, NULL);
+ raop_start(raop, &raop_port, hwaddr, sizeof(hwaddr), NULL);
+
+ error = 0;
+ dnssd = dnssd_init(&error);
+ if (error) {
+ fprintf(stderr, "ERROR: Could not initialize dnssd library!\n");
+ fprintf(stderr, "------------------------------------------\n");
+ fprintf(stderr, "You could try the following resolutions based on your OS:\n");
+ fprintf(stderr, "Windows: Try installing http://support.apple.com/kb/DL999\n");
+ fprintf(stderr, "Debian/Ubuntu: Try installing libavahi-compat-libdnssd-dev package\n");
+ raop_destroy(raop);
+ return -1;
+ }
+
+ dnssd_register_raop(dnssd, name, raop_port, hwaddr, sizeof(hwaddr), 1);