diff options
author | Nicolas George <george@nsup.org> | 2017-04-06 10:40:12 +0200 |
---|---|---|
committer | Nicolas George <george@nsup.org> | 2017-09-08 10:31:07 +0200 |
commit | 8043d8eb3bf5e93709212850feb3441b9ec41b25 (patch) | |
tree | 4eeba0bec927eb12487b903f5dc1c3527f5eb588 | |
parent | 5ba2aef6ec47689300debd3ddd1f39cad010a971 (diff) | |
download | ffmpeg-8043d8eb3bf5e93709212850feb3441b9ec41b25.tar.gz |
ffmpeg: send EOF pts to filters.
-rw-r--r-- | ffmpeg.c | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -2223,14 +2223,14 @@ static int ifilter_send_frame(InputFilter *ifilter, AVFrame *frame) return 0; } -static int ifilter_send_eof(InputFilter *ifilter) +static int ifilter_send_eof(InputFilter *ifilter, int64_t pts) { int i, j, ret; ifilter->eof = 1; if (ifilter->filter) { - ret = av_buffersrc_add_frame_flags(ifilter->filter, NULL, AV_BUFFERSRC_FLAG_PUSH); + ret = av_buffersrc_close(ifilter->filter, pts, AV_BUFFERSRC_FLAG_PUSH); if (ret < 0) return ret; } else { @@ -2581,8 +2581,12 @@ out: static int send_filter_eof(InputStream *ist) { int i, ret; + /* TODO keep pts also in stream time base to avoid converting back */ + int64_t pts = av_rescale_q_rnd(ist->pts, AV_TIME_BASE_Q, ist->st->time_base, + AV_ROUND_NEAR_INF | AV_ROUND_PASS_MINMAX); + for (i = 0; i < ist->nb_filters; i++) { - ret = ifilter_send_eof(ist->filters[i]); + ret = ifilter_send_eof(ist->filters[i], pts); if (ret < 0) return ret; } |