fix stream copy requiring a bitrate

This commit is contained in:
Luke Pulverenti 2013-09-28 14:07:01 -04:00
parent c07596dbb4
commit b4984a78fd

View file

@ -6,6 +6,7 @@ using MediaBrowser.Controller;
using MediaBrowser.Controller.Dto;
using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Library;
using MediaBrowser.Model.Dto;
using MediaBrowser.Model.IO;
using System;
using System.Collections.Generic;
@ -91,11 +92,11 @@ namespace MediaBrowser.Api.Playback.Hls
/// <returns>Task{System.Object}.</returns>
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");
}
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");
}