Re: [FFmpeg-devel] [PATCH] ffmpeg.c: fix calculation of input file duration in seek_to_start()

2017-11-04 Thread Michael Niedermayer
On Sun, Oct 29, 2017 at 03:09:13PM +0100, Peter Große wrote:
> On Sun, 29 Oct 2017 14:56:20 +0100
> Moritz Barsnick  wrote:
> 
> > On Sun, Oct 29, 2017 at 12:08:05 +0100, Peter Große wrote:
> > >  } else duration = 1;  
> > 
> > For style/readability, the statement should be on a new line, perhaps
> > even with brackets. (Not necessarily as part of this patch though.)
> 
> Sure.
> 
> Regards
> Peter

>  ffmpeg.c |7 +--
>  1 file changed, 5 insertions(+), 2 deletions(-)
> ad25b12935744d7c3a6b169bb7585c89f4f70c4d  
> 0001-ffmpeg.c-fix-code-style-in-seek_to_start.patch
> From 14032f4185a0824b819b062068f5777a33057ece Mon Sep 17 00:00:00 2001
> From: =?UTF-8?q?Peter=20Gro=C3=9Fe?= 
> Date: Sun, 29 Oct 2017 15:07:12 +0100
> Subject: [PATCH] ffmpeg.c: fix code style in seek_to_start
> MIME-Version: 1.0
> Content-Type: text/plain; charset=UTF-8
> Content-Transfer-Encoding: 8bit
> To: ffmpeg-devel@ffmpeg.org

patchset applied

thx

[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Those who are too smart to engage in politics are punished by being
governed by those who are dumber. -- Plato 


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


Re: [FFmpeg-devel] [PATCH] ffmpeg.c: fix calculation of input file duration in seek_to_start()

2017-11-04 Thread Peter Große
On Sun, 29 Oct 2017 21:45:04 +0100
Peter Große  wrote:

> On Sun, 29 Oct 2017 21:33:10 +0100
> Michael Niedermayer  wrote:
> 
> > seems this doesnt apply
> >   
> 
> Yeah, it depends on the patch I started the thread with.
> 
> I can swap the order of the two patches if you want, so that the
> style fix can go in first. But they will depend on each other either way,
> since their contexts overlap.

Which one do you prefer?

Regards
Peter


pgplZ2OUs77IG.pgp
Description: OpenPGP digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] ffmpeg.c: fix calculation of input file duration in seek_to_start()

2017-10-29 Thread Peter Große
On Sun, 29 Oct 2017 21:33:10 +0100
Michael Niedermayer  wrote:

> seems this doesnt apply
> 

Yeah, it depends on the patch I started the thread with.

I can swap the order of the two patches if you want, so that the
style fix can go in first. But they will depend on each other either way, since
their contexts overlap.

Regards
Peter


pgpSF5H4zdVVN.pgp
Description: OpenPGP digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] ffmpeg.c: fix calculation of input file duration in seek_to_start()

2017-10-29 Thread Michael Niedermayer
On Sun, Oct 29, 2017 at 03:09:13PM +0100, Peter Große wrote:
> On Sun, 29 Oct 2017 14:56:20 +0100
> Moritz Barsnick  wrote:
> 
> > On Sun, Oct 29, 2017 at 12:08:05 +0100, Peter Große wrote:
> > >  } else duration = 1;  
> > 
> > For style/readability, the statement should be on a new line, perhaps
> > even with brackets. (Not necessarily as part of this patch though.)
> 
> Sure.
> 
> Regards
> Peter

>  ffmpeg.c |7 +--
>  1 file changed, 5 insertions(+), 2 deletions(-)
> ad25b12935744d7c3a6b169bb7585c89f4f70c4d  
> 0001-ffmpeg.c-fix-code-style-in-seek_to_start.patch
> From 14032f4185a0824b819b062068f5777a33057ece Mon Sep 17 00:00:00 2001
> From: =?UTF-8?q?Peter=20Gro=C3=9Fe?= 
> Date: Sun, 29 Oct 2017 15:07:12 +0100
> Subject: [PATCH] ffmpeg.c: fix code style in seek_to_start
> MIME-Version: 1.0
> Content-Type: text/plain; charset=UTF-8
> Content-Transfer-Encoding: 8bit
> To: ffmpeg-devel@ffmpeg.org
> 
> Signed-off-by: Peter Große 
> ---
>  fftools/ffmpeg.c | 7 +--
>  1 file changed, 5 insertions(+), 2 deletions(-)

