From e5d026c4835408e9413daff3eadc208b1417d099 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Mon, 30 Sep 2013 14:49:19 -0400 Subject: [PATCH] fixes #528 - Support podcasts in web client --- MediaBrowser.Api/Playback/BaseStreamingService.cs | 11 +++++++---- MediaBrowser.Api/Playback/Progressive/AudioService.cs | 4 +--- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/MediaBrowser.Api/Playback/BaseStreamingService.cs b/MediaBrowser.Api/Playback/BaseStreamingService.cs index b002d556b..79a5a2846 100644 --- a/MediaBrowser.Api/Playback/BaseStreamingService.cs +++ b/MediaBrowser.Api/Playback/BaseStreamingService.cs @@ -470,12 +470,15 @@ namespace MediaBrowser.Api.Playback /// System.Nullable{System.Int32}. protected int? GetNumAudioChannelsParam(StreamRequest request, MediaStream audioStream) { - if (audioStream.Channels > 2 && request.AudioCodec.HasValue) + if (audioStream != null) { - if (request.AudioCodec.Value == AudioCodecs.Wma) + if (audioStream.Channels > 2 && request.AudioCodec.HasValue) { - // wmav2 currently only supports two channel output - return 2; + if (request.AudioCodec.Value == AudioCodecs.Wma) + { + // wmav2 currently only supports two channel output + return 2; + } } } diff --git a/MediaBrowser.Api/Playback/Progressive/AudioService.cs b/MediaBrowser.Api/Playback/Progressive/AudioService.cs index 915ec0c10..416505575 100644 --- a/MediaBrowser.Api/Playback/Progressive/AudioService.cs +++ b/MediaBrowser.Api/Playback/Progressive/AudioService.cs @@ -6,9 +6,7 @@ using MediaBrowser.Controller.Library; using MediaBrowser.Controller.Persistence; using MediaBrowser.Model.IO; using ServiceStack.ServiceHost; -using System; using System.Collections.Generic; -using System.IO; namespace MediaBrowser.Api.Playback.Progressive { @@ -94,7 +92,7 @@ namespace MediaBrowser.Api.Playback.Progressive { audioTranscodeParams.Add("-ac " + channels.Value); } - + if (request.AudioSampleRate.HasValue) { audioTranscodeParams.Add("-ar " + request.AudioSampleRate.Value);