diff dvdread/dvd_input.c @ 24050:1542693b2a30

Sync libdvdread with version 0.9.5 (cosmetic changes).
author diego
date Wed, 15 Aug 2007 11:57:30 +0000
parents de28f9e8cb00
children dcf5fe229d37
line wrap: on
line diff
--- a/dvdread/dvd_input.c	Wed Aug 15 11:49:17 2007 +0000
+++ b/dvdread/dvd_input.c	Wed Aug 15 11:57:30 2007 +0000
@@ -1,3 +1,4 @@
+/* -*- c-basic-offset: 2; indent-tabs-mode: nil -*- */
 /*
  * Copyright (C) 2002 Samuel Hocevar <sam@zoy.org>,
  *                    Håkan Hjort <d95hjort@dtek.chalmers.se>
@@ -212,7 +213,7 @@
 
   pos = lseek(dev->fd, pos, SEEK_SET);
   if(pos < 0) {
-      return pos;
+    return pos;
   }
   /* assert pos % DVD_VIDEO_LB_LEN == 0 */
   return (int) (pos / DVD_VIDEO_LB_LEN);
@@ -234,7 +235,7 @@
   size_t len;
   ssize_t ret;
   unsigned char *buf = buffer;
-  
+
   len = (size_t)blocks * DVD_VIDEO_LB_LEN;
   
   while(len > 0) {
@@ -250,7 +251,7 @@
     
     if(ret == 0) {
       /* Nothing more to read.  Return the whole blocks, if any, that we got.
-	 and adjust the file possition back to the previous block boundary. */
+         and adjust the file possition back to the previous block boundary. */
       size_t bytes = (size_t)blocks * DVD_VIDEO_LB_LEN - len;
       off_t over_read = -(bytes % DVD_VIDEO_LB_LEN);
       /*off_t pos =*/ lseek(dev->fd, over_read, SEEK_CUR);
@@ -326,7 +327,7 @@
   }
 
   verbose = get_verbose();
-
+  
 #ifdef HAVE_DVDCSS_DVDCSS_H
   /* linking to libdvdcss */
   dvdcss_library = &dvdcss_library;  /* Give it some value != NULL */
@@ -336,7 +337,7 @@
 #else
 
   dvdcss_library = dlopen("libdvdcss.so.2", RTLD_LAZY);
-  
+
   if(dvdcss_library != NULL) {
 #if defined(__OpenBSD__) && !defined(__ELF__)
 #define U_S "_"
@@ -360,37 +361,37 @@
 
     if(dlsym(dvdcss_library, U_S "dvdcss_crack")) {
       if(verbose >= 0) {
-      fprintf(stderr, 
-	      "libdvdread: Old (pre-0.0.2) version of libdvdcss found.\n"
-	      "libdvdread: You should get the latest version from "
-	      "http://www.videolan.org/\n" );
+        fprintf(stderr, 
+                "libdvdread: Old (pre-0.0.2) version of libdvdcss found.\n"
+                "libdvdread: You should get the latest version from "
+                "http://www.videolan.org/\n" );
       }
       dlclose(dvdcss_library);
       dvdcss_library = NULL;
     } else if(!DVDcss_open  || !DVDcss_close || !DVDcss_title || !DVDcss_seek
-	      || !DVDcss_read || !DVDcss_error || !dvdcss_version) {
+              || !DVDcss_read || !DVDcss_error || !dvdcss_version) {
       if(verbose >= 0) {
-      fprintf(stderr,  "libdvdread: Missing symbols in libdvdcss.so.2, "
-	      "this shouldn't happen !\n");
+        fprintf(stderr,  "libdvdread: Missing symbols in libdvdcss.so.2, "
+                "this shouldn't happen !\n");
       }
       dlclose(dvdcss_library);
       dvdcss_library = NULL;
     }
   }
 #endif /* HAVE_DVDCSS_DVDCSS_H */
-  
+
   dvdcss_library_init = 1;
   
   if(dvdcss_library) {
     /*
-    char *psz_method = getenv( "DVDCSS_METHOD" );
-    char *psz_verbose = getenv( "DVDCSS_VERBOSE" );
-    fprintf(stderr, "DVDCSS_METHOD %s\n", psz_method);
-    fprintf(stderr, "DVDCSS_VERBOSE %s\n", psz_verbose);
+      char *psz_method = getenv( "DVDCSS_METHOD" );
+      char *psz_verbose = getenv( "DVDCSS_VERBOSE" );
+      fprintf(stderr, "DVDCSS_METHOD %s\n", psz_method);
+      fprintf(stderr, "DVDCSS_VERBOSE %s\n", psz_verbose);
     */
     if(verbose >= 1) {
-    fprintf(stderr, "libdvdread: Using libdvdcss version %s for DVD access\n",
-	    *dvdcss_version);
+      fprintf(stderr, "libdvdread: Using libdvdcss version %s for DVD access\n",
+              *dvdcss_version);
     }
     /* libdvdcss wrapper functions */
     dvdinput_open  = css_open;
@@ -403,7 +404,7 @@
     
   } else {
     if(verbose >= 1) {
-    fprintf(stderr, "libdvdread: Encrypted DVD support unavailable.\n");
+      fprintf(stderr, "libdvdread: Encrypted DVD support unavailable.\n");
     }
     /* libdvdcss replacement functions */
     dvdinput_open  = file_open;