mirror of
				https://github.com/yt-dlp/yt-dlp.git
				synced 2025-11-04 08:35:12 +00:00 
			
		
		
		
	[downloader/fragment] Make speed more smooth
At the beginning of every segment there was a drop to Unknown speed due to timeslice being too small to calculate speed. Now last speed from the previous fragment is used.
This commit is contained in:
		@@ -99,7 +99,8 @@ class FragmentFD(FileDownloader):
 | 
				
			|||||||
                    state['eta'] = self.calc_eta(
 | 
					                    state['eta'] = self.calc_eta(
 | 
				
			||||||
                        start, time_now, estimated_size,
 | 
					                        start, time_now, estimated_size,
 | 
				
			||||||
                        state['downloaded_bytes'])
 | 
					                        state['downloaded_bytes'])
 | 
				
			||||||
                state['speed'] = s.get('speed')
 | 
					                state['speed'] = s.get('speed') or ctx.get('speed')
 | 
				
			||||||
 | 
					                ctx['speed'] = state['speed']
 | 
				
			||||||
                ctx['prev_frag_downloaded_bytes'] = frag_downloaded_bytes
 | 
					                ctx['prev_frag_downloaded_bytes'] = frag_downloaded_bytes
 | 
				
			||||||
            self._hook_progress(state)
 | 
					            self._hook_progress(state)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user