[libdvdcss-devel] Initialize i_pos from the global dvdcss struct in dvdcss_open().

Diego Biurrun git at videolan.org
Fri Nov 14 16:45:57 CET 2014


libdvdcss | branch: master | Diego Biurrun <diego at biurrun.de> | Wed Nov 12 23:55:11 2014 +0100| [0210469b0eb21bf8dc1f71ba0106c1b55f0fcaa8] | committer: Diego Biurrun

Initialize i_pos from the global dvdcss struct in dvdcss_open().

This is a more suitable place than libc_open().

> http://git.videolan.org/gitweb.cgi/libdvdcss.git/?a=commit;h=0210469b0eb21bf8dc1f71ba0106c1b55f0fcaa8
---

 src/device.c    |    2 --
 src/libdvdcss.c |    1 +
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/src/device.c b/src/device.c
index d62561c..13826f8 100644
--- a/src/device.c
+++ b/src/device.c
@@ -455,8 +455,6 @@ static int libc_open ( dvdcss_t dvdcss, const char *psz_device )
         return -1;
     }
 
-    dvdcss->i_pos = 0;
-
     return 0;
 }
 
diff --git a/src/libdvdcss.c b/src/libdvdcss.c
index 0eb2298..1a7d42a 100644
--- a/src/libdvdcss.c
+++ b/src/libdvdcss.c
@@ -473,6 +473,7 @@ LIBDVDCSS_EXPORT dvdcss_t dvdcss_open ( const char *psz_target )
     }
 
     /* Initialize structure with default values. */
+    dvdcss->i_pos = 0;
     dvdcss->p_titles = NULL;
     dvdcss->psz_device = strdup( psz_target );
     dvdcss->psz_error = "no error";



More information about the libdvdcss-devel mailing list