37 #define SW_VOLUME_RANGE 40
39 static pthread_mutex_t
mutex_major = PTHREAD_MUTEX_INITIALIZER;
40 static pthread_mutex_t
mutex_minor = PTHREAD_MUTEX_INITIALIZER;
42 #define LOCK_MAJOR pthread_mutex_lock (& mutex_major)
43 #define UNLOCK_MAJOR pthread_mutex_unlock (& mutex_major)
44 #define LOCK_MINOR pthread_mutex_lock (& mutex_minor)
45 #define UNLOCK_MINOR pthread_mutex_unlock (& mutex_minor)
46 #define LOCK_ALL do { LOCK_MAJOR; LOCK_MINOR; } while (0)
47 #define UNLOCK_ALL do { UNLOCK_MINOR; UNLOCK_MAJOR; } while (0)
60 static OutputPlugin *
cop;
70 static inline int FR2MS (int64_t f,
int r)
71 {
return (f > 0) ? (f * 1000 + r / 2) / r : (f * 1000 - r / 2) / r; }
160 float factor = powf (10,
get_double (
NULL,
"replay_gain_preamp") / 20);
168 factor *= powf (10, gain_info.
album_gain / 20);
173 factor *= powf (10, gain_info.
track_gain / 20);
177 if (
get_bool (
NULL,
"enable_clipping_prevention") && peak * factor > 1)
183 if (factor < 0.99 || factor > 1.01)
195 if (l == 100 && r == 100)
198 float lfactor = (l == 0) ? 0 : powf (10, (
float)
SW_VOLUME_RANGE * (l - 100) / 100 / 20);
199 float rfactor = (r == 0) ? 0 : powf (10, (
float)
SW_VOLUME_RANGE * (r - 100) / 100 / 20);
204 factors[0] = lfactor;
205 factors[1] = rfactor;
210 factors[c] =
MAX (lfactor, rfactor);
219 void * buffer =
NULL;
248 ready =
MIN (ready, samples);
279 void * buffer =
NULL;
286 buffer = malloc (
sizeof (
float) * samples);
291 float * fdata = data;
312 if (rate < 1 || channels < 1)
348 AUDDBG (
"Replay Gain info:\n");
448 int time = 0, delay = 0;
470 time =
cop->output_time ();
543 * left = * right = 0;
551 cop->get_volume (left, right);
566 cop->set_volume (left, right);