+ c->api = BACKEND_NETWORK;
+ else
+ c->api = DEFAULT_BACKEND;
+ }
+ if(server) {
+ if(c->api == BACKEND_COMMAND && !c->speaker_command)
+ fatal(0, "'api command' but speaker_command is not set");
+ if(c->api == BACKEND_NETWORK && !c->broadcast.n)
+ fatal(0, "'api network' but broadcast is not set");
+ }
+ /* Override sample format */
+ switch(c->api) {
+ case BACKEND_NETWORK:
+ c->sample_format.rate = 44100;
+ c->sample_format.channels = 2;
+ c->sample_format.bits = 16;
+ c->sample_format.endian = ENDIAN_BIG;
+ break;
+ case BACKEND_COREAUDIO:
+ c->sample_format.rate = 44100;
+ c->sample_format.channels = 2;
+ c->sample_format.bits = 16;
+ c->sample_format.endian = ENDIAN_NATIVE;
+ break;
+ }
+ 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);