You've already forked FFmpeg
							
							
				mirror of
				https://github.com/FFmpeg/FFmpeg.git
				synced 2025-10-30 23:18:11 +02:00 
			
		
		
		
	lavfi/framesync: avoid forcing frame writability unnecessarily
Callers of ff_framesync_get_frame() generally do not expect the result to be writable, those that do (e.g. ff_framesync_dualinput_get_writable()) ensure writability themselves. Significantly reduces memory consumption in complex graphs with framesync-based filters (e.g. scale, ssim). Reported-By: Mark Shwartzman
This commit is contained in:
		| @@ -273,7 +273,6 @@ int ff_framesync_get_frame(FFFrameSync *fs, unsigned in, AVFrame **rframe, | ||||
|     AVFrame *frame; | ||||
|     unsigned need_copy = 0, i; | ||||
|     int64_t pts_next; | ||||
|     int ret; | ||||
|  | ||||
|     if (!fs->in[in].frame) { | ||||
|         *rframe = NULL; | ||||
| @@ -291,10 +290,6 @@ int ff_framesync_get_frame(FFFrameSync *fs, unsigned in, AVFrame **rframe, | ||||
|         if (need_copy) { | ||||
|             if (!(frame = av_frame_clone(frame))) | ||||
|                 return AVERROR(ENOMEM); | ||||
|             if ((ret = ff_inlink_make_frame_writable(fs->parent->inputs[in], &frame)) < 0) { | ||||
|                 av_frame_free(&frame); | ||||
|                 return ret; | ||||
|             } | ||||
|         } else { | ||||
|             fs->in[in].frame = NULL; | ||||
|         } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user