Re: [FFmpeg-devel] [PATCH] ffmpeg: fix -copy_prior_start 0 with -copyts and input -ss

2015-11-20 Thread Michael Niedermayer
On Sun, Nov 01, 2015 at 08:04:25PM -0600, Rodger Combs wrote:
> Also rearranged the relevant check to reduce code duplication
> ---
>  ffmpeg.c | 15 +++
>  1 file changed, 7 insertions(+), 8 deletions(-)

applied

thanks

PS: can this be tested in fate ?

[...]
-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Why not whip the teacher when the pupil misbehaves? -- Diogenes of Sinope


signature.asc
Description: Digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH] ffmpeg: fix -copy_prior_start 0 with -copyts and input -ss

2015-11-01 Thread Rodger Combs
Also rearranged the relevant check to reduce code duplication
---
 ffmpeg.c | 15 +++
 1 file changed, 7 insertions(+), 8 deletions(-)

diff --git a/ffmpeg.c b/ffmpeg.c
index dbb2520..526f094 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -1760,7 +1760,6 @@ static void do_streamcopy(InputStream *ist, OutputStream 
*ost, const AVPacket *p
 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);
 AVPicture pict;
 AVPacket opkt;
 
@@ -1770,13 +1769,13 @@ static void do_streamcopy(InputStream *ist, 
OutputStream *ost, const AVPacket *p
 !ost->copy_initial_nonkeyframes)
 return;
 
-if (pkt->pts == AV_NOPTS_VALUE) {
-if (!ost->frame_number && ist->pts < start_time &&
-!ost->copy_prior_start)
-return;
-} else {
-if (!ost->frame_number && pkt->pts < ist_tb_start_time &&
-!ost->copy_prior_start)
+if (!ost->frame_number && !ost->copy_prior_start) {
+int64_t comp_start = start_time;
+if (copy_ts && f->start_time != AV_NOPTS_VALUE)
+comp_start = FFMAX(start_time, f->start_time + f->ts_offset);
+if (pkt->pts == AV_NOPTS_VALUE ?
+ist->pts < comp_start :
+pkt->pts < av_rescale_q(comp_start, AV_TIME_BASE_Q, 
ist->st->time_base))
 return;
 }
 
-- 
2.6.2

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel