+
+ if (samples_todo == 0)
+ return G_SOURCE_CONTINUE;
+
+ if (devc->limit_frames) {
+ /* Never send more samples than a frame can fit... */
+ samples_todo = MIN(samples_todo, SAMPLES_PER_FRAME);
+ /* ...or than we need to finish the current frame. */
+ samples_todo = MIN(samples_todo,
+ SAMPLES_PER_FRAME - devc->sent_frame_samples);
+ }
+