Commit bf2590ae authored by Rodger Combs's avatar Rodger Combs Committed by Michael Niedermayer

ffmpeg: fix -copy_prior_start 0 with -copyts and input -ss

Also rearranged the relevant check to reduce code duplication
Signed-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent acb430e4
...@@ -1804,7 +1804,6 @@ static void do_streamcopy(InputStream *ist, OutputStream *ost, const AVPacket *p ...@@ -1804,7 +1804,6 @@ static void do_streamcopy(InputStream *ist, OutputStream *ost, const AVPacket *p
InputFile *f = input_files [ist->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 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 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);
AVPicture pict; AVPicture pict;
AVPacket opkt; AVPacket opkt;
...@@ -1814,13 +1813,13 @@ static void do_streamcopy(InputStream *ist, OutputStream *ost, const AVPacket *p ...@@ -1814,13 +1813,13 @@ static void do_streamcopy(InputStream *ist, OutputStream *ost, const AVPacket *p
!ost->copy_initial_nonkeyframes) !ost->copy_initial_nonkeyframes)
return; return;
if (pkt->pts == AV_NOPTS_VALUE) { if (!ost->frame_number && !ost->copy_prior_start) {
if (!ost->frame_number && ist->pts < start_time && int64_t comp_start = start_time;
!ost->copy_prior_start) if (copy_ts && f->start_time != AV_NOPTS_VALUE)
return; comp_start = FFMAX(start_time, f->start_time + f->ts_offset);
} else { if (pkt->pts == AV_NOPTS_VALUE ?
if (!ost->frame_number && pkt->pts < ist_tb_start_time && ist->pts < comp_start :
!ost->copy_prior_start) pkt->pts < av_rescale_q(comp_start, AV_TIME_BASE_Q, ist->st->time_base))
return; return;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment