diff options
Diffstat (limited to 'apps/plugins')
-rw-r--r-- | apps/plugins/test_codec.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/apps/plugins/test_codec.c b/apps/plugins/test_codec.c index bae4571067..22516ba373 100644 --- a/apps/plugins/test_codec.c +++ b/apps/plugins/test_codec.c | |||
@@ -810,10 +810,34 @@ show_menu: | |||
810 | 810 | ||
811 | rb->closedir(dir); | 811 | rb->closedir(dir); |
812 | } | 812 | } |
813 | /* process last samples */ | ||
814 | if (use_dsp) | ||
815 | rb->dsp_flush_limiter_buffer(dspbuffer); | ||
813 | } else { | 816 | } else { |
814 | /* Just test the file */ | 817 | /* Just test the file */ |
815 | res = test_track(parameter); | 818 | res = test_track(parameter); |
816 | 819 | ||
820 | /* process last samples */ | ||
821 | if (use_dsp) | ||
822 | { | ||
823 | int channels = (wavinfo.stereomode == STEREO_MONO) ? 1 : 2; | ||
824 | int count = rb->dsp_flush_limiter_buffer(dspbuffer); | ||
825 | if (channels == 1) | ||
826 | { | ||
827 | unsigned char *s = dspbuffer, *d = dspbuffer; | ||
828 | int c = count; | ||
829 | while (c-- > 0) | ||
830 | { | ||
831 | *d++ = *s++; | ||
832 | *d++ = *s++; | ||
833 | s++; | ||
834 | s++; | ||
835 | } | ||
836 | } | ||
837 | if (wavinfo.fd >= 0) | ||
838 | rb->write(wavinfo.fd, dspbuffer, count * 2 * channels); | ||
839 | } | ||
840 | |||
817 | /* Close WAV file (if there was one) */ | 841 | /* Close WAV file (if there was one) */ |
818 | if (wavinfo.fd >= 0) { | 842 | if (wavinfo.fd >= 0) { |
819 | close_wav(); | 843 | close_wav(); |