seems this doesnt apply

Applying: ffmpeg.c: fix code style in seek_to_start
error: sha1 information is lacking or useless (fftools/ffmpeg.c).
error: could not build fake ancestor
Patch failed at 0001 ffmpeg.c: fix code style in seek_to_start
The copy of the patch that failed is found in: .git/rebase-apply/patch
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".


[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

There will always be a question for which you do not know the correct answer.


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


Re: [FFmpeg-devel] [PATCH] ffmpeg.c: fix calculation of input file duration in seek_to_start()

2017-10-29 Thread Peter Große
On Sun, 29 Oct 2017 14:56:20 +0100
Moritz Barsnick  wrote:

> On Sun, Oct 29, 2017 at 12:08:05 +0100, Peter Große wrote:
> >  } else duration = 1;  
> 
> For style/readability, the statement should be on a new line, perhaps
> even with brackets. (Not necessarily as part of this patch though.)

Sure.

Regards
Peter
From 14032f4185a0824b819b062068f5777a33057ece Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Peter=20Gro=C3=9Fe?= 
Date: Sun, 29 Oct 2017 15:07:12 +0100
Subject: [PATCH] ffmpeg.c: fix code style in seek_to_start
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
To: ffmpeg-devel@ffmpeg.org

Signed-off-by: Peter Große 
---
 fftools/ffmpeg.c | 7 +--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c
index 17b594bac8..1e43b959da 100644
--- a/fftools/ffmpeg.c
+++ b/fftools/ffmpeg.c
@@ -4140,14 +4140,17 @@ static int seek_to_start(InputFile *ifile, AVFormatContext *is)
 AVRational sample_rate = {1, avctx->sample_rate};
 
 duration = av_rescale_q(ist->nb_samples, sample_rate, ist->st->time_base);
-} else
+} else {
 continue;
+}
 } else {
 if (ist->framerate.num) {
 duration = av_rescale_q(1, av_inv_q(ist->framerate), ist->st->time_base);
 } else if (ist->st->avg_frame_rate.num) {
 duration = av_rescale_q(1, av_inv_q(ist->st->avg_frame_rate), ist->st->time_base);
-} else duration = 1;
+} else {
+duration = 1;
+}
 }
 if (!ifile->duration)
 ifile->time_base = ist->st->time_base;
-- 
2.13.6

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


Re: [FFmpeg-devel] [PATCH] ffmpeg.c: fix calculation of input file duration in seek_to_start()

2017-10-29 Thread Moritz Barsnick
On Sun, Oct 29, 2017 at 12:08:05 +0100, Peter Große wrote:
>  } else duration = 1;

For style/readability, the statement should be on a new line, perhaps
even with brackets. (Not necessarily as part of this patch though.)

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


[FFmpeg-devel] [PATCH] ffmpeg.c: fix calculation of input file duration in seek_to_start()

2017-10-29 Thread Peter Große
Fixes looping files without audio or when using stream_copy, where
ist->nb_samples is not set since no decoding is done.

This fixes ticket #5719 and also fixes an endless loop with the sample
in ticket #6139.

Signed-off-by: Peter Große 
---
 fftools/ffmpeg.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c
index cabc6864e7..17b594bac8 100644
--- a/fftools/ffmpeg.c
+++ b/fftools/ffmpeg.c
@@ -4144,9 +4144,9 @@ static int seek_to_start(InputFile *ifile, 
AVFormatContext *is)
 continue;
 } else {
 if (ist->framerate.num) {
-duration = av_rescale_q(1, ist->framerate, ist->st->time_base);
+duration = av_rescale_q(1, av_inv_q(ist->framerate), 
ist->st->time_base);
 } else if (ist->st->avg_frame_rate.num) {
-duration = av_rescale_q(1, ist->st->avg_frame_rate, 
ist->st->time_base);
+duration = av_rescale_q(1, av_inv_q(ist->st->avg_frame_rate), 
ist->st->time_base);
 } else duration = 1;
 }
 if (!ifile->duration)
-- 
2.13.6

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