|
|
|
@ -113,6 +113,7 @@ static void init_options(OptionsContext *o) |
|
|
|
|
memset(o, 0, sizeof(*o)); |
|
|
|
|
|
|
|
|
|
o->mux_max_delay = 0.7; |
|
|
|
|
o->start_time = AV_NOPTS_VALUE; |
|
|
|
|
o->recording_time = INT64_MAX; |
|
|
|
|
o->limit_filesize = UINT64_MAX; |
|
|
|
|
o->chapters_input_file = INT_MAX; |
|
|
|
@ -658,13 +659,13 @@ static int open_input_file(OptionsContext *o, const char *filename) |
|
|
|
|
exit_program(1); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
timestamp = o->start_time; |
|
|
|
|
timestamp = (o->start_time == AV_NOPTS_VALUE) ? 0 : o->start_time; |
|
|
|
|
/* add the stream start time */ |
|
|
|
|
if (ic->start_time != AV_NOPTS_VALUE) |
|
|
|
|
timestamp += ic->start_time; |
|
|
|
|
|
|
|
|
|
/* if seeking requested, we execute it */ |
|
|
|
|
if (o->start_time != 0) { |
|
|
|
|
if (o->start_time != AV_NOPTS_VALUE) { |
|
|
|
|
ret = av_seek_frame(ic, -1, timestamp, AVSEEK_FLAG_BACKWARD); |
|
|
|
|
if (ret < 0) { |
|
|
|
|
av_log(NULL, AV_LOG_WARNING, "%s: could not seek to position %0.3f\n", |
|
|
|
@ -1212,7 +1213,8 @@ static int copy_chapters(InputFile *ifile, OutputFile *ofile, int copy_metadata) |
|
|
|
|
|
|
|
|
|
for (i = 0; i < is->nb_chapters; i++) { |
|
|
|
|
AVChapter *in_ch = is->chapters[i], *out_ch; |
|
|
|
|
int64_t ts_off = av_rescale_q(ofile->start_time - ifile->ts_offset, |
|
|
|
|
int64_t start_time = (ofile->start_time == AV_NOPTS_VALUE) ? 0 : ofile->start_time; |
|
|
|
|
int64_t ts_off = av_rescale_q(start_time - ifile->ts_offset, |
|
|
|
|
AV_TIME_BASE_Q, in_ch->time_base); |
|
|
|
|
int64_t rt = (ofile->recording_time == INT64_MAX) ? INT64_MAX : |
|
|
|
|
av_rescale_q(ofile->recording_time, AV_TIME_BASE_Q, in_ch->time_base); |
|
|
|
|