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

Petri Hintukainen phintuka at gmail.com
Sat Feb 7 14:47:40 CET 2015


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.




More information about the libdvdnav-devel mailing list