[Ffmpeg-devel] MPEG2 seeking broken

Michael Niedermayer michaelni
Thu Apr 20 00:58:33 CEST 2006


Hi

On Wed, Apr 19, 2006 at 05:26:26PM -0300, Rodrigo Severo wrote:
> On 4/19/06, Steve Lhomme <steve.lhomme at free.fr> wrote:
> > Rodrigo Severo wrote:
> > > On 4/19/06, Mike Melanson <mike at multimedia.cx> wrote:
> > >> Michael Niedermayer wrote:
> > >>>> +    assert(ref_picture != NULL);
> > >>>> +    if (ref_picture == NULL) {
> > >>>
> > >>> is not acceptable
> > >> What's the policy? No asserts?
> > >
> > >
> > > I believe I can answer this one:
> > >
> > > You asserted that ref_picture != NULL and them creates some condition to
> > > execute in case ref_picture is NULL. It won't ever be executed.
> >
> > One is designed to catch the error during debugging, the other is
> > designed to not crash in "release" builds. Crashing a user software when
> > you know there's a potential problem is gross.
> 
> Yeah, I thought that could be so. This is the risk of answering
> without seeing the whole code.
> 
> Let's hear from Michael.

an assertion failure is a bug and should be fixed, i will not commit
code which is per design buggy (expects the assert to fail)

assert(x) means that the programmer belives x is true (and that some part of
the code depends upon this assumtation), its not for anything else, and here
its clear the programmer knows that x is not always true

the code submitted is nothing else as

if(ref_picture == NULL){
#ifdef DEBUG
    abort();
#endif
    ...
}

[...]

-- 
Michael

In the past you could go to a library and read, borrow or copy any book
Today you'd get arrested for mere telling someone where the library is





More information about the ffmpeg-devel mailing list