summaryrefslogtreecommitdiff
path: root/ffmpeg.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-12-19 00:08:37 +0100
committerMichael Niedermayer <michaelni@gmx.at>2012-12-19 00:08:37 +0100
commitc4a32d92fee36e222bd0bcfba482e9d649507073 (patch)
tree86a415ee3778cdd72871120a5bd3d1c387b99d65 /ffmpeg.c
parent1b9ced685afb452b16386c314bd2ced7ee6bdb04 (diff)
downloadffmpeg-c4a32d92fee36e222bd0bcfba482e9d649507073.tar.gz
ffmpeg: Fix shortest with libx264
Encoders that buffer a significant number of frames where a "few" frames off with -shortest Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'ffmpeg.c')
-rw-r--r--ffmpeg.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/ffmpeg.c b/ffmpeg.c
index 36e9c2b23d..feff2c4f9e 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -597,9 +597,8 @@ static void close_output_stream(OutputStream *ost)
ost->finished = 1;
if (of->shortest) {
- int i;
- for (i = 0; i < of->ctx->nb_streams; i++)
- output_streams[of->ost_index + i]->finished = 1;
+ int64_t end = av_rescale_q(ost->sync_opts - ost->first_pts, ost->st->codec->time_base, AV_TIME_BASE_Q);
+ of->recording_time = FFMIN(of->recording_time, end);
}
}