Пример #1
0
        public void close()
        {
            if (VideoState == VideoState.CLOSED)
            {
                return;
            }

            VideoState = VideoState.CLOSED;

            videoDecoder.FrameQueue.stop();

            demuxPacketsCancellationTokenSource.Cancel();

            demuxPacketsTask.Wait();

            videoDecoder.close();
            audioPlayer.flush();

            videoPts      = 0;
            videoPtsDrift = 0;

            seekRequest  = false;
            seekPosition = 0;

            DurationSeconds = 0;
            PositionSeconds = 0;

            if (VideoClosed != null)
            {
                VideoClosed(this, EventArgs.Empty);
            }
        }