def queue(self, queue_, value):
        """Puts a value into a queue but aborts if this thread is closed."""
        while not self.closed:
            try:
                queue_.put(value, block=True, timeout=1)
                break
            except queue.Full:
                continue
Puts a value into a queue but aborts if this thread is closed.
src/livestreamer/stream/segmented.py