aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke <luke.pulverenti@gmail.com>2017-04-15 15:46:46 -0400
committerGitHub <noreply@github.com>2017-04-15 15:46:46 -0400
commit8c4e69e1c66c01a95de59ac47f5d3607c8b61525 (patch)
tree8b03c793e0d5c60db65709f43765086324915c70
parent072d2c63a5b456890cb3e6ecea8b1bae14cc18a1 (diff)
parent25e6e0a5726f59fedd3d25bf6ae6adc626a25306 (diff)
Merge pull request #2580 from MediaBrowser/dev
Dev
-rw-r--r--Emby.Server.Implementations/Library/Resolvers/Movies/MovieResolver.cs2
-rw-r--r--Emby.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs49
-rw-r--r--Emby.Server.Implementations/LiveTv/LiveStreamHelper.cs2
-rw-r--r--Emby.Server.Implementations/LiveTv/LiveTvMediaSourceProvider.cs2
-rw-r--r--MediaBrowser.Api/MediaBrowser.Api.csproj1
-rw-r--r--MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs5
-rw-r--r--MediaBrowser.Api/Playback/Hls/VideoHlsService.cs8
-rw-r--r--MediaBrowser.Api/SuggestionsService.cs104
-rw-r--r--MediaBrowser.Api/TvShowsService.cs36
-rw-r--r--MediaBrowser.Controller/Entities/Audio/MusicAlbum.cs33
-rw-r--r--MediaBrowser.Controller/Entities/MusicVideo.cs2
-rw-r--r--MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs48
-rw-r--r--MediaBrowser.Controller/MediaEncoding/EncodingJobInfo.cs2
-rw-r--r--MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs26
-rw-r--r--SharedVersion.cs2
15 files changed, 258 insertions, 64 deletions
diff --git a/Emby.Server.Implementations/Library/Resolvers/Movies/MovieResolver.cs b/Emby.Server.Implementations/Library/Resolvers/Movies/MovieResolver.cs
index b791311f9..3550a83b9 100644
--- a/Emby.Server.Implementations/Library/Resolvers/Movies/MovieResolver.cs
+++ b/Emby.Server.Implementations/Library/Resolvers/Movies/MovieResolver.cs
@@ -219,7 +219,7 @@ namespace Emby.Server.Implementations.Library.Resolvers.Movies
if (string.Equals(collectionType, CollectionType.MusicVideos, StringComparison.OrdinalIgnoreCase))
{
- return FindMovie<MusicVideo>(args.Path, args.Parent, files, args.DirectoryService, collectionType, false);
+ return FindMovie<MusicVideo>(args.Path, args.Parent, files, args.DirectoryService, collectionType, true);
}
if (string.Equals(collectionType, CollectionType.HomeVideos, StringComparison.OrdinalIgnoreCase))
diff --git a/Emby.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs b/Emby.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs
index 0ea1b38b1..666c1fdcd 100644
--- a/Emby.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs
+++ b/Emby.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs
@@ -39,6 +39,7 @@ using MediaBrowser.Model.FileOrganization;
using MediaBrowser.Model.System;
using MediaBrowser.Model.Threading;
using MediaBrowser.Model.Extensions;
+using MediaBrowser.Model.Querying;
namespace Emby.Server.Implementations.LiveTv.EmbyTV
{
@@ -1512,7 +1513,7 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV
_timerProvider.AddOrUpdate(timer, false);
SaveRecordingMetadata(timer, recordPath, seriesPath);
- EnforceKeepUpTo(timer);
+ EnforceKeepUpTo(timer, seriesPath);
};
await recorder.Record(mediaStreamInfo, recordPath, duration, onStarted, cancellationToken)
@@ -1583,12 +1584,16 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV
}, _logger);
}
- private async void EnforceKeepUpTo(TimerInfo timer)
+ private async void EnforceKeepUpTo(TimerInfo timer, string seriesPath)
{
if (string.IsNullOrWhiteSpace(timer.SeriesTimerId))
{
return;
}
+ if (string.IsNullOrWhiteSpace(seriesPath))
+ {
+ return;
+ }
var seriesTimerId = timer.SeriesTimerId;
var seriesTimer = _seriesTimerProvider.GetAll().FirstOrDefault(i => string.Equals(i.Id, seriesTimerId, StringComparison.OrdinalIgnoreCase));
@@ -1621,6 +1626,43 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV
.ToList();
await DeleteLibraryItemsForTimers(timersToDelete).ConfigureAwait(false);
+
+ var librarySeries = _libraryManager.FindByPath(seriesPath, true) as Folder;
+
+ if (librarySeries == null)
+ {
+ return;
+ }
+
+ var episodesToDelete = (await librarySeries.GetItems(new InternalItemsQuery
+ {
+ SortBy = new[] { ItemSortBy.DateCreated },
+ SortOrder = SortOrder.Descending,
+ IsVirtualItem = false,
+ IsFolder = false,
+ Recursive = true
+
+ }).ConfigureAwait(false))
+ .Items
+ .Where(i => i.LocationType == LocationType.FileSystem && _fileSystem.FileExists(i.Path))
+ .Skip(seriesTimer.KeepUpTo - 1)
+ .ToList();
+
+ foreach (var item in episodesToDelete)
+ {
+ try
+ {
+ await _libraryManager.DeleteItem(item, new DeleteOptions
+ {
+ DeleteFileLocation = true
+
+ }).ConfigureAwait(false);
+ }
+ catch (Exception ex)
+ {
+ _logger.ErrorException("Error deleting item", ex);
+ }
+ }
}
finally
{
@@ -1658,7 +1700,8 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV
await _libraryManager.DeleteItem(libraryItem, new DeleteOptions
{
DeleteFileLocation = true
- });
+
+ }).ConfigureAwait(false);
}
else
{
diff --git a/Emby.Server.Implementations/LiveTv/LiveStreamHelper.cs b/Emby.Server.Implementations/LiveTv/LiveStreamHelper.cs
index 3906df000..053af4fc6 100644
--- a/Emby.Server.Implementations/LiveTv/LiveStreamHelper.cs
+++ b/Emby.Server.Implementations/LiveTv/LiveStreamHelper.cs
@@ -84,7 +84,7 @@ namespace Emby.Server.Implementations.LiveTv
if (width >= 1900)
{
- videoStream.BitRate = 8000000;
+ videoStream.BitRate = 15000000;
}
else if (width >= 1260)
diff --git a/Emby.Server.Implementations/LiveTv/LiveTvMediaSourceProvider.cs b/Emby.Server.Implementations/LiveTv/LiveTvMediaSourceProvider.cs
index a9c449f83..93996f5da 100644
--- a/Emby.Server.Implementations/LiveTv/LiveTvMediaSourceProvider.cs
+++ b/Emby.Server.Implementations/LiveTv/LiveTvMediaSourceProvider.cs
@@ -185,7 +185,7 @@ namespace Emby.Server.Implementations.LiveTv
if (width >= 1900)
{
- videoStream.BitRate = 8000000;
+ videoStream.BitRate = 15000000;
}
else if (width >= 1260)
diff --git a/MediaBrowser.Api/MediaBrowser.Api.csproj b/MediaBrowser.Api/MediaBrowser.Api.csproj
index c2c8d1102..0785b904a 100644
--- a/MediaBrowser.Api/MediaBrowser.Api.csproj
+++ b/MediaBrowser.Api/MediaBrowser.Api.csproj
@@ -134,6 +134,7 @@
<Compile Include="SearchService.cs" />
<Compile Include="Session\SessionsService.cs" />
<Compile Include="SimilarItemsHelper.cs" />
+ <Compile Include="SuggestionsService.cs" />
<Compile Include="System\ActivityLogService.cs" />
<Compile Include="System\ActivityLogWebSocketListener.cs" />
<Compile Include="System\SystemService.cs" />
diff --git a/MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs b/MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs
index 43f25145e..038d76245 100644
--- a/MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs
+++ b/MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs
@@ -826,6 +826,11 @@ namespace MediaBrowser.Api.Playback.Hls
args += " -ab " + bitrate.Value.ToString(UsCulture);
}
+ if (state.OutputAudioSampleRate.HasValue)
+ {
+ args += " -ar " + state.OutputAudioSampleRate.Value.ToString(UsCulture);
+ }
+
args += " " + EncodingHelper.GetAudioFilterParam(state, ApiEntryPoint.Instance.GetEncodingOptions(), true);
return args;
diff --git a/MediaBrowser.Api/Playback/Hls/VideoHlsService.cs b/MediaBrowser.Api/Playback/Hls/VideoHlsService.cs
index 71b1dc1b1..a813d7a87 100644
--- a/MediaBrowser.Api/Playback/Hls/VideoHlsService.cs
+++ b/MediaBrowser.Api/Playback/Hls/VideoHlsService.cs
@@ -6,10 +6,7 @@ using MediaBrowser.Controller.MediaEncoding;
using MediaBrowser.Model.IO;
using MediaBrowser.Model.Serialization;
using System;
-using MediaBrowser.Common.IO;
-using MediaBrowser.Controller.IO;
using MediaBrowser.Controller.Net;
-using MediaBrowser.Model.IO;
using MediaBrowser.Model.Dlna;
using MediaBrowser.Model.Services;
@@ -60,6 +57,11 @@ namespace MediaBrowser.Api.Playback.Hls
args += " -ab " + bitrate.Value.ToString(UsCulture);
}
+ if (state.OutputAudioSampleRate.HasValue)
+ {
+ args += " -ar " + state.OutputAudioSampleRate.Value.ToString(UsCulture);
+ }
+
args += " " + EncodingHelper.GetAudioFilterParam(state, ApiEntryPoint.Instance.GetEncodingOptions(), true);
return args;
diff --git a/MediaBrowser.Api/SuggestionsService.cs b/MediaBrowser.Api/SuggestionsService.cs
new file mode 100644
index 000000000..7196c0f39
--- /dev/null
+++ b/MediaBrowser.Api/SuggestionsService.cs
@@ -0,0 +1,104 @@
+using MediaBrowser.Controller.Dto;
+using MediaBrowser.Controller.Entities;
+using MediaBrowser.Controller.Net;
+using MediaBrowser.Model.Dto;
+using MediaBrowser.Model.Querying;
+using MediaBrowser.Model.Services;
+using System;
+using System.Linq;
+using System.Threading.Tasks;
+using MediaBrowser.Controller.Library;
+
+namespace MediaBrowser.Api
+{
+ [Route("/Users/{UserId}/Suggestions", "GET", Summary = "Gets items based on a query.")]
+ public class GetSuggestedItems : IReturn<QueryResult<BaseItem>>
+ {
+ public string MediaType { get; set; }
+ public string Type { get; set; }
+ public string UserId { get; set; }
+ public bool EnableTotalRecordCount { get; set; }
+ public int? StartIndex { get; set; }
+ public int? Limit { get; set; }
+
+ public string[] GetMediaTypes()
+ {
+ return (MediaType ?? string.Empty).Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
+ }
+
+ public string[] GetIncludeItemTypes()
+ {
+ return (Type ?? string.Empty).Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
+ }
+ }
+
+ public class SuggestionsService : BaseApiService
+ {
+ private readonly IDtoService _dtoService;
+ private readonly IAuthorizationContext _authContext;
+ private readonly IUserManager _userManager;
+ private readonly ILibraryManager _libraryManager;
+
+ public SuggestionsService(IDtoService dtoService, IAuthorizationContext authContext, IUserManager userManager, ILibraryManager libraryManager)
+ {
+ _dtoService = dtoService;
+ _authContext = authContext;
+ _userManager = userManager;
+ _libraryManager = libraryManager;
+ }
+
+ public async Task<object> Get(GetSuggestedItems request)
+ {
+ var result = await GetResultItems(request).ConfigureAwait(false);
+
+ return ToOptimizedResult(result);
+ }
+
+ private async Task<QueryResult<BaseItemDto>> GetResultItems(GetSuggestedItems request)
+ {
+ var user = !string.IsNullOrWhiteSpace(request.UserId) ? _userManager.GetUserById(request.UserId) : null;
+
+ var dtoOptions = GetDtoOptions(_authContext, request);
+ var result = GetItems(request, user, dtoOptions);
+
+ var dtoList = await _dtoService.GetBaseItemDtos(result.Items, dtoOptions, user).ConfigureAwait(false);
+
+ if (dtoList == null)
+ {
+ throw new InvalidOperationException("GetBaseItemDtos returned null");
+ }
+
+ return new QueryResult<BaseItemDto>
+ {
+ TotalRecordCount = result.TotalRecordCount,
+ Items = dtoList.ToArray()
+ };
+ }
+
+ private QueryResult<BaseItem> GetItems(GetSuggestedItems request, User user, DtoOptions dtoOptions)
+ {
+ var query = new InternalItemsQuery(user)
+ {
+ SortBy = new string[] { ItemSortBy.Random },
+ MediaTypes = request.GetMediaTypes(),
+ IncludeItemTypes = request.GetIncludeItemTypes(),
+ IsVirtualItem = false,
+ StartIndex = request.StartIndex,
+ Limit = request.Limit,
+ DtoOptions = dtoOptions
+ };
+
+ if (request.EnableTotalRecordCount)
+ {
+ return _libraryManager.GetItemsResult(query);
+ }
+
+ var items = _libraryManager.GetItemList(query).ToArray();
+
+ return new QueryResult<BaseItem>
+ {
+ Items = items
+ };
+ }
+ }
+}
diff --git a/MediaBrowser.Api/TvShowsService.cs b/MediaBrowser.Api/TvShowsService.cs
index 43fe74d5f..d7f017e1d 100644
--- a/MediaBrowser.Api/TvShowsService.cs
+++ b/MediaBrowser.Api/TvShowsService.cs
@@ -137,6 +137,7 @@ namespace MediaBrowser.Api
}
[Route("/Shows/{Id}/Episodes", "GET", Summary = "Gets episodes for a tv season")]
+ [Route("/Shows/Episodes", "GET", Summary = "Gets episodes for a tv season")]
public class GetEpisodes : IReturn<ItemsResult>, IHasItemFields, IHasDtoOptions
{
/// <summary>
@@ -200,9 +201,11 @@ namespace MediaBrowser.Api
[ApiMember(Name = "EnableUserData", Description = "Optional, include user data", IsRequired = false, DataType = "boolean", ParameterType = "query", Verb = "GET")]
public bool? EnableUserData { get; set; }
+ public string SeriesName { get; set; }
}
[Route("/Shows/{Id}/Seasons", "GET", Summary = "Gets seasons for a tv series")]
+ [Route("/Shows/Seasons", "GET", Summary = "Gets seasons for a tv series")]
public class GetSeasons : IReturn<ItemsResult>, IHasItemFields, IHasDtoOptions
{
/// <summary>
@@ -246,6 +249,7 @@ namespace MediaBrowser.Api
[ApiMember(Name = "EnableUserData", Description = "Optional, include user data", IsRequired = false, DataType = "boolean", ParameterType = "query", Verb = "GET")]
public bool? EnableUserData { get; set; }
+ public string SeriesName { get; set; }
}
/// <summary>
@@ -427,11 +431,11 @@ namespace MediaBrowser.Api
{
var user = _userManager.GetUserById(request.UserId);
- var series = _libraryManager.GetItemById(request.Id) as Series;
+ var series = GetSeries(request.Id, request.SeriesName, user);
if (series == null)
{
- throw new ResourceNotFoundException("No series exists with Id " + request.Id);
+ throw new ResourceNotFoundException("Series not found");
}
var seasons = (await series.GetItems(new InternalItemsQuery(user)
@@ -455,6 +459,26 @@ namespace MediaBrowser.Api
};
}
+ private Series GetSeries(string seriesId, string seriesName, User user)
+ {
+ if (!string.IsNullOrWhiteSpace(seriesId))
+ {
+ return _libraryManager.GetItemById(seriesId) as Series;
+ }
+
+ if (!string.IsNullOrWhiteSpace(seriesName))
+ {
+ return _libraryManager.GetItemList(new InternalItemsQuery(user)
+ {
+ Name = seriesName,
+ IncludeItemTypes = new string[] { typeof(Series).Name }
+
+ }).OfType<Series>().FirstOrDefault();
+ }
+
+ return null;
+ }
+
public async Task<object> Get(GetEpisodes request)
{
var user = _userManager.GetUserById(request.UserId);
@@ -474,11 +498,11 @@ namespace MediaBrowser.Api
}
else if (request.Season.HasValue)
{
- var series = _libraryManager.GetItemById(request.Id) as Series;
+ var series = GetSeries(request.Id, request.SeriesName, user);
if (series == null)
{
- throw new ResourceNotFoundException("No series exists with Id " + request.Id);
+ throw new ResourceNotFoundException("Series not found");
}
var season = series.GetSeasons(user).FirstOrDefault(i => i.IndexNumber == request.Season.Value);
@@ -494,11 +518,11 @@ namespace MediaBrowser.Api
}
else
{
- var series = _libraryManager.GetItemById(request.Id) as Series;
+ var series = GetSeries(request.Id, request.SeriesName, user);
if (series == null)
{
- throw new ResourceNotFoundException("No series exists with Id " + request.Id);
+ throw new ResourceNotFoundException("Series not found");
}
episodes = series.GetEpisodes(user);
diff --git a/MediaBrowser.Controller/Entities/Audio/MusicAlbum.cs b/MediaBrowser.Controller/Entities/Audio/MusicAlbum.cs
index 6ad38033a..f40ab3cde 100644
--- a/MediaBrowser.Controller/Entities/Audio/MusicAlbum.cs
+++ b/MediaBrowser.Controller/Entities/Audio/MusicAlbum.cs
@@ -9,6 +9,7 @@ using MediaBrowser.Model.Serialization;
using System.Threading;
using System.Threading.Tasks;
using MediaBrowser.Controller.Library;
+using MediaBrowser.Model.Dto;
namespace MediaBrowser.Controller.Entities.Audio
{
@@ -227,7 +228,39 @@ namespace MediaBrowser.Controller.Entities.Audio
// Refresh current item
await RefreshMetadata(parentRefreshOptions, cancellationToken).ConfigureAwait(false);
+ if (!refreshOptions.IsAutomated)
+ {
+ await RefreshArtists(refreshOptions, cancellationToken).ConfigureAwait(false);
+ }
+
progress.Report(100);
}
+
+ private async Task RefreshArtists(MetadataRefreshOptions refreshOptions, CancellationToken cancellationToken)
+ {
+ var artists = AllArtists.Select(i =>
+ {
+ // This should not be necessary but we're seeing some cases of it
+ if (string.IsNullOrWhiteSpace(i))
+ {
+ return null;
+ }
+
+ var artist = LibraryManager.GetArtist(i);
+
+ if (!artist.IsAccessedByName)
+ {
+ return null;
+ }
+
+ return artist;
+
+ }).Where(i => i != null).ToList();
+
+ foreach (var artist in artists)
+ {
+ await artist.RefreshMetadata(refreshOptions, cancellationToken).ConfigureAwait(false);
+ }
+ }
}
}
diff --git a/MediaBrowser.Controller/Entities/MusicVideo.cs b/MediaBrowser.Controller/Entities/MusicVideo.cs
index c781ef85b..7344cb8e4 100644
--- a/MediaBrowser.Controller/Entities/MusicVideo.cs
+++ b/MediaBrowser.Controller/Entities/MusicVideo.cs
@@ -29,7 +29,7 @@ namespace MediaBrowser.Controller.Entities
{
get
{
- return true;
+ return false;
}
}
diff --git a/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs b/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs
index 8412985bf..dd1397a0d 100644
--- a/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs
+++ b/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs
@@ -719,14 +719,15 @@ namespace MediaBrowser.Controller.MediaEncoding
}
}
// nvenc doesn't decode with param -level set ?!
- else if (string.Equals(videoEncoder, "h264_nvenc", StringComparison.OrdinalIgnoreCase)){
+ else if (string.Equals(videoEncoder, "h264_nvenc", StringComparison.OrdinalIgnoreCase))
+ {
//param += "";
}
else if (!string.Equals(videoEncoder, "h264_omx", StringComparison.OrdinalIgnoreCase))
{
param += " -level " + level;
}
-
+
}
if (string.Equals(videoEncoder, "libx264", StringComparison.OrdinalIgnoreCase))
@@ -1014,43 +1015,32 @@ namespace MediaBrowser.Controller.MediaEncoding
public string GetAudioFilterParam(EncodingJobInfo state, EncodingOptions encodingOptions, bool isHls)
{
- var volParam = string.Empty;
- var audioSampleRate = string.Empty;
-
var channels = state.OutputAudioChannels;
+ var filters = new List<string>();
+
// Boost volume to 200% when downsampling from 6ch to 2ch
if (channels.HasValue && channels.Value <= 2)
{
if (state.AudioStream != null && state.AudioStream.Channels.HasValue && state.AudioStream.Channels.Value > 5 && !encodingOptions.DownMixAudioBoost.Equals(1))
{
- volParam = ",volume=" + encodingOptions.DownMixAudioBoost.ToString(_usCulture);
+ filters.Add("volume=" + encodingOptions.DownMixAudioBoost.ToString(_usCulture));
}
}
- if (state.OutputAudioSampleRate.HasValue)
- {
- audioSampleRate = state.OutputAudioSampleRate.Value + ":";
- }
-
- var adelay = isHls ? "adelay=1," : string.Empty;
-
- var pts = string.Empty;
-
if (state.SubtitleStream != null && state.SubtitleStream.IsTextSubtitleStream && state.SubtitleDeliveryMethod == SubtitleDeliveryMethod.Encode && !state.CopyTimestamps)
{
var seconds = TimeSpan.FromTicks(state.StartTimeTicks ?? 0).TotalSeconds;
- pts = string.Format(",asetpts=PTS-{0}/TB", Math.Round(seconds).ToString(_usCulture));
+ filters.Add(string.Format("asetpts=PTS-{0}/TB", Math.Round(seconds).ToString(_usCulture)));
}
- return string.Format("-af \"{0}aresample={1}async={4}{2}{3}\"",
+ if (filters.Count > 0)
+ {
+ return "-af \"" + string.Join(",", filters.ToArray()) + "\"";
+ }
- adelay,
- audioSampleRate,
- volParam,
- pts,
- state.OutputAudioSync);
+ return string.Empty;
}
/// <summary>
@@ -1282,7 +1272,7 @@ namespace MediaBrowser.Controller.MediaEncoding
}
var videoSizeParam = string.Empty;
-
+
if (state.VideoStream != null && state.VideoStream.Width.HasValue && state.VideoStream.Height.HasValue)
{
videoSizeParam = string.Format("scale={0}:{1}", state.VideoStream.Width.Value.ToString(_usCulture), state.VideoStream.Height.Value.ToString(_usCulture));
@@ -1569,7 +1559,7 @@ namespace MediaBrowser.Controller.MediaEncoding
var outputVideoCodec = GetVideoEncoder(state, encodingOptions);
// Important: If this is ever re-enabled, make sure not to use it with wtv because it breaks seeking
- if (!string.Equals(state.InputContainer, "wtv", StringComparison.OrdinalIgnoreCase) &&
+ if (!string.Equals(state.InputContainer, "wtv", StringComparison.OrdinalIgnoreCase) &&
state.TranscodingType != TranscodingJobType.Progressive &&
state.EnableBreakOnNonKeyFrames(outputVideoCodec))
{
@@ -1657,7 +1647,6 @@ namespace MediaBrowser.Controller.MediaEncoding
if (state.ReadInputAtNativeFramerate ||
mediaSource.Protocol == MediaProtocol.File && string.Equals(mediaSource.Container, "wtv", StringComparison.OrdinalIgnoreCase))
{
- state.OutputAudioSync = "1000";
state.InputVideoSync = "-1";
state.InputAudioSync = "1";
}
@@ -1715,7 +1704,7 @@ namespace MediaBrowser.Controller.MediaEncoding
{
if (state.SubtitleStream == null || state.SubtitleDeliveryMethod != SubtitleDeliveryMethod.Embed)
{
- return ;
+ return;
}
// This is tricky to remux in, after converting to dvdsub it's not positioned correctly
@@ -1985,7 +1974,12 @@ namespace MediaBrowser.Controller.MediaEncoding
{
args += " -ab " + bitrate.Value.ToString(_usCulture);
}
-
+
+ if (state.OutputAudioSampleRate.HasValue)
+ {
+ args += " -ar " + state.OutputAudioSampleRate.Value.ToString(_usCulture);
+ }
+
args += " " + GetAudioFilterParam(state, encodingOptions, false);
return args;
diff --git a/MediaBrowser.Controller/MediaEncoding/EncodingJobInfo.cs b/MediaBrowser.Controller/MediaEncoding/EncodingJobInfo.cs
index 4e0f223b7..f3e6280aa 100644
--- a/MediaBrowser.Controller/MediaEncoding/EncodingJobInfo.cs
+++ b/MediaBrowser.Controller/MediaEncoding/EncodingJobInfo.cs
@@ -55,7 +55,7 @@ namespace MediaBrowser.Controller.MediaEncoding
return "-1";
}
}
- public string OutputAudioSync = "1";
+
public string InputAudioSync { get; set; }
public string InputVideoSync { get; set; }
public TransportStreamTimestamp InputTimestamp { get; set; }
diff --git a/MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs b/MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs
index af826f231..816f14f82 100644
--- a/MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs
+++ b/MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs
@@ -664,28 +664,16 @@ namespace MediaBrowser.MediaEncoding.Encoder
private bool DetectInterlaced(MediaSourceInfo video, MediaStream videoStream)
{
- var formats = (video.Container ?? string.Empty).Split(',').ToList();
- var enableInterlacedDection = formats.Contains("vob", StringComparer.OrdinalIgnoreCase) ||
- formats.Contains("m2ts", StringComparer.OrdinalIgnoreCase) ||
- formats.Contains("ts", StringComparer.OrdinalIgnoreCase) ||
- formats.Contains("mpegts", StringComparer.OrdinalIgnoreCase) ||
- formats.Contains("wtv", StringComparer.OrdinalIgnoreCase);
-
// If it's mpeg based, assume true
if ((videoStream.Codec ?? string.Empty).IndexOf("mpeg", StringComparison.OrdinalIgnoreCase) != -1)
{
- if (enableInterlacedDection)
- {
- return true;
- }
- }
- else
- {
- // If the video codec is not some form of mpeg, then take a shortcut and limit this to containers that are likely to have interlaced content
- if (!enableInterlacedDection)
- {
- return false;
- }
+ var formats = (video.Container ?? string.Empty).Split(',').ToList();
+ return formats.Contains("vob", StringComparer.OrdinalIgnoreCase) ||
+ formats.Contains("m2ts", StringComparer.OrdinalIgnoreCase) ||
+ formats.Contains("ts", StringComparer.OrdinalIgnoreCase) ||
+ formats.Contains("mpegts", StringComparer.OrdinalIgnoreCase) ||
+ formats.Contains("wtv", StringComparer.OrdinalIgnoreCase);
+
}
return false;
diff --git a/SharedVersion.cs b/SharedVersion.cs
index fdb5f7599..6e2c36420 100644
--- a/SharedVersion.cs
+++ b/SharedVersion.cs
@@ -1,3 +1,3 @@
using System.Reflection;
-[assembly: AssemblyVersion("3.2.12.5")]
+[assembly: AssemblyVersion("3.2.12.6")]