aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2016-10-20 02:36:34 -0400
committerLuke Pulverenti <luke.pulverenti@gmail.com>2016-10-20 02:36:34 -0400
commitccaf2f43a679dca056ef9512b9b260735d357948 (patch)
tree6fde4526efd41dcf7d68f248eeb94d292d160124
parentb1f604b5e741709301f12374550dc6f4328d1e8d (diff)
exclude mpeg4 with level -99 from vaapi
-rw-r--r--MediaBrowser.Api/Playback/BaseStreamingService.cs21
-rw-r--r--MediaBrowser.MediaEncoding/Encoder/EncodingJobFactory.cs21
-rw-r--r--MediaBrowser.Server.Implementations/LiveTv/LiveTvManager.cs2
3 files changed, 41 insertions, 3 deletions
diff --git a/MediaBrowser.Api/Playback/BaseStreamingService.cs b/MediaBrowser.Api/Playback/BaseStreamingService.cs
index eb80ae89e..dc26218a5 100644
--- a/MediaBrowser.Api/Playback/BaseStreamingService.cs
+++ b/MediaBrowser.Api/Playback/BaseStreamingService.cs
@@ -317,13 +317,32 @@ namespace MediaBrowser.Api.Playback
}
if (string.Equals(hwType, "vaapi", StringComparison.OrdinalIgnoreCase) && !string.IsNullOrWhiteSpace(encodingOptions.VaapiDevice))
{
- return GetAvailableEncoder("h264_vaapi", defaultEncoder);
+ if (IsVaapiSupported(state))
+ {
+ return GetAvailableEncoder("h264_vaapi", defaultEncoder);
+ }
}
}
return defaultEncoder;
}
+ private bool IsVaapiSupported(StreamState state)
+ {
+ var videoStream = state.VideoStream;
+
+ if (videoStream != null)
+ {
+ // vaapi will throw an error with this input
+ // [vaapi @ 0x7faed8000960] No VAAPI support for codec mpeg4 profile -99.
+ if (string.Equals(videoStream.Codec, "mpeg4", StringComparison.OrdinalIgnoreCase) && videoStream.Level == -99)
+ {
+ return false;
+ }
+ }
+ return true;
+ }
+
private string GetAvailableEncoder(string preferredEncoder, string defaultEncoder)
{
if (MediaEncoder.SupportsEncoder(preferredEncoder))
diff --git a/MediaBrowser.MediaEncoding/Encoder/EncodingJobFactory.cs b/MediaBrowser.MediaEncoding/Encoder/EncodingJobFactory.cs
index b66a3ed96..f811a8d48 100644
--- a/MediaBrowser.MediaEncoding/Encoder/EncodingJobFactory.cs
+++ b/MediaBrowser.MediaEncoding/Encoder/EncodingJobFactory.cs
@@ -588,13 +588,32 @@ namespace MediaBrowser.MediaEncoding.Encoder
}
if (string.Equals(hwType, "vaapi", StringComparison.OrdinalIgnoreCase) && !string.IsNullOrWhiteSpace(options.VaapiDevice))
{
- return GetAvailableEncoder(mediaEncoder, "h264_vaapi", defaultEncoder);
+ if (IsVaapiSupported(state))
+ {
+ return GetAvailableEncoder(mediaEncoder, "h264_vaapi", defaultEncoder);
+ }
}
}
return defaultEncoder;
}
+ private static bool IsVaapiSupported(EncodingJob state)
+ {
+ var videoStream = state.VideoStream;
+
+ if (videoStream != null)
+ {
+ // vaapi will throw an error with this input
+ // [vaapi @ 0x7faed8000960] No VAAPI support for codec mpeg4 profile -99.
+ if (string.Equals(videoStream.Codec, "mpeg4", StringComparison.OrdinalIgnoreCase) && videoStream.Level == -99)
+ {
+ return false;
+ }
+ }
+ return true;
+ }
+
internal static bool CanStreamCopyVideo(EncodingJobOptions request, MediaStream videoStream)
{
if (videoStream.IsInterlaced)
diff --git a/MediaBrowser.Server.Implementations/LiveTv/LiveTvManager.cs b/MediaBrowser.Server.Implementations/LiveTv/LiveTvManager.cs
index 7c72363b0..902afb200 100644
--- a/MediaBrowser.Server.Implementations/LiveTv/LiveTvManager.cs
+++ b/MediaBrowser.Server.Implementations/LiveTv/LiveTvManager.cs
@@ -1947,7 +1947,7 @@ namespace MediaBrowser.Server.Implementations.LiveTv
}
else
{
- timers = timers.Where(i => !(i.Item1.Status == RecordingStatus.New));
+ timers = timers.Where(i => i.Item1.Status != RecordingStatus.New);
}
}