It appears to be the same basic code. Valid just means "ready to write". The queue is written until there are no more valid pages. The older implementation does not have a "magic" queue limit (32). I think that ogg has had so many mistaken implementations, that media exists with bad timestamp data, and the limit prevents some situations like, output a giant chunk of audio, and then output a giant chunk of video. Not a good sign really. A better move may be to mux data as long as you have both audio and video, and wait for more when it is not clear which should be next. Then the queue limit makes more sense, and the chunky effect is somewhat less likely.
gg
gg