aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2011-02-27 23:26:50 +0100
committerMax Kellermann <max@duempel.org>2011-02-27 23:26:50 +0100
commit1674a4ec828ebd6822e1d1622d9fcdae5140a61d (patch)
tree60d7e7974da6be946a2c9e909df9251660f4436d
parentce370bee60f685d9e7b109ac67ae656b46779f88 (diff)
downloadmpd-1674a4ec828ebd6822e1d1622d9fcdae5140a61d.tar.gz
mpd-1674a4ec828ebd6822e1d1622d9fcdae5140a61d.tar.xz
mpd-1674a4ec828ebd6822e1d1622d9fcdae5140a61d.zip
output/jack: fix crash with mono playback
With mono sound, jack_sample_size is smaller than frame_size (4 vs 2 bytes), and "space/jack_sample_size==0". That means mpd_jack_play() will return 0, although no error has occurred.
-rw-r--r--NEWS1
-rw-r--r--src/output/jack_plugin.c2
2 files changed, 2 insertions, 1 deletions
diff --git a/NEWS b/NEWS
index 76571d0f0..381417f87 100644
--- a/NEWS
+++ b/NEWS
@@ -1,6 +1,7 @@
ver 0.15.16 (2010/??/??)
* output:
- ao: initialize the ao_sample_format struct
+ - jack: fix crash with mono playback
* encoders:
- lame: explicitly configure the output sample rate
* update: log all file permission problems
diff --git a/src/output/jack_plugin.c b/src/output/jack_plugin.c
index 4b71dc8c4..0a0b8377f 100644
--- a/src/output/jack_plugin.c
+++ b/src/output/jack_plugin.c
@@ -423,7 +423,7 @@ mpd_jack_play(void *data, const void *chunk, size_t size, GError **error)
/* send data symmetrically */
space = space1;
- if (space >= frame_size)
+ if (space >= jack_sample_size)
break;
/* XXX do something more intelligent to