fix stream copy requiring a bitrate

pull/702/head
Luke Pulverenti 11 years ago
parent c07596dbb4
commit b4984a78fd

@ -6,6 +6,7 @@ using MediaBrowser.Controller;
using MediaBrowser.Controller.Dto; using MediaBrowser.Controller.Dto;
using MediaBrowser.Controller.Entities; using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Library; using MediaBrowser.Controller.Library;
using MediaBrowser.Model.Dto;
using MediaBrowser.Model.IO; using MediaBrowser.Model.IO;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
@ -91,11 +92,11 @@ namespace MediaBrowser.Api.Playback.Hls
/// <returns>Task{System.Object}.</returns> /// <returns>Task{System.Object}.</returns>
public async Task<object> ProcessRequestAsync(StreamState state) public async Task<object> ProcessRequestAsync(StreamState state)
{ {
if (!state.VideoRequest.VideoBitRate.HasValue) if (!state.VideoRequest.VideoBitRate.HasValue && (!state.VideoRequest.VideoCodec.HasValue || state.VideoRequest.VideoCodec.Value != VideoCodecs.Copy))
{ {
throw new ArgumentException("A video bitrate is required"); throw new ArgumentException("A video bitrate is required");
} }
if (!state.Request.AudioBitRate.HasValue) if (!state.Request.AudioBitRate.HasValue && (!state.Request.AudioCodec.HasValue || state.Request.AudioCodec.Value != AudioCodecs.Copy))
{ {
throw new ArgumentException("An audio bitrate is required"); throw new ArgumentException("An audio bitrate is required");
} }

Loading…
Cancel
Save