mirror of
				https://github.com/jellyfin/jellyfin.git
				synced 2025-11-04 03:27:21 -05:00 
			
		
		
		
	update hls streams
This commit is contained in:
		
							parent
							
								
									9d216c79bb
								
							
						
					
					
						commit
						b9935a4643
					
				@ -202,7 +202,7 @@ namespace MediaBrowser.Api.Playback.Hls
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
                            while (!reader.EndOfStream)
 | 
					                            while (!reader.EndOfStream)
 | 
				
			||||||
                            {
 | 
					                            {
 | 
				
			||||||
                                var line = await reader.ReadLineAsync().ConfigureAwait(false);
 | 
					                                var line =  reader.ReadLine();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                                if (line.IndexOf("#EXTINF:", StringComparison.OrdinalIgnoreCase) != -1)
 | 
					                                if (line.IndexOf("#EXTINF:", StringComparison.OrdinalIgnoreCase) != -1)
 | 
				
			||||||
                                {
 | 
					                                {
 | 
				
			||||||
@ -234,11 +234,11 @@ namespace MediaBrowser.Api.Playback.Hls
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
            try
 | 
					            try
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                return FileSystem.GetFileStream(tmpPath, FileOpenMode.Open, FileAccessMode.Read, FileShareMode.ReadWrite, FileOpenOptions.Asynchronous | FileOpenOptions.SequentialScan);
 | 
					                return FileSystem.GetFileStream(tmpPath, FileOpenMode.Open, FileAccessMode.Read, FileShareMode.ReadWrite, FileOpenOptions.SequentialScan);
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            catch (IOException)
 | 
					            catch (IOException)
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                return FileSystem.GetFileStream(path, FileOpenMode.Open, FileAccessMode.Read, FileShareMode.ReadWrite, FileOpenOptions.Asynchronous | FileOpenOptions.SequentialScan);
 | 
					                return FileSystem.GetFileStream(path, FileOpenMode.Open, FileAccessMode.Read, FileShareMode.ReadWrite, FileOpenOptions.SequentialScan);
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -456,11 +456,7 @@ namespace MediaBrowser.Api.Playback.Hls
 | 
				
			|||||||
            {
 | 
					            {
 | 
				
			||||||
                try
 | 
					                try
 | 
				
			||||||
                {
 | 
					                {
 | 
				
			||||||
                    using (var fileStream = GetPlaylistFileStream(playlistPath))
 | 
					                    var text = FileSystem.ReadAllText(playlistPath, Encoding.UTF8);
 | 
				
			||||||
                    {
 | 
					 | 
				
			||||||
                        using (var reader = new StreamReader(fileStream, Encoding.UTF8, true, BufferSize))
 | 
					 | 
				
			||||||
                        {
 | 
					 | 
				
			||||||
                            var text = await reader.ReadToEndAsync().ConfigureAwait(false);
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
                    // If it appears in the playlist, it's done
 | 
					                    // If it appears in the playlist, it's done
 | 
				
			||||||
                    if (text.IndexOf(segmentFilename, StringComparison.OrdinalIgnoreCase) != -1)
 | 
					                    if (text.IndexOf(segmentFilename, StringComparison.OrdinalIgnoreCase) != -1)
 | 
				
			||||||
@ -476,8 +472,6 @@ namespace MediaBrowser.Api.Playback.Hls
 | 
				
			|||||||
                        //break;
 | 
					                        //break;
 | 
				
			||||||
                    }
 | 
					                    }
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
                    }
 | 
					 | 
				
			||||||
                }
 | 
					 | 
				
			||||||
                catch (IOException)
 | 
					                catch (IOException)
 | 
				
			||||||
                {
 | 
					                {
 | 
				
			||||||
                    // May get an error if the file is locked
 | 
					                    // May get an error if the file is locked
 | 
				
			||||||
 | 
				
			|||||||
@ -63,9 +63,7 @@ namespace MediaBrowser.Api.Playback.Progressive
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
        private Stream GetInputStream(bool allowAsyncFileRead)
 | 
					        private Stream GetInputStream(bool allowAsyncFileRead)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            var fileOpenOptions = StartPosition > 0
 | 
					            var fileOpenOptions = FileOpenOptions.SequentialScan;
 | 
				
			||||||
                ? FileOpenOptions.RandomAccess
 | 
					 | 
				
			||||||
                : FileOpenOptions.SequentialScan;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
            if (allowAsyncFileRead)
 | 
					            if (allowAsyncFileRead)
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user