Skip to content

Commit

Permalink
get format from streamer before switching output plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
Oleksiy-Yakovenko committed May 15, 2011
1 parent d618d16 commit f60708b
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
5 changes: 4 additions & 1 deletion plugins.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 ();
}

Expand Down
5 changes: 5 additions & 0 deletions streamer.c
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}
4 changes: 4 additions & 0 deletions streamer.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#define __STREAMER_H

#include "playlist.h"
#include "deadbeef.h"

int
streamer_init (void);
Expand Down Expand Up @@ -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

0 comments on commit f60708b

Please sign in to comment.