output/shout: minimize the unpause latency
During the pause loop, manually sleep for 500ms if shout_delay() returns a value greater than that. Don't exhaust libshout's buffer.
This commit is contained in:
parent
7133f560ec
commit
f38ce5408b
1
NEWS
1
NEWS
|
@ -8,6 +8,7 @@ ver 0.15.2 (2009/??/??)
|
||||||
- flac: don't allocate cuesheet twice (memleak)
|
- flac: don't allocate cuesheet twice (memleak)
|
||||||
* output:
|
* output:
|
||||||
- shout: fixed stuck pause bug
|
- shout: fixed stuck pause bug
|
||||||
|
- shout: minimize the unpause latency
|
||||||
* update: free empty path string (memleak)
|
* update: free empty path string (memleak)
|
||||||
* update: free temporary string in container scan (memleak)
|
* update: free temporary string in container scan (memleak)
|
||||||
* directory: free empty directories after removing them (memleak)
|
* directory: free empty directories after removing them (memleak)
|
||||||
|
|
|
@ -448,8 +448,15 @@ my_shout_play(void *data, const void *chunk, size_t size, GError **error)
|
||||||
static bool
|
static bool
|
||||||
my_shout_pause(void *data)
|
my_shout_pause(void *data)
|
||||||
{
|
{
|
||||||
|
struct shout_data *sd = (struct shout_data *)data;
|
||||||
static const char silence[1020];
|
static const char silence[1020];
|
||||||
|
|
||||||
|
if (shout_delay(sd->shout_conn) > 500) {
|
||||||
|
/* cap the latency for unpause */
|
||||||
|
g_usleep(500000);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
return my_shout_play(data, silence, sizeof(silence), NULL);
|
return my_shout_play(data, silence, sizeof(silence), NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue