1
Vote

mkv splitter worker thread must use timed reads

description

The worker thread in mkvsplit calls IAsyncReader::SyncRead, but this can block indefinitely if the network download is slow. We need to have it use timed reads (via an intermediary, e.g. the cached reader), and when the read times out, signal starvation (if necessary).
 
The problem is that if the worker thread is blocked on a synchronous read, then we can't complete the transition to stopped (because that requires terminating the worker thread -- but we cannot do that if it is bloked on read call). Right not it works because we always test wth a local file, and "downloading" a loca file never blocks. But that is not the case for a network download.

comments