update next/previous buttons

pull/702/head
Luke Pulverenti 11 years ago
parent e92688fbec
commit 3cc608d781

@ -307,7 +307,7 @@ namespace MediaBrowser.Api.Playback
if (videoCodec.Equals("libvpx", StringComparison.OrdinalIgnoreCase)) if (videoCodec.Equals("libvpx", StringComparison.OrdinalIgnoreCase))
{ {
// http://www.webmproject.org/docs/encoder-parameters/ // http://www.webmproject.org/docs/encoder-parameters/
return "-speed 16 -quality good -profile:v 0 -slices 8"; return "-speed 16 -quality good -profile:v 0 -slices 8 -crf 18";
} }
// asf/wmv // asf/wmv
@ -321,11 +321,11 @@ namespace MediaBrowser.Api.Playback
switch (GetQualitySetting()) switch (GetQualitySetting())
{ {
case EncodingQuality.HighSpeed: case EncodingQuality.HighSpeed:
return "-preset ultrafast"; return "-preset ultrafast -crf 18";
case EncodingQuality.HighQuality: case EncodingQuality.HighQuality:
return "-preset superfast"; return "-preset superfast -crf 18";
case EncodingQuality.MaxQuality: case EncodingQuality.MaxQuality:
return "-preset superfast"; return "-preset superfast -crf 18";
default: default:
throw new Exception("Unrecognized MediaEncodingQuality value."); throw new Exception("Unrecognized MediaEncodingQuality value.");
} }
@ -381,7 +381,7 @@ namespace MediaBrowser.Api.Playback
audioSampleRate, audioSampleRate,
volParam, volParam,
pts, pts,
state.AudioSync.ToString(UsCulture)); state.AudioSync);
} }
/// <summary> /// <summary>
@ -994,6 +994,26 @@ namespace MediaBrowser.Api.Playback
} }
} }
protected double? GetFramerateParam(StreamState state)
{
if (state.VideoRequest != null && state.VideoRequest.Framerate.HasValue)
{
return state.VideoRequest.Framerate.Value;
}
if (state.VideoStream != null)
{
var contentRate = state.VideoStream.AverageFrameRate ?? state.VideoStream.RealFrameRate;
if (contentRate.HasValue && contentRate.Value > 23.976)
{
return 23.976;
}
}
return null;
}
/// <summary> /// <summary>
/// Gets the state. /// Gets the state.
/// </summary> /// </summary>
@ -1068,7 +1088,7 @@ namespace MediaBrowser.Api.Playback
//state.RunTimeTicks = recording.RunTimeTicks; //state.RunTimeTicks = recording.RunTimeTicks;
state.ReadInputAtNativeFramerate = recording.RecordingInfo.Status == RecordingStatus.InProgress; state.ReadInputAtNativeFramerate = recording.RecordingInfo.Status == RecordingStatus.InProgress;
state.SendInputOverStandardInput = recording.RecordingInfo.Status == RecordingStatus.InProgress; state.SendInputOverStandardInput = recording.RecordingInfo.Status == RecordingStatus.InProgress;
state.AudioSync = 1000; state.AudioSync = "1000";
state.DeInterlace = true; state.DeInterlace = true;
} }
else if (item is LiveTvChannel) else if (item is LiveTvChannel)
@ -1096,7 +1116,7 @@ namespace MediaBrowser.Api.Playback
state.SendInputOverStandardInput = true; state.SendInputOverStandardInput = true;
state.ReadInputAtNativeFramerate = true; state.ReadInputAtNativeFramerate = true;
state.AudioSync = 1000; state.AudioSync = "1000";
state.DeInterlace = true; state.DeInterlace = true;
} }
else else

