void stopCommand_Execute(object parameter)
 {
     try
     {
         SelectedStream.Stop();
         logService.Write("Stopped streaming from '{0}'", SelectedStream.Name);
         // IsIdle is set in the startCommand_CanExecute method which is invoked when the InputStreamState changes to Stopped
     }
     catch (Exception ex)
     {
         logService.Write(LogEntryType.Error, "Could not stop input stream '{0}':  {1}", SelectedStream.Name, ex.Message);
     }
     finally
     {
         refreshStreamStateLabel();
     }
 }
 void startCommand_Execute(object parameter)
 {
     try
     {
         IsIdle = false;
         SelectedStream.Start();
         logService.Write("Started streaming from '{0}'", SelectedStream.Name);
     }
     catch (Exception ex)
     {
         logService.Write(LogEntryType.Error, "Could not start input stream '{0}':  {1}", SelectedStream.Name, ex.Message);
         IsIdle = true;
     }
     finally
     {
         refreshStreamStateLabel();
     }
 }
예제 #3
0
        public unsafe void Dispose()
        {
            GC.SuppressFinalize(this);

            if (SelectedStream != null)
            {
                SelectedStream.Dispose();
                _stream = null;
            }

            if (_formatContext != null)
            {
                fixed(AVFormatContext **pformatContext = &_formatContext)
                {
                    FfmpegCalls.AvformatCloseInput(pformatContext);
                }

                _formatContext       = null;
                BestAudioStreamIndex = 0;
            }
        }