diff --git a/src/pipecat/processors/frame_processor.py b/src/pipecat/processors/frame_processor.py index ae830c52c..228143b2d 100644 --- a/src/pipecat/processors/frame_processor.py +++ b/src/pipecat/processors/frame_processor.py @@ -293,8 +293,7 @@ class FrameProcessor: await self.__input_frame_task async def __input_frame_task_handler(self): - running = True - while running: + while True: try: if self.__should_block_frames: logger.trace(f"{self}: frame processing paused") @@ -311,8 +310,6 @@ class FrameProcessor: if callback: await callback(self, frame, direction) - running = not isinstance(frame, EndFrame) - self.__input_queue.task_done() except asyncio.CancelledError: logger.trace(f"{self}: cancelled input task") @@ -330,12 +327,10 @@ class FrameProcessor: await self.__push_frame_task async def __push_frame_task_handler(self): - running = True - while running: + while True: try: (frame, direction) = await self.__push_queue.get() await self.__internal_push_frame(frame, direction) - running = not isinstance(frame, EndFrame) self.__push_queue.task_done() except asyncio.CancelledError: logger.trace(f"{self}: cancelled push task")