Merge commit '488a0fa689
'
* commit '488a0fa689
':
avconv: support -t as an input option.
Conflicts:
Changelog
ffmpeg.h
Merged-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
commit
b7fc2693c7
5 changed files with 19 additions and 3 deletions
11
ffmpeg.c
11
ffmpeg.c
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue