diff options
author | waker <wakeroid@gmail.com> | 2011-05-20 21:28:56 +0200 |
---|---|---|
committer | waker <wakeroid@gmail.com> | 2011-05-20 21:28:56 +0200 |
commit | 1810ce0564058b621909567fdb2750c3d8cd02b6 (patch) | |
tree | b951a4888306a41393e4f3344b7c22c8a7af2878 /streamer.c | |
parent | 603a9f7c9e24e70b8e7a2c7f0700cb014885ef6d (diff) |
added GUI option to control 8 to 16 bit auto-conversion
Diffstat (limited to 'streamer.c')
-rw-r--r-- | streamer.c | 15 |
1 files changed, 11 insertions, 4 deletions
@@ -1653,12 +1653,14 @@ streamer_set_output_format (void) { int playing = (output->state () == OUTPUT_STATE_PLAYING); fprintf (stderr, "streamer_set_output_format %dbit %s %dch %dHz channelmask=%X, bufferfill: %d\n", output_format.bps, output_format.is_float ? "float" : "int", output_format.channels, output_format.samplerate, output_format.channelmask, streamer_ringbuf.remaining); + ddb_waveformat_t fmt; + memcpy (&fmt, &output_format, sizeof (ddb_waveformat_t)); if (autoconv_8_to_16) { - if (output_format.bps == 8) { - output_format.bps = 16; + if (fmt.bps == 8) { + fmt.bps = 16; } } - output->setformat (&output_format); + output->setformat (&fmt); streamer_buffering = 1; if (playing && output->state () != OUTPUT_STATE_PLAYING) { if (0 != output->play ()) { @@ -1937,7 +1939,12 @@ streamer_configchanged (void) { if (playing_track) { playing_track->played = 1; } - autoconv_8_to_16 = conf_get_int ("streamer.8_to_16", 1); + int conf_autoconv_8_to_16 = conf_get_int ("streamer.8_to_16", 1); + if (conf_autoconv_8_to_16 != autoconv_8_to_16) { + autoconv_8_to_16 = conf_autoconv_8_to_16; + formatchanged = 1; + streamer_reset (1); + } } void |