summaryrefslogtreecommitdiff
path: root/streamer.c
diff options
context:
space:
mode:
authorGravatar Alexey Yakovenko <wakeroid@gmail.com>2010-06-14 21:38:03 +0200
committerGravatar Alexey Yakovenko <wakeroid@gmail.com>2010-06-14 21:38:03 +0200
commit1d8412ece6a58627b2a6f631c64c49460fe6097b (patch)
treefcd1a375174776c36551558ce882a3d5bfe8d536 /streamer.c
parent9eca6a34eab9a38ab3c44f7f4ccd1a6439080a34 (diff)
switch samplerate when starting new track
Diffstat (limited to 'streamer.c')
-rw-r--r--streamer.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/streamer.c b/streamer.c
index 4b304c3e..9f95b112 100644
--- a/streamer.c
+++ b/streamer.c
@@ -791,6 +791,9 @@ streamer_start_new_song (void) {
avg_bitrate = -1;
if (p_state () != OUTPUT_STATE_PLAYING) {
streamer_reset (1);
+ if (fileinfo) {
+ plug_get_output ()->change_rate (fileinfo->samplerate);
+ }
if (p_play () < 0) {
fprintf (stderr, "streamer: failed to start playback; output plugin doesn't work\n");
streamer_set_nextsong (-2, 0);
@@ -912,6 +915,9 @@ streamer_thread (void *ctx) {
// output plugin may stop playback before switching samplerate
if (p_state () != OUTPUT_STATE_PLAYING) {
+ if (fileinfo) {
+ plug_get_output ()->change_rate (fileinfo->samplerate);
+ }
if (p_play () < 0) {
fprintf (stderr, "streamer: failed to start playback after samplerate change; output plugin doesn't work\n");
streamer_set_nextsong (-2, 0);