Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The backend would hang unrecoverably in the buffer dequeue; this change seems to have fixed it. I believe that the problem was caused by the fact that buffers could be decoded before the "playing" flag was set on the object, leading to missed buffers when Gstreamer ran fast. - The main thread started the pipeline and acquired the semaphore. - The file was decoded very quickly, and _new_buffer was called repeatedly but did nothing because self.playing was False. - Finally, when self.playing became True, the file had already been decoded, so the queue was empty. Thus the self.queue.get() blocked forever. It was a dumb idea to make the modification of the "playing" flag unsynchronized with respect to its accesses in _pad_added.
- Loading branch information
16e1deb
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot! I think this bug fixes the hang in my program... I spent 1-2 days trying to debug it, but wasn't successful...
16e1deb
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It certainly was a tricky one! Took me a good year or so of bug reports to finally nail it down. :)