# HG changeset patch # User William Pitcock # Date 1200141596 21600 # Node ID 833e5faa584728414bd01d02012167d78b590914 # Parent d52fe5ff19a4637df0f78f1a4479cd6612234017 Make sample rate conversion work with mono files. (Bugzilla #88) diff -r d52fe5ff19a4 -r 833e5faa5847 src/audacious/output.c --- a/src/audacious/output.c Sat Jan 12 06:35:45 2008 -0600 +++ b/src/audacious/output.c Sat Jan 12 06:39:56 2008 -0600 @@ -437,7 +437,7 @@ #ifdef USE_SRC if(src_state != NULL&&length > 0) { - int lrLength = length/2; + int lrLength = length / nch; int overLrLength = (int)floor(lrLength*(src_data.src_ratio+1)); if(lengthOfSrcIn < lrLength) { @@ -457,8 +457,8 @@ src_data.data_in = srcIn; src_data.data_out = srcOut; src_data.end_of_input = 0; - src_data.input_frames = lrLength/2; - src_data.output_frames = overLrLength/2; + src_data.input_frames = lrLength / nch; + src_data.output_frames = overLrLength / nch; if ((srcError = src_process(src_state, &src_data)) > 0) { fprintf(stderr, "src_process(): %s\n", src_strerror(srcError)); @@ -467,7 +467,7 @@ { src_float_to_short_array(srcOut, wOut, src_data.output_frames_gen*2); ptr = wOut; - length = src_data.output_frames_gen*4; + length = src_data.output_frames_gen * (nch * 2); } } #endif