@ -317,12 +317,16 @@ namespace MediaBrowser.Api.Playback.Hls
} }
} }
if (state.VideoRequest.Framerate.HasValue) var framerate = GetFramerateParam(state);
if (framerate.HasValue)
{ {
args += string.Format(" -r {0}", state.VideoRequest.Framerate.Value); args += string.Format(" -r {0}", framerate.Value.ToString(UsCulture));
} }
args += " -vsync vfr"; if (!string.IsNullOrEmpty(state.VideoSync))
{
args += " -vsync " + state.VideoSync;
}
if (!string.IsNullOrEmpty(state.VideoRequest.Profile)) if (!string.IsNullOrEmpty(state.VideoRequest.Profile))
{ {

@ -194,12 +194,16 @@ namespace MediaBrowser.Api.Playback.Hls
} }
} }
if (state.VideoRequest.Framerate.HasValue) var framerate = GetFramerateParam(state);
if (framerate.HasValue)
{ {
args += string.Format(" -r {0}", state.VideoRequest.Framerate.Value); args += string.Format(" -r {0}", framerate.Value.ToString(UsCulture));
} }
args += " -vsync vfr"; if (!string.IsNullOrEmpty(state.VideoSync))
{
args += " -vsync " + state.VideoSync;
}
if (!string.IsNullOrEmpty(state.VideoRequest.Profile)) if (!string.IsNullOrEmpty(state.VideoRequest.Profile))
{ {

@ -156,9 +156,10 @@ namespace MediaBrowser.Api.Playback.Progressive
} }
} }
if (request.Framerate.HasValue) var framerate = GetFramerateParam(state);
if (framerate.HasValue)
{ {
args += string.Format(" -r {0}", request.Framerate.Value); args += string.Format(" -r {0}", framerate.Value.ToString(UsCulture));
} }
var qualityParam = GetVideoQualityParam(state, codec); var qualityParam = GetVideoQualityParam(state, codec);
@ -169,11 +170,13 @@ namespace MediaBrowser.Api.Playback.Progressive
{ {
if (string.Equals(codec, "libvpx", StringComparison.OrdinalIgnoreCase)) if (string.Equals(codec, "libvpx", StringComparison.OrdinalIgnoreCase))
{ {
qualityParam += string.Format(" -minrate:v ({0}*.90) -maxrate:v ({0}*1.10) -bufsize:v {0} -b:v {0}", bitrate.Value.ToString(UsCulture)); qualityParam += string.Format(" -b:v {0}", bitrate.Value.ToString(UsCulture));
} }
else else
{ {
qualityParam += string.Format(" -b:v {0}", bitrate.Value.ToString(UsCulture)); qualityParam += string.Format(" -maxrate {0} -bufsize {1}",
bitrate.Value.ToString(UsCulture),
(bitrate.Value * 2).ToString(UsCulture));
} }
} }
@ -182,7 +185,10 @@ namespace MediaBrowser.Api.Playback.Progressive
args += " " + qualityParam.Trim(); args += " " + qualityParam.Trim();
} }
args += " -vsync vfr"; if (!string.IsNullOrEmpty(state.VideoSync))
{
args += " -vsync " + state.VideoSync;
}
if (!string.IsNullOrEmpty(state.VideoRequest.Profile)) if (!string.IsNullOrEmpty(state.VideoRequest.Profile))
{ {

@ -59,7 +59,8 @@ namespace MediaBrowser.Api.Playback
public long? RunTimeTicks; public long? RunTimeTicks;
public int AudioSync = 1; public string AudioSync = "1";
public string VideoSync = "vfr";
public bool DeInterlace { get; set; } public bool DeInterlace { get; set; }

@ -541,11 +541,6 @@ namespace MediaBrowser.Controller.Entities
/// <value>The run time ticks.</value> /// <value>The run time ticks.</value>
public long? RunTimeTicks { get; set; } public long? RunTimeTicks { get; set; }
/// <summary>
/// Gets or sets the original run time ticks.
/// </summary>
/// <value>The original run time ticks.</value>
public long? OriginalRunTimeTicks { get; set; }
/// <summary> /// <summary>
/// Gets or sets the production year. /// Gets or sets the production year.
/// </summary> /// </summary>

@ -423,11 +423,7 @@ namespace MediaBrowser.Controller.Providers
if (int.TryParse(text.Split(' ')[0], NumberStyles.Integer, _usCulture, out runtime)) if (int.TryParse(text.Split(' ')[0], NumberStyles.Integer, _usCulture, out runtime))
{ {
// For audio and video don't replace ffmpeg data // For audio and video don't replace ffmpeg data
if (item is Video || item is Audio) if (!(item is Video || item is Audio))
{
item.OriginalRunTimeTicks = TimeSpan.FromMinutes(runtime).Ticks;
}
else
{ {
item.RunTimeTicks = TimeSpan.FromMinutes(runtime).Ticks; item.RunTimeTicks = TimeSpan.FromMinutes(runtime).Ticks;
} }

@ -144,6 +144,12 @@ namespace MediaBrowser.Model.LiveTv
/// <value>The channel identifier.</value> /// <value>The channel identifier.</value>
public string ChannelId { get; set; } public string ChannelId { get; set; }
/// <summary>
/// Gets or sets the name of the channel.
/// </summary>
/// <value>The name of the channel.</value>
public string ChannelName { get; set; }
/// <summary> /// <summary>
/// Gets or sets the recording identifier. /// Gets or sets the recording identifier.
/// </summary> /// </summary>

@ -796,9 +796,6 @@ namespace MediaBrowser.Providers.Movies
boxset.OfficialRating = firstChild != null ? firstChild.OfficialRating : null; boxset.OfficialRating = firstChild != null ? firstChild.OfficialRating : null;
} }
if (movieData.runtime > 0)
movie.OriginalRunTimeTicks = TimeSpan.FromMinutes(movieData.runtime).Ticks;
//studios //studios
if (movieData.production_companies != null && !movie.LockedFields.Contains(MetadataFields.Studios)) if (movieData.production_companies != null && !movie.LockedFields.Contains(MetadataFields.Studios))
{ {

@ -649,11 +649,6 @@ namespace MediaBrowser.Server.Implementations.Dto
dto.DateCreated = item.DateCreated; dto.DateCreated = item.DateCreated;
} }
if (fields.Contains(ItemFields.OriginalRunTimeTicks))
{
dto.OriginalRunTimeTicks = item.OriginalRunTimeTicks;
}
dto.DisplayMediaType = item.DisplayMediaType; dto.DisplayMediaType = item.DisplayMediaType;
if (fields.Contains(ItemFields.Settings)) if (fields.Contains(ItemFields.Settings))

@ -271,7 +271,7 @@ namespace MediaBrowser.Server.Implementations.LiveTv
return dto; return dto;
} }
public LiveTvTunerInfoDto GetTunerInfoDto(string serviceName, LiveTvTunerInfo info) public LiveTvTunerInfoDto GetTunerInfoDto(string serviceName, LiveTvTunerInfo info, string channelName)
{ {
var dto = new LiveTvTunerInfoDto var dto = new LiveTvTunerInfoDto
{ {
@ -280,7 +280,8 @@ namespace MediaBrowser.Server.Implementations.LiveTv
Clients = info.Clients, Clients = info.Clients,
ProgramName = info.ProgramName, ProgramName = info.ProgramName,
SourceType = info.SourceType, SourceType = info.SourceType,
Status = info.Status Status = info.Status,
ChannelName = channelName
}; };
if (!string.IsNullOrEmpty(info.ChannelId)) if (!string.IsNullOrEmpty(info.ChannelId))

@ -1435,7 +1435,20 @@ namespace MediaBrowser.Server.Implementations.LiveTv
info.HasUpdateAvailable = statusInfo.HasUpdateAvailable; info.HasUpdateAvailable = statusInfo.HasUpdateAvailable;
info.HomePageUrl = service.HomePageUrl; info.HomePageUrl = service.HomePageUrl;
info.Tuners = statusInfo.Tuners.Select(i => _tvDtoService.GetTunerInfoDto(service.Name, i)).ToList(); info.Tuners = statusInfo.Tuners.Select(i =>
{
string channelName = null;
if (!string.IsNullOrEmpty(i.ChannelId))
{
var internalChannelId = _tvDtoService.GetInternalChannelId(service.Name, i.ChannelId);
var channel = GetInternalChannel(internalChannelId);
channelName = channel == null ? null : channel.Name;
}
return _tvDtoService.GetTunerInfoDto(service.Name, i, channelName);
}).ToList();
} }
catch (Exception ex) catch (Exception ex)
{ {

@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd"> <package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
<metadata> <metadata>
<id>MediaBrowser.Common.Internal</id> <id>MediaBrowser.Common.Internal</id>
<version>3.0.308</version> <version>3.0.309</version>
<title>MediaBrowser.Common.Internal</title> <title>MediaBrowser.Common.Internal</title>
<authors>Luke</authors> <authors>Luke</authors>
<owners>ebr,Luke,scottisafool</owners> <owners>ebr,Luke,scottisafool</owners>
@ -12,7 +12,7 @@
<description>Contains common components shared by Media Browser Theater and Media Browser Server. Not intended for plugin developer consumption.</description> <description>Contains common components shared by Media Browser Theater and Media Browser Server. Not intended for plugin developer consumption.</description>
<copyright>Copyright © Media Browser 2013</copyright> <copyright>Copyright © Media Browser 2013</copyright>
<dependencies> <dependencies>
<dependency id="MediaBrowser.Common" version="3.0.308" /> <dependency id="MediaBrowser.Common" version="3.0.309" />
<dependency id="NLog" version="2.1.0" /> <dependency id="NLog" version="2.1.0" />
<dependency id="SimpleInjector" version="2.4.0" /> <dependency id="SimpleInjector" version="2.4.0" />
<dependency id="sharpcompress" version="0.10.2" /> <dependency id="sharpcompress" version="0.10.2" />

@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd"> <package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
<metadata> <metadata>
<id>MediaBrowser.Common</id> <id>MediaBrowser.Common</id>
<version>3.0.308</version> <version>3.0.309</version>
<title>MediaBrowser.Common</title> <title>MediaBrowser.Common</title>
<authors>Media Browser Team</authors> <authors>Media Browser Team</authors>
<owners>ebr,Luke,scottisafool</owners> <owners>ebr,Luke,scottisafool</owners>

@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd"> <package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata> <metadata>
<id>MediaBrowser.Server.Core</id> <id>MediaBrowser.Server.Core</id>
<version>3.0.308</version> <version>3.0.309</version>
<title>Media Browser.Server.Core</title> <title>Media Browser.Server.Core</title>
<authors>Media Browser Team</authors> <authors>Media Browser Team</authors>
<owners>ebr,Luke,scottisafool</owners> <owners>ebr,Luke,scottisafool</owners>
@ -12,7 +12,7 @@
<description>Contains core components required to build plugins for Media Browser Server.</description> <description>Contains core components required to build plugins for Media Browser Server.</description>
<copyright>Copyright © Media Browser 2013</copyright> <copyright>Copyright © Media Browser 2013</copyright>
<dependencies> <dependencies>
<dependency id="MediaBrowser.Common" version="3.0.308" /> <dependency id="MediaBrowser.Common" version="3.0.309" />
</dependencies> </dependencies>
</metadata> </metadata>
<files> <files>

Loading…
Cancel
Save