[libdvdnav-devel] [PATCH] dvd_input: always init dev->dvdcss

Jean-Baptiste Kempf jb at videolan.org
Sat Feb 7 15:03:16 CET 2015


On 07 Feb, Petri Hintukainen wrote :
> On ke, 2015-01-28 at 16:30 +0100, Thomas Guillem wrote:
> > ---
> >  src/dvd_input.c | 8 +++++---
> >  1 file changed, 5 insertions(+), 3 deletions(-)
> > 
> > diff --git a/src/dvd_input.c b/src/dvd_input.c
> > index 89ccec4..1832fde 100644
> > --- a/src/dvd_input.c
> > +++ b/src/dvd_input.c
> > @@ -99,10 +99,12 @@ static dvd_input_t css_open(const char *target,
> >    if(target)
> >        dev->dvdcss = DVDcss_open(target);
> >    else if(stream && stream_cb) {
> > -#ifndef HAVE_DVDCSS_DVDCSS_H
> > -    if (DVDcss_open_stream)
> > -#endif
> > +#ifdef HAVE_DVDCSS_DVDCSS_H
> >        dev->dvdcss = DVDcss_open_stream(stream, (dvdcss_stream_cb *)stream_cb);
> > +#endif
> > +      dev->dvdcss = DVDcss_open_stream ?
> > +                    DVDcss_open_stream(stream, (dvdcss_stream_cb *)stream_cb) :
> > +                    NULL;
> >    }
> >    if(dev->dvdcss == 0) {
> >      fprintf(stderr, "libdvdread: Could not open %s with libdvdcss.\n", target);
> 
> Is this correct ? Looks like DVDcss_open_stream() is called twice if
> HAVE_DVDCSS_DVDCSS_H is defined.

Probably not ;)
It seems to miss an #else, no?

With my kindest regards,

-- 
Jean-Baptiste Kempf
http://www.jbkempf.com/ - +33 672 704 734
Sent from my Electronic Device


More information about the libdvdnav-devel mailing list