mirror of
				https://github.com/jellyfin/jellyfin.git
				synced 2025-11-04 03:27:21 -05:00 
			
		
		
		
	handle unknown video stream
This commit is contained in:
		
							parent
							
								
									20e090e145
								
							
						
					
					
						commit
						dbba636290
					
				@ -9,6 +9,7 @@ using System;
 | 
			
		||||
using System.IO;
 | 
			
		||||
using System.Text;
 | 
			
		||||
using System.Threading.Tasks;
 | 
			
		||||
using MediaBrowser.Controller.Security;
 | 
			
		||||
using MediaBrowser.Model.IO;
 | 
			
		||||
using MediaBrowser.Model.Threading;
 | 
			
		||||
 | 
			
		||||
@ -26,8 +27,9 @@ namespace Emby.Server.Implementations.Connect
 | 
			
		||||
        private readonly IApplicationHost _appHost;
 | 
			
		||||
        private readonly IFileSystem _fileSystem;
 | 
			
		||||
        private readonly ITimerFactory _timerFactory;
 | 
			
		||||
        private readonly IEncryptionManager _encryption;
 | 
			
		||||
 | 
			
		||||
        public ConnectEntryPoint(IHttpClient httpClient, IApplicationPaths appPaths, ILogger logger, INetworkManager networkManager, IConnectManager connectManager, IApplicationHost appHost, IFileSystem fileSystem, ITimerFactory timerFactory)
 | 
			
		||||
        public ConnectEntryPoint(IHttpClient httpClient, IApplicationPaths appPaths, ILogger logger, INetworkManager networkManager, IConnectManager connectManager, IApplicationHost appHost, IFileSystem fileSystem, ITimerFactory timerFactory, IEncryptionManager encryption)
 | 
			
		||||
        {
 | 
			
		||||
            _httpClient = httpClient;
 | 
			
		||||
            _appPaths = appPaths;
 | 
			
		||||
@ -37,6 +39,7 @@ namespace Emby.Server.Implementations.Connect
 | 
			
		||||
            _appHost = appHost;
 | 
			
		||||
            _fileSystem = fileSystem;
 | 
			
		||||
            _timerFactory = timerFactory;
 | 
			
		||||
            _encryption = encryption;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        public void Run()
 | 
			
		||||
@ -143,7 +146,7 @@ namespace Emby.Server.Implementations.Connect
 | 
			
		||||
 | 
			
		||||
        private string CacheFilePath
 | 
			
		||||
        {
 | 
			
		||||
            get { return Path.Combine(_appPaths.DataPath, "wan.txt"); }
 | 
			
		||||
            get { return Path.Combine(_appPaths.DataPath, "wan.dat"); }
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        private void CacheAddress(IpAddressInfo address)
 | 
			
		||||
@ -153,7 +156,14 @@ namespace Emby.Server.Implementations.Connect
 | 
			
		||||
            try
 | 
			
		||||
            {
 | 
			
		||||
                _fileSystem.CreateDirectory(Path.GetDirectoryName(path));
 | 
			
		||||
                _fileSystem.WriteAllText(path, address.ToString(), Encoding.UTF8);
 | 
			
		||||
            }
 | 
			
		||||
            catch (Exception ex)
 | 
			
		||||
            {
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            try
 | 
			
		||||
            {
 | 
			
		||||
                _fileSystem.WriteAllText(path, _encryption.EncryptString(address.ToString()), Encoding.UTF8);
 | 
			
		||||
            }
 | 
			
		||||
            catch (Exception ex)
 | 
			
		||||
            {
 | 
			
		||||
@ -169,7 +179,7 @@ namespace Emby.Server.Implementations.Connect
 | 
			
		||||
 | 
			
		||||
            try
 | 
			
		||||
            {
 | 
			
		||||
                var endpoint = _fileSystem.ReadAllText(path, Encoding.UTF8);
 | 
			
		||||
                var endpoint = _encryption.DecryptString(_fileSystem.ReadAllText(path, Encoding.UTF8));
 | 
			
		||||
                IpAddressInfo ipAddress;
 | 
			
		||||
 | 
			
		||||
                if (_networkManager.TryParseIpAddress(endpoint, out ipAddress))
 | 
			
		||||
 | 
			
		||||
@ -103,7 +103,8 @@ namespace Emby.Server.Implementations.LiveTv.TunerHosts.HdHomerun
 | 
			
		||||
                TunerHostId = info.Id,
 | 
			
		||||
                IsHD = i.HD == 1,
 | 
			
		||||
                AudioCodec = i.AudioCodec,
 | 
			
		||||
                VideoCodec = i.VideoCodec
 | 
			
		||||
                VideoCodec = i.VideoCodec,
 | 
			
		||||
                ChannelType = ChannelType.TV
 | 
			
		||||
            });
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -205,7 +205,8 @@ namespace MediaBrowser.Api.Playback
 | 
			
		||||
            }
 | 
			
		||||
            else
 | 
			
		||||
            {
 | 
			
		||||
                args += "-map -0:v";
 | 
			
		||||
                // No known video stream
 | 
			
		||||
                args += "-vn";
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            if (state.AudioStream != null)
 | 
			
		||||
 | 
			
		||||
@ -896,7 +896,8 @@ namespace MediaBrowser.MediaEncoding.Encoder
 | 
			
		||||
            }
 | 
			
		||||
            else
 | 
			
		||||
            {
 | 
			
		||||
                args += "-map -0:v";
 | 
			
		||||
                // No known video stream
 | 
			
		||||
                args += "-vn";
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            if (state.AudioStream != null)
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user