pts_delay is a hack. It prevents pause from working correctly by putting all the buffer in the decoding buffer, it changes the timestamps, ...
It would be much better to handle all caching at stream level (just keeping a minimal pts_delay like 100-200ms to handle decoder fifo):
- unify prebuffer and buffer
- don't fiddle with timestamps
- you get correct pause handling
- probably easier to fix buffer underrun recovery
The pb is that stream level caching is size-based and not time-based.
- Most other players do size-based caching (ok, it doesn't mean we *have* to do it, but it's a hint)
- The demuxer can send hints to the stream about the mux rate