aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Api/HttpHandlers/AudioHandler.cs
diff options
context:
space:
mode:
Diffstat (limited to 'MediaBrowser.Api/HttpHandlers/AudioHandler.cs')
-rw-r--r--MediaBrowser.Api/HttpHandlers/AudioHandler.cs40
1 files changed, 2 insertions, 38 deletions
diff --git a/MediaBrowser.Api/HttpHandlers/AudioHandler.cs b/MediaBrowser.Api/HttpHandlers/AudioHandler.cs
index c7adc9a58..f0d86ab37 100644
--- a/MediaBrowser.Api/HttpHandlers/AudioHandler.cs
+++ b/MediaBrowser.Api/HttpHandlers/AudioHandler.cs
@@ -113,14 +113,14 @@ namespace MediaBrowser.Api.HttpHandlers
audioTranscodeParams.Add("-ab " + bitrate.Value);
}
- int? channels = GetNumAudioChannelsParam();
+ int? channels = GetNumAudioChannelsParam(LibraryItem.Channels);
if (channels.HasValue)
{
audioTranscodeParams.Add("-ac " + channels.Value);
}
- int? sampleRate = GetSampleRateParam();
+ int? sampleRate = GetSampleRateParam(LibraryItem.SampleRate);
if (sampleRate.HasValue)
{
@@ -131,41 +131,5 @@ namespace MediaBrowser.Api.HttpHandlers
return "-i \"" + LibraryItem.Path + "\" -vn " + string.Join(" ", audioTranscodeParams.ToArray()) + " -";
}
-
- /// <summary>
- /// Gets the number of audio channels to specify on the command line
- /// </summary>
- private int? GetNumAudioChannelsParam()
- {
- // 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 < LibraryItem.Channels)
- {
- return AudioChannels.Value;
- }
- }
-
- return null;
- }
-
- /// <summary>
- /// Gets the number of audio channels to specify on the command line
- /// </summary>
- private int? GetSampleRateParam()
- {
- // If the user requested a max value
- if (AudioSampleRate.HasValue)
- {
- // Only specify the param if we're going to downmix
- if (AudioSampleRate.Value < LibraryItem.SampleRate)
- {
- return AudioSampleRate.Value;
- }
- }
-
- return null;
- }
}
}