summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--plugins.c5
-rw-r--r--streamer.c5
-rw-r--r--streamer.h4
3 files changed, 13 insertions, 1 deletions
diff --git a/plugins.c b/plugins.c
index a23478a5..edb624a5 100644
--- a/plugins.c
+++ b/plugins.c
@@ -1081,9 +1081,12 @@ plug_reinit_sound (void) {
ddb_waveformat_t fmt = {0};
+ streamer_get_output_format (&fmt);
if (prev) {
state = prev->state ();
- memcpy (&fmt, &prev->fmt, sizeof (fmt));
+ if (!fmt.channels) {
+ memcpy (&fmt, &prev->fmt, sizeof (fmt));
+ }
prev->free ();
}
diff --git a/streamer.c b/streamer.c
index 8bdb4810..fb1798da 100644
--- a/streamer.c
+++ b/streamer.c
@@ -2049,3 +2049,8 @@ streamer_set_dsp_chain (ddb_dsp_context_t *chain) {
streamer_set_seek (playpos);
}
}
+
+void
+streamer_get_output_format (ddb_waveformat_t *fmt) {
+ memcpy (fmt, &output_format, sizeof (ddb_waveformat_t));
+}
diff --git a/streamer.h b/streamer.h
index 77b14fe0..c06fdf8b 100644
--- a/streamer.h
+++ b/streamer.h
@@ -19,6 +19,7 @@
#define __STREAMER_H
#include "playlist.h"
+#include "deadbeef.h"
int
streamer_init (void);
@@ -117,4 +118,7 @@ streamer_set_dsp_chain (struct ddb_dsp_context_s *chain);
void
streamer_dsp_refresh (void);
+void
+streamer_get_output_format (ddb_waveformat_t *fmt);
+
#endif // __STREAMER_H