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

Thomas Guillem thomas at gllm.fr
Wed Jan 28 16:30:31 CET 2015


---
 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);
-- 
2.1.3



More information about the libdvdnav-devel mailing list