update translations

This commit is contained in:
Luke Pulverenti
2014-06-23 12:05:19 -04:00
parent eba1845f2a
commit 0727475abf
105 changed files with 1699 additions and 640 deletions

View File

@@ -15,7 +15,7 @@ namespace MediaBrowser.Model.Dlna
int? videoBitrate,
string videoProfile,
double? videoLevel,
double? videoFramerate,
float? videoFramerate,
int? packetLength,
TransportStreamTimestamp? timestamp,
bool? isAnamorphic)

View File

@@ -106,7 +106,7 @@ namespace MediaBrowser.Model.Dlna
long? runtimeTicks,
string videoProfile,
double? videoLevel,
double? videoFramerate,
float? videoFramerate,
int? packetLength,
TranscodeSeekInfo transcodeSeekInfo,
bool? isAnamorphic)

View File

@@ -1,8 +1,6 @@
using MediaBrowser.Model.Extensions;
using MediaBrowser.Model.MediaInfo;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Xml.Serialization;
namespace MediaBrowser.Model.Dlna
@@ -157,12 +155,12 @@ namespace MediaBrowser.Model.Dlna
continue;
}
if (!i.GetAudioCodecs().Contains(audioCodec ?? string.Empty))
if (!ListHelper.ContainsIgnoreCase(i.GetAudioCodecs(), audioCodec ?? string.Empty))
{
continue;
}
if (!StringHelper.EqualsIgnoreCase(videoCodec, i.VideoCodec))
if (!StringHelper.EqualsIgnoreCase(videoCodec, i.VideoCodec ?? string.Empty))
{
continue;
}
@@ -190,7 +188,7 @@ namespace MediaBrowser.Model.Dlna
}
List<string> audioCodecs = i.GetAudioCodecs();
if (audioCodecs.Count > 0 && !ListHelper.ContainsIgnoreCase(audioCodecs, audioCodec))
if (audioCodecs.Count > 0 && !ListHelper.ContainsIgnoreCase(audioCodecs, audioCodec ?? string.Empty))
{
continue;
}
@@ -267,7 +265,7 @@ namespace MediaBrowser.Model.Dlna
int? videoBitrate,
string videoProfile,
double? videoLevel,
double? videoFramerate,
float? videoFramerate,
int? packetLength,
TransportStreamTimestamp timestamp,
bool? isAnamorphic)
@@ -282,19 +280,19 @@ namespace MediaBrowser.Model.Dlna
}
List<string> containers = i.GetContainers();
if (containers.Count > 0 && !ListHelper.ContainsIgnoreCase(containers, container))
if (containers.Count > 0 && !ListHelper.ContainsIgnoreCase(containers, container ?? string.Empty))
{
continue;
}
List<string> audioCodecs = i.GetAudioCodecs();
if (audioCodecs.Count > 0 && !ListHelper.ContainsIgnoreCase(audioCodecs, audioCodec))
if (audioCodecs.Count > 0 && !ListHelper.ContainsIgnoreCase(audioCodecs, audioCodec ?? string.Empty))
{
continue;
}
List<string> videoCodecs = i.GetVideoCodecs();
if (videoCodecs.Count > 0 && !ListHelper.ContainsIgnoreCase(videoCodecs, videoCodec))
if (videoCodecs.Count > 0 && !ListHelper.ContainsIgnoreCase(videoCodecs, videoCodec ?? string.Empty))
{
continue;
}

View File

