You've already forked FFmpeg
							
							
				mirror of
				https://github.com/FFmpeg/FFmpeg.git
				synced 2025-10-30 23:18:11 +02:00 
			
		
		
		
	avfilter/vf_tpad: handle case when no frame was ever received
This commit is contained in:
		| @@ -79,6 +79,18 @@ static int activate(AVFilterContext *ctx) | ||||
|  | ||||
|     FF_FILTER_FORWARD_STATUS_BACK(outlink, inlink); | ||||
|  | ||||
|     if (!s->eof && ff_inlink_acknowledge_status(inlink, &status, &pts)) { | ||||
|         if (status == AVERROR_EOF) { | ||||
|             pts = av_rescale_q(pts, inlink->time_base, outlink->time_base); | ||||
|             if (!s->pad_stop && !s->pad_start) { | ||||
|                 ff_outlink_set_status(outlink, status, pts); | ||||
|                 return 0; | ||||
|             } | ||||
|             s->eof = 1; | ||||
|             s->pts += pts; | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     if (s->start_mode == 0 && s->pad_start > 0 && ff_outlink_frame_wanted(outlink)) { | ||||
|         frame = ff_get_video_buffer(outlink, outlink->w, outlink->h); | ||||
|         if (!frame) | ||||
| @@ -93,7 +105,10 @@ static int activate(AVFilterContext *ctx) | ||||
|     } | ||||
|  | ||||
|     if (s->start_mode == 1 && s->pad_start > 0) { | ||||
|         if (!s->cache_start && ff_inlink_queued_frames(inlink)) { | ||||
|         if (s->eof) { | ||||
|             ff_outlink_set_status(outlink, AVERROR_EOF, 0); | ||||
|             return 0; | ||||
|         } else if (!s->cache_start && ff_inlink_queued_frames(inlink)) { | ||||
|             s->cache_start = ff_inlink_peek_frame(inlink, 0); | ||||
|         } else if (!s->cache_start) { | ||||
|             FF_FILTER_FORWARD_WANTED(outlink, inlink); | ||||
| @@ -123,18 +138,6 @@ static int activate(AVFilterContext *ctx) | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     if (!s->eof && ff_inlink_acknowledge_status(inlink, &status, &pts)) { | ||||
|         if (status == AVERROR_EOF) { | ||||
|             pts = av_rescale_q(pts, inlink->time_base, outlink->time_base); | ||||
|             if (!s->pad_stop) { | ||||
|                 ff_outlink_set_status(outlink, status, pts); | ||||
|                 return 0; | ||||
|             } | ||||
|             s->eof = 1; | ||||
|             s->pts += pts; | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     if (s->eof) { | ||||
|         if (!s->pad_stop) { | ||||
|             ff_outlink_set_status(outlink, AVERROR_EOF, s->pts); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user