Added some intelligence to the video handler. try to just copy the audio stream when possible, instead of encoding.

This commit is contained in:
LukePulverenti Luke Pulverenti luke pulverenti
2012-08-13 16:18:02 -04:00
parent 0a310fab0e
commit 5f5f2fcdb4
3 changed files with 90 additions and 69 deletions

View File

@@ -212,5 +212,41 @@ namespace MediaBrowser.Api.HttpHandlers
process.Dispose();
}
}
/// <summary>
/// Gets the number of audio channels to specify on the command line
/// </summary>
protected int? GetNumAudioChannelsParam(int libraryItemChannels)
{
// If the user requested a max number of channels
if (AudioChannels.HasValue)
{
// Only specify the param if we're going to downmix
if (AudioChannels.Value < libraryItemChannels)
{
return AudioChannels.Value;
}
}
return null;
}
/// <summary>
/// Gets the number of audio channels to specify on the command line
/// </summary>
protected int? GetSampleRateParam(int libraryItemSampleRate)
{
// If the user requested a max value
if (AudioSampleRate.HasValue)
{
// Only specify the param if we're going to downmix
if (AudioSampleRate.Value < libraryItemSampleRate)
{
return AudioSampleRate.Value;
}
}
return null;
}
}
}