Great, I’m back at the initial problem: the beginning of the pipeline needs to know when the end of the pipeline has processed all the data that the beginning of the pipeline has produced. Unfortunately, with external decoders, that is not done easily or reliably. At least I can not think of a way that does not involve “waiting until x ms have gone by without getting data.”
I’m beginning to doubt that my current approach of transporting data from a source to a sink by using threads for each source will ever work. It appeared to be way too simple, too!
Just when you think “yay, parsing MP3 frame headers is the shit,” somebody comes along and starts hitting you with a book called “MP3 Info Tag.” In the head. Repeatedly.