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.Dlna;
using MediaBrowser.Controller.Dto; using MediaBrowser.Controller.Dto;
using MediaBrowser.Controller.Entities; using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Entities.Audio;
using MediaBrowser.Controller.Library; using MediaBrowser.Controller.Library;
using MediaBrowser.Controller.LiveTv; using MediaBrowser.Controller.LiveTv;
using MediaBrowser.Controller.MediaEncoding; using MediaBrowser.Controller.MediaEncoding;
@ -1089,15 +1090,13 @@ namespace MediaBrowser.Api.Playback
{ {
state.Dispose(); state.Dispose();
var outputFilePath = GetOutputFilePath(state);
try try
{ {
Logger.Info("FFMpeg exited with code {0} for {1}", process.ExitCode, outputFilePath); Logger.Info("FFMpeg exited with code {0}", process.ExitCode);
} }
catch 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.DeInterlace = true;
state.InputVideoSync = "-1"; state.InputVideoSync = "-1";
state.InputAudioSync = "1"; state.InputAudioSync = "1";
state.InputContainer = recording.Container;
} }
else if (item is LiveTvChannel) else if (item is LiveTvChannel)
{ {
@ -1439,6 +1439,14 @@ namespace MediaBrowser.Api.Playback
state.DeInterlace = string.Equals(video.Container, "wtv", StringComparison.OrdinalIgnoreCase); state.DeInterlace = string.Equals(video.Container, "wtv", StringComparison.OrdinalIgnoreCase);
state.InputTimestamp = video.Timestamp ?? TransportStreamTimestamp.None; 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; state.RunTimeTicks = item.RunTimeTicks;
@ -1484,14 +1492,13 @@ namespace MediaBrowser.Api.Playback
if (string.IsNullOrEmpty(container)) if (string.IsNullOrEmpty(container))
{ {
container = Path.GetExtension(GetOutputFilePath(state)); container = request.Static ? state.InputContainer : Path.GetExtension(GetOutputFilePath(state));
} }
state.OutputContainer = (container ?? string.Empty).TrimStart('.'); state.OutputContainer = (container ?? string.Empty).TrimStart('.');
ApplyDeviceProfileSettings(state); ApplyDeviceProfileSettings(state);
state.OutputContainer = GetOutputFileExtension(state).TrimStart('.');
state.OutputAudioBitrate = GetAudioBitrateParam(state.Request, state.AudioStream); state.OutputAudioBitrate = GetAudioBitrateParam(state.Request, state.AudioStream);
state.OutputAudioSampleRate = request.AudioSampleRate; state.OutputAudioSampleRate = request.AudioSampleRate;
state.OutputAudioChannels = GetNumAudioChannelsParam(state.Request, state.AudioStream); state.OutputAudioChannels = GetNumAudioChannelsParam(state.Request, state.AudioStream);

View File

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

View File

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

View File

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