38 #define SW_VOLUME_RANGE 40
40 static pthread_mutex_t
mutex_major = PTHREAD_MUTEX_INITIALIZER;
41 static pthread_mutex_t
mutex_minor = PTHREAD_MUTEX_INITIALIZER;
43 #define LOCK_MAJOR pthread_mutex_lock (& mutex_major)
44 #define UNLOCK_MAJOR pthread_mutex_unlock (& mutex_major)
45 #define LOCK_MINOR pthread_mutex_lock (& mutex_minor)
46 #define UNLOCK_MINOR pthread_mutex_unlock (& mutex_minor)
47 #define LOCK_ALL do { LOCK_MAJOR; LOCK_MINOR; } while (0)
48 #define UNLOCK_ALL do { UNLOCK_MINOR; UNLOCK_MAJOR; } while (0)
61 static OutputPlugin *
cop;
71 static inline int FR2MS (int64_t f,
int r)
72 {
return (f > 0) ? (f * 1000 + r / 2) / r : (f * 1000 - r / 2) / r; }
161 float factor = powf (10,
get_double (
NULL,
"replay_gain_preamp") / 20);
169 factor *= powf (10, gain_info.
album_gain / 20);
174 factor *= powf (10, gain_info.
track_gain / 20);
178 if (
get_bool (
NULL,
"enable_clipping_prevention") && peak * factor > 1)
184 if (factor < 0.99 || factor > 1.01)
196 if (l == 100 && r == 100)
199 float lfactor = (l == 0) ? 0 : powf (10, (
float)
SW_VOLUME_RANGE * (l - 100) / 100 / 20);
200 float rfactor = (r == 0) ? 0 : powf (10, (
float)
SW_VOLUME_RANGE * (r - 100) / 100 / 20);
205 factors[0] = lfactor;
206 factors[1] = rfactor;
211 factors[c] =
MAX (lfactor, rfactor);
220 void * buffer =
NULL;
249 ready =
MIN (ready, samples);
280 void * buffer =
NULL;
287 buffer = malloc (
sizeof (
float) * samples);
292 float * fdata = data;
313 if (rate < 1 || channels < 1)
342 AUDDBG (
"Replay Gain info:\n");
442 int time = 0, delay = 0;
464 time =
cop->output_time ();
537 * left = * right = 0;
545 cop->get_volume (left, right);
560 cop->set_volume (left, right);