mirror of
				https://github.com/nyanmisaka/ffmpeg-rockchip.git
				synced 2025-10-31 12:36:41 +08:00 
			
		
		
		
	ffmpeg: Simplify fps code related to delta0
Small refactor of fps code for improved readability. In particular the "cor" variable was unnecessary and misleading because it would always be set to -delta0. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
		 Bryan Huh
					Bryan Huh
				
			
				
					committed by
					
						 Michael Niedermayer
						Michael Niedermayer
					
				
			
			
				
	
			
			
			 Michael Niedermayer
						Michael Niedermayer
					
				
			
						parent
						
							dfa98c4f83
						
					
				
				
					commit
					1fe82abac7
				
			
							
								
								
									
										11
									
								
								ffmpeg.c
									
									
									
									
									
								
							
							
						
						
									
										11
									
								
								ffmpeg.c
									
									
									
									
									
								
							| @@ -1013,20 +1013,19 @@ static void do_video_out(AVFormatContext *s, | ||||
|             delta > 0 && | ||||
|             format_video_sync != VSYNC_PASSTHROUGH && | ||||
|             format_video_sync != VSYNC_DROP) { | ||||
|             double cor = FFMIN(-delta0, duration); | ||||
|             if (delta0 < -0.6) { | ||||
|                 av_log(NULL, AV_LOG_WARNING, "Past duration %f too large\n", -delta0); | ||||
|             } else | ||||
|                 av_log(NULL, AV_LOG_DEBUG, "Clipping frame in rate conversion by %f\n", -delta0); | ||||
|             sync_ipts += cor; | ||||
|             duration -= cor; | ||||
|             delta0 += cor; | ||||
|             sync_ipts = ost->sync_opts; | ||||
|             duration += delta0; | ||||
|             delta0 = 0; | ||||
|         } | ||||
|  | ||||
|         switch (format_video_sync) { | ||||
|         case VSYNC_VSCFR: | ||||
|             if (ost->frame_number == 0 && delta - duration >= 0.5) { | ||||
|                 av_log(NULL, AV_LOG_DEBUG, "Not duplicating %d initial frames\n", (int)lrintf(delta - duration)); | ||||
|             if (ost->frame_number == 0 && delta0 >= 0.5) { | ||||
|                 av_log(NULL, AV_LOG_DEBUG, "Not duplicating %d initial frames\n", (int)lrintf(delta0)); | ||||
|                 delta = duration; | ||||
|                 delta0 = 0; | ||||
|                 ost->sync_opts = lrint(sync_ipts); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user