Got rid of getting the output buffers once receiving 10 dequeue_output_buffer try agains. Also pass a dynamic timeout to the queueing/dequeueing of buffer calls.