Merge pull request #2501 from MediaBrowser/dev

Dev
This commit is contained in:
Luke 2017-03-01 15:30:52 -05:00 committed by GitHub
commit 70cad82ce6
7 changed files with 42 additions and 85 deletions

View File

@ -163,8 +163,7 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV
var durationParam = " -t " + _mediaEncoder.GetTimeParameter(duration.Ticks); var durationParam = " -t " + _mediaEncoder.GetTimeParameter(duration.Ticks);
var inputModifiers = "-fflags +genpts -async 1 -vsync -1"; var inputModifiers = "-fflags +genpts -async 1 -vsync -1";
var mapArgs = "-map 0 -ignore_unknown"; var commandLineArgs = "-i \"{0}\"{5} {2} -map_metadata -1 -threads 0 {3}{4} -y \"{1}\"";
var commandLineArgs = "-i \"{0}\"{5} " + mapArgs + " {2} -map_metadata -1 -threads 0 {3}{4} -y \"{1}\"";
long startTimeTicks = 0; long startTimeTicks = 0;
//if (mediaSource.DateLiveStreamOpened.HasValue) //if (mediaSource.DateLiveStreamOpened.HasValue)
@ -207,7 +206,7 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV
// do not copy aac because many players have difficulty with aac_latm // do not copy aac because many players have difficulty with aac_latm
if (_liveTvOptions.EnableOriginalAudioWithEncodedRecordings && !string.Equals(inputAudioCodec, "aac", StringComparison.OrdinalIgnoreCase)) if (_liveTvOptions.EnableOriginalAudioWithEncodedRecordings && !string.Equals(inputAudioCodec, "aac", StringComparison.OrdinalIgnoreCase))
{ {
return "-codec:a copy"; return "-codec:a:0 copy";
} }
var audioChannels = 2; var audioChannels = 2;
@ -216,7 +215,7 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV
{ {
audioChannels = audioStream.Channels ?? audioChannels; audioChannels = audioStream.Channels ?? audioChannels;
} }
return "-codec:a aac -strict experimental -ab 320000"; return "-codec:a:0 aac -strict experimental -ab 320000";
} }
private bool EncodeVideo(MediaSourceInfo mediaSource) private bool EncodeVideo(MediaSourceInfo mediaSource)

View File

@ -282,6 +282,12 @@ namespace Emby.Server.Implementations.LiveTv.Listings
var showId = programInfo.programID ?? string.Empty; var showId = programInfo.programID ?? string.Empty;
if (!info.IsSeries)
{
// It's also a series if it starts with SH
info.IsSeries = showId.StartsWith("SH", StringComparison.OrdinalIgnoreCase) && showId.Length >= 14;
}
// According to SchedulesDirect, these are generic, unidentified episodes // According to SchedulesDirect, these are generic, unidentified episodes
// SH005316560000 // SH005316560000
var hasUniqueShowId = !showId.StartsWith("SH", StringComparison.OrdinalIgnoreCase) || var hasUniqueShowId = !showId.StartsWith("SH", StringComparison.OrdinalIgnoreCase) ||
@ -331,7 +337,11 @@ namespace Emby.Server.Implementations.LiveTv.Listings
{ {
var gracenote = details.metadata.Find(x => x.Gracenote != null).Gracenote; var gracenote = details.metadata.Find(x => x.Gracenote != null).Gracenote;
info.SeasonNumber = gracenote.season; info.SeasonNumber = gracenote.season;
info.EpisodeNumber = gracenote.episode;
if (gracenote.episode > 0)
{
info.EpisodeNumber = gracenote.episode;
}
} }
} }

View File

@ -93,7 +93,7 @@ namespace MediaBrowser.Controller.LiveTv
if (double.TryParse(Number, NumberStyles.Any, CultureInfo.InvariantCulture, out number)) if (double.TryParse(Number, NumberStyles.Any, CultureInfo.InvariantCulture, out number))
{ {
return number.ToString("00000-") + (Name ?? string.Empty); return (number * 10).ToString("00000-") + (Name ?? string.Empty);
} }
} }

View File

