comparison src/crossfade/crossfade.c @ 3134:354e90c81253

crossfade: more cleanups
author Michal Lipski <tallica@o2.pl>
date Thu, 07 May 2009 13:13:54 +0200
parents d58963762734
children a9593b76cf19
comparison
equal deleted inserted replaced
3133:005959102811 3134:354e90c81253
345 DEBUG((" (max_write=%d)", the_op_config.max_write_len)); 345 DEBUG((" (max_write=%d)", the_op_config.max_write_len));
346 346
347 DEBUG(("\n")); 347 DEBUG(("\n"));
348 348
349 /* setup sample rate (note that OUTPUT_RATE is #defined as the_rate) */ 349 /* setup sample rate (note that OUTPUT_RATE is #defined as the_rate) */
350 the_rate = config->output_rate; 350 //the_rate = config->output_rate;
351 351
352 /* setup out_format. use host byte order for easy math */ 352 /* setup out_format. use host byte order for easy math */
353 setup_format(FMT_S16_NE, OUTPUT_RATE, OUTPUT_NCH, &out_format); 353 setup_format(FMT_S16_NE, OUTPUT_RATE, OUTPUT_NCH, &out_format);
354 354
355 /* open plugin */ 355 /* open plugin */
376 buffer->size, 376 buffer->size,
377 B2MS(buffer->mix_size), 377 B2MS(buffer->mix_size),
378 B2MS(buffer->preload_size), 378 B2MS(buffer->preload_size),
379 B2MS(buffer->sync_size), 379 B2MS(buffer->sync_size),
380 B2MS(buffer->size), 380 B2MS(buffer->size),
381 the_rate)); 381 OUTPUT_RATE));
382 382
383 /* allocate buffer */ 383 /* allocate buffer */
384 if (!(buffer->data = g_malloc0(buffer->size))) 384 if (!(buffer->data = g_malloc0(buffer->size)))
385 { 385 {
386 DEBUG(("[crossfade] open_output: error allocating buffer!\n")); 386 DEBUG(("[crossfade] open_output: error allocating buffer!\n"));
419 memset(config, 0, sizeof(*config)); 419 memset(config, 0, sizeof(*config));
420 *config = config_default; 420 *config = config_default;
421 xfade_load_config(); 421 xfade_load_config();
422 422
423 /* set default strings if there is no existing config */ 423 /* set default strings if there is no existing config */
424 if (!config->oss_alt_audio_device) config->oss_alt_audio_device = g_strdup(DEFAULT_OSS_ALT_AUDIO_DEVICE);
425 if (!config->oss_alt_mixer_device) config->oss_alt_mixer_device = g_strdup(DEFAULT_OSS_ALT_MIXER_DEVICE);
426 if (!config->op_config_string) config->op_config_string = g_strdup(DEFAULT_OP_CONFIG_STRING);
427 if (!config->op_name) config->op_name = g_strdup(DEFAULT_OP_NAME); 424 if (!config->op_name) config->op_name = g_strdup(DEFAULT_OP_NAME);
428 425
429 /* check for realtime priority, it needs some special attention */ 426 /* check for realtime priority, it needs some special attention */
430 realtime = xfplayer_check_realtime_priority(); 427 realtime = xfplayer_check_realtime_priority();
431 428