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

Diego Biurrun diego at biurrun.de
Thu Nov 13 14:08:14 CET 2014


This is a more suitable place than libc_open().
---
 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 e824b54..07e0a17 100644
--- a/src/device.c
+++ b/src/device.c
@@ -456,8 +456,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 91f83cd..b5911fd 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";
-- 
2.1.0



More information about the libdvdcss-devel mailing list