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.
This commit is contained in:
Max Kellermann 2011-02-27 23:26:50 +01:00
parent ce370bee60
commit 1674a4ec82
2 changed files with 2 additions and 1 deletions

1
NEWS
View File

@ -1,6 +1,7 @@
ver 0.15.16 (2010/??/??) ver 0.15.16 (2010/??/??)
* output: * output:
- ao: initialize the ao_sample_format struct - ao: initialize the ao_sample_format struct
- jack: fix crash with mono playback
* encoders: * encoders:
- lame: explicitly configure the output sample rate - lame: explicitly configure the output sample rate
* update: log all file permission problems * update: log all file permission problems

View File

@ -423,7 +423,7 @@ mpd_jack_play(void *data, const void *chunk, size_t size, GError **error)
/* send data symmetrically */ /* send data symmetrically */
space = space1; space = space1;
if (space >= frame_size) if (space >= jack_sample_size)
break; break;
/* XXX do something more intelligent to /* XXX do something more intelligent to