MFormats SDK

MPlatform SDK

Once the stream is again online, the decoding takes some time for initial buffering and restores playback.

But this feature has some disadvantages: it doesn't work for some specific streams and multicast UDP streams.

Manual reconnect feature

You can make the reconnect faster and reliable using a manual way. For this, you should check for statistics of your MFReader or MFile objects. In case of MPlatform SDK, it is possible to use MPlaylist's object statistics because its items are not available for monitoring.

In this mode, the added frames are still generated, but even the stream is available again, it doesn't start the playback.

So, in general, "stat::added" value grows until the stream isn't back again. And once it is back, the value stops growing and "stat::elapsed" starts to increase. The value of "elapsed" means how long the object waits for a proper frame.

To resume the stream from the required position, you should get the previous position with FilePosGet method. After the reconnect, you should add the value of elapsed time to the position and use the result for FilePosSet method..