@ -154,10 +154,6 @@ namespace MediaBrowser.Controller.MediaEncoding
{ {
return "mpegts"; return "mpegts";
} }
if (string.Equals(container, "mpg", StringComparison.OrdinalIgnoreCase))
{
return "mpeg";
}
// For these need to find out the ffmpeg names // For these need to find out the ffmpeg names
if (string.Equals(container, "m2ts", StringComparison.OrdinalIgnoreCase)) if (string.Equals(container, "m2ts", StringComparison.OrdinalIgnoreCase))
{ {
@ -171,12 +167,21 @@ namespace MediaBrowser.Controller.MediaEncoding
{ {
return null; return null;
} }
if (string.Equals(container, "mpg", StringComparison.OrdinalIgnoreCase))
{
return null;
}
if (string.Equals(container, "mpeg", StringComparison.OrdinalIgnoreCase))
{
return null;
}
return container; return container;
} }
public string GetDecoderFromCodec(string codec) public string GetDecoderFromCodec(string codec)
{ {
// For these need to find out the ffmpeg names
if (string.Equals(codec, "mp2", StringComparison.OrdinalIgnoreCase)) if (string.Equals(codec, "mp2", StringComparison.OrdinalIgnoreCase))
{ {
return null; return null;
@ -185,6 +190,10 @@ namespace MediaBrowser.Controller.MediaEncoding
{ {
return null; return null;
} }
if (string.Equals(codec, "eac3", StringComparison.OrdinalIgnoreCase))
{
return null;
}
return codec; return codec;
} }
@ -1494,7 +1503,7 @@ namespace MediaBrowser.Controller.MediaEncoding
//inputModifier += " -noaccurate_seek"; //inputModifier += " -noaccurate_seek";
} }
if (!string.IsNullOrWhiteSpace(state.InputContainer) && state.VideoType == VideoType.VideoFile) if (!string.IsNullOrWhiteSpace(state.InputContainer) && state.VideoType == VideoType.VideoFile && string.IsNullOrWhiteSpace(encodingOptions.HardwareAccelerationType))
{ {
var inputFormat = GetInputFormat(state.InputContainer); var inputFormat = GetInputFormat(state.InputContainer);
if (!string.IsNullOrWhiteSpace(inputFormat)) if (!string.IsNullOrWhiteSpace(inputFormat))
@ -1504,7 +1513,7 @@ namespace MediaBrowser.Controller.MediaEncoding
} }
// Only do this for video files due to sometimes unpredictable codec names coming from BDInfo // Only do this for video files due to sometimes unpredictable codec names coming from BDInfo
if (state.RunTimeTicks.HasValue && string.IsNullOrWhiteSpace(encodingOptions.HardwareAccelerationType) && state.VideoType == VideoType.VideoFile) if (state.RunTimeTicks.HasValue && state.VideoType == VideoType.VideoFile && string.IsNullOrWhiteSpace(encodingOptions.HardwareAccelerationType))
{ {
foreach (var stream in state.MediaSource.MediaStreams) foreach (var stream in state.MediaSource.MediaStreams)
{ {

View File

@ -734,6 +734,16 @@ namespace MediaBrowser.MediaEncoding.Subtitles
} }
} }
var charsetFromLanguage = string.IsNullOrWhiteSpace(language)
? null
: GetSubtitleFileCharacterSetFromLanguage(language);
// This assumption should only be made for external subtitles
if (!string.IsNullOrWhiteSpace(charsetFromLanguage) && !string.Equals(charsetFromLanguage, "windows-1252", StringComparison.OrdinalIgnoreCase))
{
return charsetFromLanguage;
}
var charset = await DetectCharset(path, language, protocol, cancellationToken).ConfigureAwait(false); var charset = await DetectCharset(path, language, protocol, cancellationToken).ConfigureAwait(false);
if (!string.IsNullOrWhiteSpace(charset)) if (!string.IsNullOrWhiteSpace(charset))
@ -746,12 +756,7 @@ namespace MediaBrowser.MediaEncoding.Subtitles
return charset; return charset;
} }
if (!string.IsNullOrWhiteSpace(language)) return charsetFromLanguage;
{
return GetSubtitleFileCharacterSetFromLanguage(language);
}
return null;
} }
public string GetSubtitleFileCharacterSetFromLanguage(string language) public string GetSubtitleFileCharacterSetFromLanguage(string language)

View File

@ -827,72 +827,6 @@ namespace MediaBrowser.Model.Dto
get { return StringHelper.EqualsIgnoreCase(MediaType, Entities.MediaType.Video); } get { return StringHelper.EqualsIgnoreCase(MediaType, Entities.MediaType.Video); }
} }
/// <summary>
/// Gets a value indicating whether this instance is audio.
/// </summary>
/// <value><c>true</c> if this instance is audio; otherwise, <c>false</c>.</value>
[IgnoreDataMember]
public bool IsAudio
{
get { return StringHelper.EqualsIgnoreCase(MediaType, Entities.MediaType.Audio); }
}
/// <summary>
/// Gets a value indicating whether this instance is game.
/// </summary>
/// <value><c>true</c> if this instance is game; otherwise, <c>false</c>.</value>
[IgnoreDataMember]
public bool IsGame
{
get { return StringHelper.EqualsIgnoreCase(MediaType, Entities.MediaType.Game); }
}
/// <summary>
/// Gets a value indicating whether this instance is person.
/// </summary>
/// <value><c>true</c> if this instance is person; otherwise, <c>false</c>.</value>
[IgnoreDataMember]
public bool IsPerson
{
get { return StringHelper.EqualsIgnoreCase(Type, "Person"); }
}
[IgnoreDataMember]
public bool IsMusicGenre
{
get { return StringHelper.EqualsIgnoreCase(Type, "MusicGenre"); }
}
[IgnoreDataMember]
public bool IsGameGenre
{
get { return StringHelper.EqualsIgnoreCase(Type, "GameGenre"); }
}
[IgnoreDataMember]
public bool IsGenre
{
get { return StringHelper.EqualsIgnoreCase(Type, "Genre"); }
}
[IgnoreDataMember]
public bool IsArtist
{
get { return StringHelper.EqualsIgnoreCase(Type, "MusicArtist"); }
}
[IgnoreDataMember]
public bool IsAlbum
{
get { return StringHelper.EqualsIgnoreCase(Type, "MusicAlbum"); }
}
[IgnoreDataMember]
public bool IsStudio
{
get { return StringHelper.EqualsIgnoreCase(Type, "Studio"); }
}
/// <summary> /// <summary>
/// Gets or sets the program identifier. /// Gets or sets the program identifier.
/// </summary> /// </summary>

View File

@ -1,3 +1,3 @@
using System.Reflection; using System.Reflection;
[assembly: AssemblyVersion("3.2.5.1")] [assembly: AssemblyVersion("3.2.5.2")]