internal override void StateChanged(PlayState oldState, PlayState newState)
        {
            switch (newState)
            {
            case PlayState.Playing when DataSource.HasAudio:
                AL.SourcePlay(SourceHandle);
                break;

            case PlayState.Paused when DataSource.HasAudio:
                AL.SourcePause(SourceHandle);
                break;

            case PlayState.Stopped:
                AL.SourceStop(SourceHandle);
                while (PacketQueue.Any())
                {
                    PacketQueue.Take();
                }
                break;
            }
        }
Exemple #2
0
        internal override void StateChanged(PlayState oldState, PlayState newState)
        {
            switch (newState)
            {
            case PlayState.Playing when oldState == PlayState.Stopped:
                _skipFrames      = 1;
                PlayedFrameCount = 0;
                break;

            case PlayState.Stopped:
                _skipFrames      = 0;
                PlayedFrameCount = 0;
                if (DataSource.HasVideo)
                {
                    ResetBuffer();
                }
                while (PacketQueue.Any())
                {
                    PacketQueue.Take();
                }
                break;
            }
        }