/// <summary> /// Pushes data packet to ESPlayer /// </summary> /// <param name="dataPacket">Packet</param> /// <param name="token">CancellationToken</param> /// <exception cref="PacketSubmitException"> /// Exception thrown on submit error /// </exception> private void PushUnencryptedPacket(Packet dataPacket, CancellationToken token) { // Convert Juvo packet to ESPlayer packet var esPacket = dataPacket.ESUnencryptedPacket(); // Continue pushing packet till success or terminal failure bool doRetry; do { var res = player.SubmitPacket(esPacket); doRetry = ShouldRetry(res, token); logger.Debug($"{esPacket.type}: ({!doRetry}/{res}) PTS: {esPacket.pts} Duration: {esPacket.duration}"); } while (doRetry && !token.IsCancellationRequested); }