* 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:
Michael Niedermayer 2013-08-06 12:35:48 +02:00
commit b7fc2693c7
5 changed files with 19 additions and 3 deletions

View file

@ -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;