summaryrefslogtreecommitdiff
path: root/apps/pcmbuf.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/pcmbuf.c')
-rw-r--r--apps/pcmbuf.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/apps/pcmbuf.c b/apps/pcmbuf.c
index 964ebbc901..d8612a4fbc 100644
--- a/apps/pcmbuf.c
+++ b/apps/pcmbuf.c
@@ -94,6 +94,7 @@ static size_t pcmbuf_mix_sample IDATA_ATTR;
94 94
95static bool low_latency_mode = false; 95static bool low_latency_mode = false;
96static bool pcmbuf_flush; 96static bool pcmbuf_flush;
97static volatile bool output_completed = false;
97 98
98extern struct thread_entry *codec_thread_p; 99extern struct thread_entry *codec_thread_p;
99 100
@@ -115,7 +116,7 @@ void pcmbuf_boost(bool state)
115#ifdef HAVE_PRIORITY_SCHEDULING 116#ifdef HAVE_PRIORITY_SCHEDULING
116 static bool priority_modified = false; 117 static bool priority_modified = false;
117#endif 118#endif
118 119
119 if (crossfade_init || crossfade_active) 120 if (crossfade_init || crossfade_active)
120 return; 121 return;
121 122
@@ -203,14 +204,7 @@ process_new_buffer:
203 *realsize = 0; 204 *realsize = 0;
204 *realstart = NULL; 205 *realstart = NULL;
205 CALL_IF_EXISTS(pcmbuf_event_handler); 206 CALL_IF_EXISTS(pcmbuf_event_handler);
206 /* FIXME: We need to find another way to keep the CPU from 207 output_completed = true;
207 * being left boosted, because this is boosting in interrupt
208 * context. This is also not a good thing, because it will
209 * result in the CPU being deboosted if there is a legitimate
210 * buffer underrun (albeit only temporarily, because someone
211 * will reboost it soon, but it will make the skip longer
212 * than necessary. */
213 pcmbuf_boost(false);
214 } 208 }
215 } 209 }
216} 210}
@@ -1037,3 +1031,12 @@ bool pcmbuf_is_crossfade_enabled(void)
1037 return crossfade_enabled; 1031 return crossfade_enabled;
1038} 1032}
1039 1033
1034bool pcmbuf_output_completed(void)
1035{
1036 if (output_completed)
1037 {
1038 output_completed = false;
1039 return true;
1040 }
1041 return false;
1042}