diff options
author | 2012-05-30 22:07:40 +0200 | |
---|---|---|
committer | 2012-05-30 22:07:40 +0200 | |
commit | 8955786d3a4459ac67d9c26c7b5583b48cfb9772 (patch) | |
tree | 6ad4197f0602e308daed13c902a667b02fafb72c /plugins/converter | |
parent | c6d76fb26b6b8b36798e4b4e6d5ee067eed4c734 (diff) |
converter: improved error handling
Diffstat (limited to 'plugins/converter')
-rw-r--r-- | plugins/converter/converter.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/plugins/converter/converter.c b/plugins/converter/converter.c index 25774bc7..956e4586 100644 --- a/plugins/converter/converter.c +++ b/plugins/converter/converter.c @@ -974,8 +974,15 @@ convert (DB_playItem_t *it, const char *out, int output_bps, int output_is_float int frames = sz / samplesize; while (dsp) { frames = dsp->plugin->process (dsp, (float *)dspbuffer, frames, sizeof (dspbuffer) / (fmt.channels * 4), &fmt, NULL); + if (frames <= 0) { + break; + } dsp = dsp->next; } + if (frames <= 0) { + fprintf (stderr, "converter: dsp error, please check you dsp preset\n"); + goto error; + } outsr = fmt.samplerate; outch = fmt.channels; @@ -1084,6 +1091,9 @@ error: if (input_file_name[0] && strcmp (input_file_name, "-")) { unlink (input_file_name); } + if (err != 0) { + return err; + } // write junklib tags |