AVAssetWriterInput stops being ready for input

I'm trying to create a movie with a video track and a text track, using AVAssetWriter and two instances of AVAssetWriterInput. After writing one text sample, the readyForMoreMediaData of the text track is always NO, no matter how long I wait, though the AVAssetWriter has status AVAssetWriterStatusWriting and the video track remains ready for input. What could cause this? (I'm running Mac OS Sierra.)


P.S. This problem doesn't always happen, it depends upon the data. It seems more likely to happen if the video is simple, say less than a dozen samples.