private void RecreatePlayer()
        {
            logger.Info("");

            DetachEventHandlers();

            _playerClock.SetPlayerClockSource(null);

            player.Stop();
            player.Dispose();

            CreatePlayer();

            AttachEventHandlers();

            foreach (var esStream in esStreams)
            {
                if (esStream == null)
                {
                    continue;
                }

                esStream.SetPlayer(player);
                esStream.PushStreamConfiguration();
            }
        }
        private Task ChangeConfiguration(TimeSpan position, CancellationToken token)
        {
            logger.Info("");

            var stateSnapshot = GetSuspendState(position);

            // TODO: Access to stream controller should be "blocked" in an async way while
            // TODO: player is restarted. Hell will break loose otherwise.
            SetState(PlayerState.Idle, CancellationToken.None);

            ClosePlayer();
            player.Dispose();
            player = new ESPlayer.ESPlayer();
            OpenPlayer();

            return(RestoreStateSnapshot(stateSnapshot, token));
        }
        private void RecreatePlayer()
        {
            logger.Info("");

            DetachEventHandlers();

            player.Stop();
            player.Dispose();

            CreatePlayer();

            AttachEventHandlers();

            foreach (var esStream in esStreams)
            {
                esStream?.SetPlayer(player);
                esStream?.ResetStreamConfig();
            }
        }
        private void RecreatePlayer()
        {
            logger.Info("");

            DetachEventHandlers();

            player.Stop();
            player.Dispose();

            CreatePlayer();

            AttachEventHandlers();

            foreach (var esStream in dataStreams.Where(esStream => esStream != null))
            {
                esStream.Stream.SetPlayer(player);
                esStream.Stream.ResetStreamConfig();
            }
        }
Exemple #5
0
        private void ClosePlayer()
        {
            logger.Info("");

            DetachEventHandlers();

            _playerClock.SetPlayerClockSource(null);

            player.Stop();
            player.Close();
            player.Dispose();
            player = new ESPlayer.ESPlayer();

            foreach (var stream in esStreams)
            {
                if (stream == null)
                {
                    continue;
                }

                stream.IsConfigured = false;
                stream.SetPlayer(player);
            }
        }