fix video stream without extension in url

This commit is contained in:
Luke Pulverenti 2014-04-27 14:09:16 -04:00
parent 9a27cbab8c
commit f476944d91
4 changed files with 22 additions and 12 deletions

View File

@ -4,6 +4,7 @@ using MediaBrowser.Controller.Configuration;
using MediaBrowser.Controller.Dlna;
using MediaBrowser.Controller.Dto;
using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Entities.Audio;
using MediaBrowser.Controller.Library;
using MediaBrowser.Controller.LiveTv;
using MediaBrowser.Controller.MediaEncoding;
@ -1089,15 +1090,13 @@ namespace MediaBrowser.Api.Playback
{
state.Dispose();
var outputFilePath = GetOutputFilePath(state);
try
{
Logger.Info("FFMpeg exited with code {0} for {1}", process.ExitCode, outputFilePath);
Logger.Info("FFMpeg exited with code {0}", process.ExitCode);
}
catch
{
Logger.Info("FFMpeg exited with an error for {0}", outputFilePath);
Logger.Info("FFMpeg exited with an error.");
}
}
@ -1388,6 +1387,7 @@ namespace MediaBrowser.Api.Playback
state.DeInterlace = true;
state.InputVideoSync = "-1";
state.InputAudioSync = "1";
state.InputContainer = recording.Container;
}
else if (item is LiveTvChannel)
{
@ -1439,6 +1439,14 @@ namespace MediaBrowser.Api.Playback
state.DeInterlace = string.Equals(video.Container, "wtv", StringComparison.OrdinalIgnoreCase);
state.InputTimestamp = video.Timestamp ?? TransportStreamTimestamp.None;
state.InputContainer = video.Container;
}
var audio = item as Audio;
if (audio != null)
{
state.InputContainer = audio.Container;
}
state.RunTimeTicks = item.RunTimeTicks;
@ -1484,14 +1492,13 @@ namespace MediaBrowser.Api.Playback
if (string.IsNullOrEmpty(container))
{
container = Path.GetExtension(GetOutputFilePath(state));
container = request.Static ? state.InputContainer : Path.GetExtension(GetOutputFilePath(state));
}
state.OutputContainer = (container ?? string.Empty).TrimStart('.');
ApplyDeviceProfileSettings(state);
state.OutputContainer = GetOutputFileExtension(state).TrimStart('.');
state.OutputAudioBitrate = GetAudioBitrateParam(state.Request, state.AudioStream);
state.OutputAudioSampleRate = request.AudioSampleRate;
state.OutputAudioChannels = GetNumAudioChannelsParam(state.Request, state.AudioStream);
@ -1519,8 +1526,8 @@ namespace MediaBrowser.Api.Playback
state.DeviceProfile = string.IsNullOrWhiteSpace(state.Request.DeviceProfileId) ?
DlnaManager.GetProfile(headers) :
DlnaManager.GetProfile(state.Request.DeviceProfileId);
DlnaManager.GetProfile(state.Request.DeviceProfileId);
return state;
}
@ -1670,8 +1677,8 @@ namespace MediaBrowser.Api.Playback
var mediaProfile = state.VideoRequest == null ?
profile.GetAudioMediaProfile(state.OutputContainer, audioCodec, state.OutputAudioChannels, state.OutputAudioBitrate) :
profile.GetVideoMediaProfile(state.OutputContainer,
audioCodec,
profile.GetVideoMediaProfile(state.OutputContainer,
audioCodec,
videoCodec,
state.OutputAudioBitrate,
state.OutputAudioChannels,

View File

@ -34,6 +34,8 @@ namespace MediaBrowser.Api.Playback
/// <value>The log file stream.</value>
public Stream LogFileStream { get; set; }
public string InputContainer { get; set; }
public MediaStream AudioStream { get; set; }
public MediaStream VideoStream { get; set; }
public MediaStream SubtitleStream { get; set; }

View File

@ -2,8 +2,8 @@
using MediaBrowser.Controller.Persistence;
using MediaBrowser.Controller.Providers;
using MediaBrowser.Controller.Resolvers;
using MediaBrowser.Model.Dlna;
using MediaBrowser.Model.Entities;
using MediaBrowser.Model.MediaInfo;
using System;
using System.Collections;
using System.Collections.Generic;
@ -12,7 +12,6 @@ using System.Linq;
using System.Runtime.Serialization;
using System.Threading;
using System.Threading.Tasks;
using MediaBrowser.Model.MediaInfo;
namespace MediaBrowser.Controller.Entities
{

View File

@ -12,6 +12,8 @@ namespace MediaBrowser.Controller.LiveTv
string MediaType { get; }
string Container { get; }
RecordingInfo RecordingInfo { get; set; }
long? RunTimeTicks { get; set; }