Bug#718805: Re: Re: Re: Bug#718805: /usr/bin/avconv: avconv cannot grab video4linux2 device

Nikolay Shaplov dhyan at nataraj.su
Tue Jan 21 13:30:36 UTC 2014


On Monday 20 January 2014 13:31:01 you wrote:

Got it!

====================
commit 94a417acc05cc5151b473abc0bf51fad26f8c5a0
Author: Anton Khirnov <anton at khirnov.net>
Date:   Thu Dec 12 07:34:13 2013 +0100

    mathematics: remove asserts from av_rescale_rnd()
    
    It is a public function, it must not assert on its parameters.

diff --git a/libavutil/mathematics.c b/libavutil/mathematics.c
index 137683e..1a38f64 100644
--- a/libavutil/mathematics.c
+++ b/libavutil/mathematics.c
@@ -23,7 +23,6 @@
  * miscellaneous math routines and tables
  */
 
-#include <assert.h>
 #include <stdint.h>
 #include <limits.h>
 
@@ -58,9 +57,9 @@ int64_t av_gcd(int64_t a, int64_t b){
 
 int64_t av_rescale_rnd(int64_t a, int64_t b, int64_t c, enum AVRounding rnd){
     int64_t r=0;
-    assert(c > 0);
-    assert(b >=0);
-    assert((unsigned)rnd<=5 && rnd!=4);
+
+    if (c <= 0 || b < 0 || rnd == 4 || rnd > 5)
+        return INT64_MIN;
 
     if(a<0 && a != INT64_MIN) return -av_rescale_rnd(-a, b, c, rnd ^ 
((rnd>>1)&1));
 
===================================

They've just removed these asserts. O_o

> On Mon, Jan 20, 2014 at 1:16 PM, Nikolay Shaplov <dhyan at nataraj.su> wrote:
> >> Just let me know if you need instructions how to do the bisect.
> > 
> > I think, I need these instructions.
> > 
> >> Thanks for your understanding and assistance.
> 
> No Problem.
> 
> First, we need to compile a recent version of libav to check that your
> test environment is OK.
> 
> $ git clone git://git.libav.org/libav.git
> $ cd libav
> $ git checkout v10_alpha1
> $ ./configure --enable-gpl && make -j4 avplay
> $ ./avplay -i /dev/video1
> 
> According to your latest comment, I would expect this one to work.
> 
> Now we checkout a version that is known to fail:
> 
> $ git checkout v9
> $ make distclean
> $ ./configure --enable-gpl && make -j4 avplay
> $ ./avplay -i /dev/video1
> 
> Based on your comments, I would expect this to expose the buggy behavior.
> 
> If you reached to this point, we can now start bisecting.
> 
> $ git bisect start v9 v10_alpha1
> $ ./configure --enable-gpl && make -j4 avplay
> $ ./avplay -i /dev/video1
> 
> The first command will checkout a version in the middle between  v9
> and v10_alpha1, the following command check if it works or not. If the
> chosen commit works for you, you issue a:
> 
> $ git bisect bad
> 
> if it fails for you, then you do a
> 
> $ git bisect good
> 
> (note that "good" means that the avplay fails for you, and "bad" means
> that it works. This logic is reversed, because bisect was actually
> written to find "bad" commits. Here, we are looking for a commit that
> repairs things for you.)
> 
> After each case, you again compile and test again:
> 
> $ ./configure --enable-gpl && make -j4 avplay
> $ ./avplay -i /dev/video1
> 
> (if you get a compilation failure, try a "make distclean")
> 
> 
> At the end of the process, git will present you the commit that fixes
> the issue as the "bad" commit. Please paste me the output of git here.
> 
> Best of luck,
> Reinhard



More information about the pkg-multimedia-maintainers mailing list