summaryrefslogtreecommitdiff
path: root/apps/playback.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/playback.c')
-rw-r--r--apps/playback.c26
1 files changed, 10 insertions, 16 deletions
diff --git a/apps/playback.c b/apps/playback.c
index caaaddec6e..aa21ccc39b 100644
--- a/apps/playback.c
+++ b/apps/playback.c
@@ -1047,14 +1047,8 @@ static bool voice_pcmbuf_insert_callback(
1047 * against resampling buffer overflows. */ 1047 * against resampling buffer overflows. */
1048 inp_count = dsp_input_count(out_count); 1048 inp_count = dsp_input_count(out_count);
1049 1049
1050 if (inp_count <= 0) 1050 if (inp_count <= 0)
1051 { 1051 return true;
1052 DEBUGF("Error: dsp_input_count(%ld=dsp_output_count(%ld))=%ld<=0\n",
1053 out_count, count, inp_count);
1054 /* If this happens, there are samples of codec data that don't
1055 * become a number of pcm samples, and something is broken */
1056 return false;
1057 }
1058 1052
1059 /* Input size has grown, no error, just don't write more than length */ 1053 /* Input size has grown, no error, just don't write more than length */
1060 if (inp_count > count) 1054 if (inp_count > count)
@@ -1062,6 +1056,9 @@ static bool voice_pcmbuf_insert_callback(
1062 1056
1063 out_count = dsp_process(dest, src, inp_count); 1057 out_count = dsp_process(dest, src, inp_count);
1064 1058
1059 if (out_count <= 0)
1060 return true;
1061
1065 if (playing) 1062 if (playing)
1066 { 1063 {
1067 pcmbuf_mix_voice(out_count); 1064 pcmbuf_mix_voice(out_count);
@@ -1329,14 +1326,8 @@ static bool codec_pcmbuf_insert_callback(
1329 * against resampling buffer overflows. */ 1326 * against resampling buffer overflows. */
1330 inp_count = dsp_input_count(out_count); 1327 inp_count = dsp_input_count(out_count);
1331 1328
1332 if (inp_count <= 0) 1329 if (inp_count <= 0)
1333 { 1330 return true;
1334 DEBUGF("Error: dsp_input_count(%ld=dsp_output_count(%ld))=%ld<=0\n",
1335 out_count, count, inp_count);
1336 /* If this happens, there are samples of codec data that don't
1337 * become a number of pcm samples, and something is broken */
1338 return false;
1339 }
1340 1331
1341 /* Input size has grown, no error, just don't write more than length */ 1332 /* Input size has grown, no error, just don't write more than length */
1342 if (inp_count > count) 1333 if (inp_count > count)
@@ -1344,6 +1335,9 @@ static bool codec_pcmbuf_insert_callback(
1344 1335
1345 out_count = dsp_process(dest, src, inp_count); 1336 out_count = dsp_process(dest, src, inp_count);
1346 1337
1338 if (out_count <= 0)
1339 return true;
1340
1347 pcmbuf_write_complete(out_count); 1341 pcmbuf_write_complete(out_count);
1348 1342
1349#ifdef PLAYBACK_VOICE 1343#ifdef PLAYBACK_VOICE