diff options
Diffstat (limited to 'dvdread/dvd_input.c')
-rw-r--r-- | dvdread/dvd_input.c | 41 |
1 files changed, 21 insertions, 20 deletions
diff --git a/dvdread/dvd_input.c b/dvdread/dvd_input.c index dcd5307862..fa2406f234 100644 --- a/dvdread/dvd_input.c +++ b/dvdread/dvd_input.c @@ -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 @@ static int file_seek(dvd_input_t dev, int blocks) 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 @@ static int file_read(dvd_input_t dev, void *buffer, int blocks, int flags) 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 @@ static int file_read(dvd_input_t dev, void *buffer, int blocks, int flags) 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 @@ int dvdinput_setup(void) } verbose = get_verbose(); - + #ifdef HAVE_DVDCSS_DVDCSS_H /* linking to libdvdcss */ dvdcss_library = &dvdcss_library; /* Give it some value != NULL */ @@ -336,7 +337,7 @@ int dvdinput_setup(void) #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 @@ int dvdinput_setup(void) 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 @@ int dvdinput_setup(void) } 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; |