+ if(!c->api) {
+ if(c->speaker_command)
+ c->api = xstrdup("command");
+ else if(c->broadcast.n)
+ c->api = xstrdup("rtp");
+ else if(config_uaudio_apis)
+ c->api = xstrdup(config_uaudio_apis[0]->name);
+ else
+ c->api = xstrdup("<none>");
+ }
+ if(!strcmp(c->api, "network"))
+ c->api = xstrdup("rtp");
+ if(server) {
+ if(!strcmp(c->api, "command") && !c->speaker_command)
+ fatal(0, "'api command' but speaker_command is not set");
+ if((!strcmp(c->api, "rtp")) && !c->broadcast.n)
+ fatal(0, "'api rtp' but broadcast is not set");
+ }
+ /* Override sample format */
+ if(!strcmp(c->api, "rtp")) {
+ c->sample_format.rate = 44100;
+ c->sample_format.channels = 2;
+ c->sample_format.bits = 16;
+ c->sample_format.endian = ENDIAN_NATIVE;
+ }
+ if(!strcmp(c->api, "coreaudio")) {
+ c->sample_format.rate = 44100;
+ c->sample_format.channels = 2;
+ c->sample_format.bits = 16;
+ c->sample_format.endian = ENDIAN_NATIVE;
+ }
+ if(!c->default_rights) {
+ rights_type r = RIGHTS__MASK & ~(RIGHT_ADMIN|RIGHT_REGISTER
+ |RIGHT_MOVE__MASK
+ |RIGHT_SCRATCH__MASK
+ |RIGHT_REMOVE__MASK);
+ /* The idea is to approximate the meaning of the old 'restrict' directive
+ * in the default rights if they are not overridden. */
+ if(c->restrictions & RESTRICT_SCRATCH)
+ r |= RIGHT_SCRATCH_MINE|RIGHT_SCRATCH_RANDOM;
+ else
+ r |= RIGHT_SCRATCH_ANY;
+ if(!(c->restrictions & RESTRICT_MOVE))
+ r |= RIGHT_MOVE_ANY;
+ if(c->restrictions & RESTRICT_REMOVE)
+ r |= RIGHT_REMOVE_MINE;
+ else
+ r |= RIGHT_REMOVE_ANY;
+ c->default_rights = rights_string(r);
+ }