@@ -7,7 +7,7 @@ namespace MediaBrowser.Model.Dlna
{
public class MediaFormatProfileResolver
{
public IEnumerable<MediaFormatProfile> ResolveVideoFormat(string container, string videoCodec, string audioCodec, int? width, int? height, TransportStreamTimestamp timestampType)
public List<MediaFormatProfile> ResolveVideoFormat(string container, string videoCodec, string audioCodec, int? width, int? height, TransportStreamTimestamp timestampType)
{
if (StringHelper.EqualsIgnoreCase(container, "asf"))
{
@@ -22,18 +22,18 @@ namespace MediaBrowser.Model.Dlna
}
if (StringHelper.EqualsIgnoreCase(container, "avi"))
return new[] { MediaFormatProfile.AVI };
return new List<MediaFormatProfile> { MediaFormatProfile.AVI };
if (StringHelper.EqualsIgnoreCase(container, "mkv"))
return new[] { MediaFormatProfile.MATROSKA };
return new List<MediaFormatProfile> { MediaFormatProfile.MATROSKA };
if (StringHelper.EqualsIgnoreCase(container, "mpeg2ps") ||
StringHelper.EqualsIgnoreCase(container, "ts"))
return new[] { MediaFormatProfile.MPEG_PS_NTSC, MediaFormatProfile.MPEG_PS_PAL };
return new List<MediaFormatProfile> { MediaFormatProfile.MPEG_PS_NTSC, MediaFormatProfile.MPEG_PS_PAL };
if (StringHelper.EqualsIgnoreCase(container, "mpeg1video"))
return new[] { MediaFormatProfile.MPEG1 };
return new List<MediaFormatProfile> { MediaFormatProfile.MPEG1 };
if (StringHelper.EqualsIgnoreCase(container, "mpeg2ts") ||
StringHelper.EqualsIgnoreCase(container, "mpegts") ||
@@ -44,10 +44,10 @@ namespace MediaBrowser.Model.Dlna
}
if (StringHelper.EqualsIgnoreCase(container, "flv"))
return new[] { MediaFormatProfile.FLV };
return new List<MediaFormatProfile> { MediaFormatProfile.FLV };
if (StringHelper.EqualsIgnoreCase(container, "wtv"))
return new[] { MediaFormatProfile.WTV };
return new List<MediaFormatProfile> { MediaFormatProfile.WTV };
if (StringHelper.EqualsIgnoreCase(container, "3gp"))
{
@@ -56,12 +56,12 @@ namespace MediaBrowser.Model.Dlna
}
if (StringHelper.EqualsIgnoreCase(container, "ogv") || StringHelper.EqualsIgnoreCase(container, "ogg"))
return new[] { MediaFormatProfile.OGV };
return new List<MediaFormatProfile> { MediaFormatProfile.OGV };
return new List<MediaFormatProfile>();
}
private IEnumerable<MediaFormatProfile> ResolveVideoMPEG2TSFormat(string videoCodec, string audioCodec, int? width, int? height, TransportStreamTimestamp timestampType)
private List<MediaFormatProfile> ResolveVideoMPEG2TSFormat(string videoCodec, string audioCodec, int? width, int? height, TransportStreamTimestamp timestampType)
{
string suffix = "";
@@ -98,36 +98,36 @@ namespace MediaBrowser.Model.Dlna
if (StringHelper.EqualsIgnoreCase(videoCodec, "h264"))
{
if (StringHelper.EqualsIgnoreCase(audioCodec, "lpcm"))
return new[] { MediaFormatProfile.AVC_TS_HD_50_LPCM_T };
return new List<MediaFormatProfile> { MediaFormatProfile.AVC_TS_HD_50_LPCM_T };
if (StringHelper.EqualsIgnoreCase(audioCodec, "dts"))
{
if (timestampType == TransportStreamTimestamp.None)
{
return new[] { MediaFormatProfile.AVC_TS_HD_DTS_ISO };
return new List<MediaFormatProfile> { MediaFormatProfile.AVC_TS_HD_DTS_ISO };
}
return new[] { MediaFormatProfile.AVC_TS_HD_DTS_T };
return new List<MediaFormatProfile> { MediaFormatProfile.AVC_TS_HD_DTS_T };
}
if (StringHelper.EqualsIgnoreCase(audioCodec, "mp3"))
{
if (timestampType == TransportStreamTimestamp.None)
{
return new[] { ValueOf(string.Format("AVC_TS_HP_{0}D_MPEG1_L2_ISO", resolution)) };
return new List<MediaFormatProfile> { ValueOf(string.Format("AVC_TS_HP_{0}D_MPEG1_L2_ISO", resolution)) };
}
return new[] { ValueOf(string.Format("AVC_TS_HP_{0}D_MPEG1_L2_T", resolution)) };
return new List<MediaFormatProfile> { ValueOf(string.Format("AVC_TS_HP_{0}D_MPEG1_L2_T", resolution)) };
}
if (StringHelper.EqualsIgnoreCase(audioCodec, "aac"))
return new[] { ValueOf(string.Format("AVC_TS_MP_{0}D_AAC_MULT5{1}", resolution, suffix)) };
return new List<MediaFormatProfile> { ValueOf(string.Format("AVC_TS_MP_{0}D_AAC_MULT5{1}", resolution, suffix)) };
if (StringHelper.EqualsIgnoreCase(audioCodec, "mp3"))
return new[] { ValueOf(string.Format("AVC_TS_MP_{0}D_MPEG1_L3{1}", resolution, suffix)) };
return new List<MediaFormatProfile> { ValueOf(string.Format("AVC_TS_MP_{0}D_MPEG1_L3{1}", resolution, suffix)) };
if (string.IsNullOrEmpty(audioCodec) ||
StringHelper.EqualsIgnoreCase(audioCodec, "ac3"))
return new[] { ValueOf(string.Format("AVC_TS_MP_{0}D_AC3{1}", resolution, suffix)) };
return new List<MediaFormatProfile> { ValueOf(string.Format("AVC_TS_MP_{0}D_AC3{1}", resolution, suffix)) };
}
else if (StringHelper.EqualsIgnoreCase(videoCodec, "vc1"))
{
@@ -135,28 +135,28 @@ namespace MediaBrowser.Model.Dlna
{
if ((width.HasValue && width.Value > 720) || (height.HasValue && height.Value > 576))
{
return new[] { MediaFormatProfile.VC1_TS_AP_L2_AC3_ISO };
return new List<MediaFormatProfile> { MediaFormatProfile.VC1_TS_AP_L2_AC3_ISO };
}
return new[] { MediaFormatProfile.VC1_TS_AP_L1_AC3_ISO };
return new List<MediaFormatProfile> { MediaFormatProfile.VC1_TS_AP_L1_AC3_ISO };
}
if (StringHelper.EqualsIgnoreCase(audioCodec, "dts"))
{
suffix = StringHelper.EqualsIgnoreCase(suffix, "_ISO") ? suffix : "_T";
return new[] { ValueOf(string.Format("VC1_TS_HD_DTS{0}", suffix)) };
return new List<MediaFormatProfile> { ValueOf(string.Format("VC1_TS_HD_DTS{0}", suffix)) };
}
}
else if (StringHelper.EqualsIgnoreCase(videoCodec, "mpeg4") || StringHelper.EqualsIgnoreCase(videoCodec, "msmpeg4"))
{
if (StringHelper.EqualsIgnoreCase(audioCodec, "aac"))
return new[] { ValueOf(string.Format("MPEG4_P2_TS_ASP_AAC{0}", suffix)) };
return new List<MediaFormatProfile> { ValueOf(string.Format("MPEG4_P2_TS_ASP_AAC{0}", suffix)) };
if (StringHelper.EqualsIgnoreCase(audioCodec, "mp3"))
return new[] { ValueOf(string.Format("MPEG4_P2_TS_ASP_MPEG1_L3{0}", suffix)) };
return new List<MediaFormatProfile> { ValueOf(string.Format("MPEG4_P2_TS_ASP_MPEG1_L3{0}", suffix)) };
if (StringHelper.EqualsIgnoreCase(audioCodec, "mp2"))
return new[] { ValueOf(string.Format("MPEG4_P2_TS_ASP_MPEG2_L2{0}", suffix)) };
return new List<MediaFormatProfile> { ValueOf(string.Format("MPEG4_P2_TS_ASP_MPEG2_L2{0}", suffix)) };
if (StringHelper.EqualsIgnoreCase(audioCodec, "ac3"))
return new[] { ValueOf(string.Format("MPEG4_P2_TS_ASP_AC3{0}", suffix)) };
return new List<MediaFormatProfile> { ValueOf(string.Format("MPEG4_P2_TS_ASP_AC3{0}", suffix)) };
}
return new List<MediaFormatProfile>();

View File

@@ -323,6 +323,12 @@ namespace MediaBrowser.Model.Dlna
playlistItem.VideoBitrate = Math.Min(videoBitrate, currentValue);
}
// Hate to hard-code this, but it's still probably better than being subjected to encoder defaults
if (!playlistItem.VideoBitrate.HasValue)
{
playlistItem.VideoBitrate = 5000000;
}
}
return playlistItem;
@@ -555,8 +561,8 @@ namespace MediaBrowser.Model.Dlna
}
case ProfileConditionValue.VideoFramerate:
{
double num;
if (DoubleHelper.TryParseCultureInvariant(value, out num))
float num;
if (FloatHelper.TryParseCultureInvariant(value, out num))
{
item.MaxFramerate = num;
}

View File

@@ -45,7 +45,7 @@ namespace MediaBrowser.Model.Dlna
public int? MaxWidth { get; set; }
public int? MaxHeight { get; set; }
public double? MaxFramerate { get; set; }
public float? MaxFramerate { get; set; }
public string DeviceProfileId { get; set; }
public string DeviceId { get; set; }
@@ -191,7 +191,7 @@ namespace MediaBrowser.Model.Dlna
/// <summary>
/// Predicts the audio sample rate that will be in the output stream
/// </summary>
public double? TargetFramerate
public float? TargetFramerate
{
get
{