diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-08-06 12:35:48 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-08-06 12:41:04 +0200 |
commit | b7fc2693c70fe72936e4ce124c802ac23857c476 (patch) | |
tree | 6633a69bc7ab53e1478bb2210e25b834da038aa5 /ffmpeg.c | |
parent | 6d77279ed81c5db8a9f7b895d5090c0328c12174 (diff) | |
parent | 488a0fa68973d48e264d54f1722f7afb18afbea7 (diff) | |
download | ffmpeg-b7fc2693c70fe72936e4ce124c802ac23857c476.tar.gz |
Merge commit '488a0fa68973d48e264d54f1722f7afb18afbea7'
* commit '488a0fa68973d48e264d54f1722f7afb18afbea7':
avconv: support -t as an input option.
Conflicts:
Changelog
ffmpeg.h
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'ffmpeg.c')
-rw-r--r-- | ffmpeg.c | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -1389,6 +1389,7 @@ static int check_output_constraints(InputStream *ist, OutputStream *ost) static void do_streamcopy(InputStream *ist, OutputStream *ost, const AVPacket *pkt) { OutputFile *of = output_files[ost->file_index]; + InputFile *f = input_files [ist->file_index]; int64_t start_time = (of->start_time == AV_NOPTS_VALUE) ? 0 : of->start_time; int64_t ost_tb_start_time = av_rescale_q(start_time, AV_TIME_BASE_Q, ost->st->time_base); int64_t ist_tb_start_time = av_rescale_q(start_time, AV_TIME_BASE_Q, ist->st->time_base); @@ -1417,6 +1418,16 @@ static void do_streamcopy(InputStream *ist, OutputStream *ost, const AVPacket *p return; } + if (f->recording_time != INT64_MAX) { + start_time = f->ctx->start_time; + if (f->start_time != AV_NOPTS_VALUE) + start_time += f->start_time; + if (ist->pts >= f->recording_time + start_time) { + close_output_stream(ost); + return; + } + } + /* force the input stream PTS */ if (ost->st->codec->codec_type == AVMEDIA_TYPE_AUDIO) audio_size += pkt->size; |