isDrained
True once receive has reported the end of the stream, and until the next flush.
Null from receive means two different things, "give me more input" and "there is nothing left", and the engine has to tell them apart: one of the six conditions end of stream is made of is that this decoder has nothing left to give. Without the flag the engine would have to infer it from having sent a null packet and then guess how many null receives are enough, which is how a player ends up either cutting the last frames off or never finishing at all.