本文整理汇总了C#中MediaBrowser.Api.Playback.StreamState.Dispose方法的典型用法代码示例。如果您正苦于以下问题:C# StreamState.Dispose方法的具体用法?C# StreamState.Dispose怎么用?C# StreamState.Dispose使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MediaBrowser.Api.Playback.StreamState
的用法示例。
在下文中一共展示了StreamState.Dispose方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnFfMpegProcessExited
/// <summary>
/// Processes the exited.
/// </summary>
/// <param name="process">The process.</param>
/// <param name="state">The state.</param>
/// <param name="outputPath">The output path.</param>
private void OnFfMpegProcessExited(Process process, StreamState state, string outputPath)
{
var job = ApiEntryPoint.Instance.GetTranscodingJob(outputPath, TranscodingJobType);
if (job != null)
{
job.HasExited = true;
}
Logger.Debug("Disposing stream resources");
state.Dispose();
try
{
Logger.Info("FFMpeg exited with code {0}", process.ExitCode);
}
catch
{
Logger.Error("FFMpeg exited with an error.");
}
// This causes on exited to be called twice:
//try
//{
// // Dispose the process
// process.Dispose();
//}
//catch (Exception ex)
//{
// Logger.ErrorException("Error disposing ffmpeg.", ex);
//}
}
示例2: OnFfMpegProcessExited
/// <summary>
/// Processes the exited.
/// </summary>
/// <param name="process">The process.</param>
/// <param name="state">The state.</param>
protected void OnFfMpegProcessExited(Process process, StreamState state)
{
state.Dispose();
var outputFilePath = GetOutputFilePath(state);
try
{
Logger.Info("FFMpeg exited with code {0} for {1}", process.ExitCode, outputFilePath);
}
catch
{
Logger.Info("FFMpeg exited with an error for {0}", outputFilePath);
}
}