mirror of
				https://github.com/jellyfin/jellyfin.git
				synced 2025-11-04 03:27:21 -05:00 
			
		
		
		
	Fixes DirectStreaming for Microsoft players
This commit is contained in:
		
							parent
							
								
									dfa5470274
								
							
						
					
					
						commit
						03e2bc7198
					
				@ -178,20 +178,9 @@ namespace MediaBrowser.Server.Implementations.HttpServer
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
            using (var source = SourceStream)
 | 
					            using (var source = SourceStream)
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                // If the requested range is "0-", we can optimize by just doing a stream copy
 | 
					                //Since we've already set the postion of the sourcestream, just copy the remains to the output
 | 
				
			||||||
                if (RangeEnd == TotalContentLength - 1)
 | 
					 | 
				
			||||||
                {
 | 
					 | 
				
			||||||
                await source.CopyToAsync(responseStream).ConfigureAwait(false);
 | 
					                await source.CopyToAsync(responseStream).ConfigureAwait(false);
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
                else
 | 
					 | 
				
			||||||
                {
 | 
					 | 
				
			||||||
                    // Read the bytes we need
 | 
					 | 
				
			||||||
                    var buffer = new byte[Convert.ToInt32(RangeLength)];
 | 
					 | 
				
			||||||
                    await source.ReadAsync(buffer, 0, buffer.Length).ConfigureAwait(false);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
                    await responseStream.WriteAsync(buffer, 0, Convert.ToInt32(RangeLength)).ConfigureAwait(false);
 | 
					 | 
				
			||||||
                }
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        public string ContentType { get; set; }
 | 
					        public string ContentType { get; set; }
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user