mirror of
https://github.com/owntone/owntone-server.git
synced 2025-02-26 12:59:19 -05:00
[-] A bit of cleaning up
This commit is contained in:
parent
dc65cb5b76
commit
ce2be1a724
@ -49,7 +49,7 @@
|
|||||||
// How long (in sec) to keep an input open without the player reading from it
|
// How long (in sec) to keep an input open without the player reading from it
|
||||||
#define INPUT_OPEN_TIMEOUT 600
|
#define INPUT_OPEN_TIMEOUT 600
|
||||||
|
|
||||||
#define DEBUG 1 //TODO disable
|
//#define DEBUG_INPUT 1
|
||||||
|
|
||||||
extern struct input_definition input_file;
|
extern struct input_definition input_file;
|
||||||
extern struct input_definition input_http;
|
extern struct input_definition input_http;
|
||||||
@ -139,7 +139,7 @@ static struct timespec input_loop_timeout = { INPUT_LOOP_TIMEOUT, 0 };
|
|||||||
static struct timeval input_open_timeout = { INPUT_OPEN_TIMEOUT, 0 };
|
static struct timeval input_open_timeout = { INPUT_OPEN_TIMEOUT, 0 };
|
||||||
static struct event *input_open_timeout_ev;
|
static struct event *input_open_timeout_ev;
|
||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG_INPUT
|
||||||
static size_t debug_elapsed;
|
static size_t debug_elapsed;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -352,7 +352,7 @@ flush(short *flags)
|
|||||||
|
|
||||||
pthread_mutex_unlock(&input_buffer.mutex);
|
pthread_mutex_unlock(&input_buffer.mutex);
|
||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG_INPUT
|
||||||
DPRINTF(E_DBG, L_PLAYER, "Flushing %zu bytes with flags %d\n", len, *flags);
|
DPRINTF(E_DBG, L_PLAYER, "Flushing %zu bytes with flags %d\n", len, *flags);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
@ -697,7 +697,7 @@ input_read(void *data, size_t size, short *flag, void **flagdata)
|
|||||||
|
|
||||||
input_buffer.bytes_read += len;
|
input_buffer.bytes_read += len;
|
||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG_INPUT
|
||||||
// Logs if flags present or each 10 seconds
|
// Logs if flags present or each 10 seconds
|
||||||
|
|
||||||
if (*flag & INPUT_FLAG_QUALITY)
|
if (*flag & INPUT_FLAG_QUALITY)
|
||||||
|
@ -47,7 +47,7 @@
|
|||||||
// If latency is jumping up and down we don't do compensation since we probably
|
// If latency is jumping up and down we don't do compensation since we probably
|
||||||
// wouldn't do a good job. We use linear regression to determine the trend, but
|
// wouldn't do a good job. We use linear regression to determine the trend, but
|
||||||
// if r2 is below this value we won't attempt to correct sync.
|
// if r2 is below this value we won't attempt to correct sync.
|
||||||
#define ALSA_MAX_VARIANCE 0.2
|
#define ALSA_MAX_VARIANCE 0.3
|
||||||
|
|
||||||
// We correct latency by adjusting the sample rate in steps. However, if the
|
// We correct latency by adjusting the sample rate in steps. However, if the
|
||||||
// latency keeps drifting we give up after reaching this step.
|
// latency keeps drifting we give up after reaching this step.
|
||||||
|
10
src/player.c
10
src/player.c
@ -110,12 +110,6 @@
|
|||||||
// (value is in milliseconds)
|
// (value is in milliseconds)
|
||||||
#define PLAYER_WRITE_BEHIND_MAX 1500
|
#define PLAYER_WRITE_BEHIND_MAX 1500
|
||||||
|
|
||||||
// When we pause, we keep the input open, but we can't do that forever. We must
|
|
||||||
// think of the poor streaming servers, for instance. This timeout determines
|
|
||||||
// how long we stay paused, before we close the inputs.
|
|
||||||
// (value is in seconds)
|
|
||||||
#define PLAYER_PAUSE_TIMEOUT 600
|
|
||||||
|
|
||||||
//#define DEBUG_PLAYER 1
|
//#define DEBUG_PLAYER 1
|
||||||
|
|
||||||
struct volume_param {
|
struct volume_param {
|
||||||
@ -273,8 +267,6 @@ static struct timespec player_tick_interval;
|
|||||||
// Timer resolution
|
// Timer resolution
|
||||||
static struct timespec player_timer_res;
|
static struct timespec player_timer_res;
|
||||||
|
|
||||||
//static struct timeval player_pause_timeout = { PLAYER_PAUSE_TIMEOUT, 0 };
|
|
||||||
|
|
||||||
// PLAYER_WRITE_BEHIND_MAX converted to clock ticks
|
// PLAYER_WRITE_BEHIND_MAX converted to clock ticks
|
||||||
static int pb_write_deficit_max;
|
static int pb_write_deficit_max;
|
||||||
|
|
||||||
@ -939,8 +931,6 @@ event_play_eof()
|
|||||||
if (consume)
|
if (consume)
|
||||||
db_queue_delete_byitemid(pb_session.playing_now->item_id);
|
db_queue_delete_byitemid(pb_session.playing_now->item_id);
|
||||||
|
|
||||||
// outputs_metadata_prune(pb_session.pos);
|
|
||||||
|
|
||||||
if (pb_session.reading_next)
|
if (pb_session.reading_next)
|
||||||
outputs_metadata_send(pb_session.reading_next->item_id, false, metadata_finalize_cb);
|
outputs_metadata_send(pb_session.reading_next->item_id, false, metadata_finalize_cb);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user