Index: dvdnav/dvdnav.c =================================================================== --- dvdnav/dvdnav.c (revision 25722) +++ dvdnav/dvdnav.c (working copy) @@ -108,8 +108,12 @@ strncpy(this->path, path, MAX_PATH_LEN - 1); this->path[MAX_PATH_LEN - 1] = '\0'; +// FIXME: CTP +fprintf(stderr, "CTP: calling DVDOpenFile()\n"); /* Pre-open and close a file so that the CSS-keys are cached. */ this->file = DVDOpenFile(vm_get_dvd_reader(this->vm), 0, DVD_READ_MENU_VOBS); +// FIXME: CTP +fprintf(stderr, "CTP: done calling DVDOpenFile()\n"); /* Start the read-ahead cache. */ this->cache = dvdnav_read_cache_new(this); Index: dvdread/dvd_reader.c =================================================================== --- dvdread/dvd_reader.c (revision 25722) +++ dvdread/dvd_reader.c (working copy) @@ -228,7 +228,11 @@ dvd_reader_t *dvd; dvd_input_t dev; +// FIXME: CTP +fprintf( stderr, "CTP: DVDOpenImageFile(%s) before dvdinput_open\n", location ); dev = dvdinput_open( location ); +// FIXME: CTP +fprintf( stderr, "CTP: DVDOpenImageFile(%s) after dvdinput_open\n", location ); if( !dev ) { fprintf( stderr, "libdvdread: Can't open %s for reading\n", location ); return NULL; Index: dvdread/dvd_input.c =================================================================== --- dvdread/dvd_input.c (revision 25722) +++ dvdread/dvd_input.c (working copy) @@ -27,6 +27,7 @@ #include "config.h" #include "dvdread/dvd_reader.h" #include "dvd_input.h" +#include "remotefile_wrapper.h" /* The function pointers that is the exported interface of this file. */ @@ -161,6 +162,8 @@ { dvd_input_t dev; +// FIXME: CTP +fprintf(stderr, "CTP: Inside file_open(%s)\n", target); /* Allocate the library structure */ dev = (dvd_input_t) malloc(sizeof(*dev)); if(dev == NULL) { @@ -170,9 +173,11 @@ /* Open the device */ #if !defined(WIN32) && !defined(__OS2__) - dev->fd = open(target, O_RDONLY); +//CTP dev->fd = open(target, O_RDONLY); + dev->fd = remotefile_open(target, O_RDONLY); #else - dev->fd = open(target, O_RDONLY | O_BINARY); +//CTP dev->fd = open(target, O_RDONLY | O_BINARY); + dev->fd = remotefile_open(target, O_RDONLY | O_BINARY); #endif if(dev->fd < 0) { perror("libdvdread: Could not open input"); @@ -199,7 +204,10 @@ { off_t pos; - pos = lseek(dev->fd, (off_t)blocks * (off_t)DVD_VIDEO_LB_LEN, SEEK_SET); +// FIXME: CTP +fprintf(stderr, "CTP: Inside file_seek(%d), seeking to offset %d\n", dev->fd, blocks); +//CTP pos = lseek(dev->fd, (off_t)blocks * (off_t)DVD_VIDEO_LB_LEN, SEEK_SET); + pos = remotefile_seek(dev->fd, (off_t)blocks * (off_t)DVD_VIDEO_LB_LEN, SEEK_SET); if(pos < 0) { return pos; } @@ -225,9 +233,12 @@ len = (size_t)blocks * DVD_VIDEO_LB_LEN; +// FIXME: CTP +fprintf(stderr, "CTP: Inside file_read(%d), reading %d blocks\n", dev->fd, blocks); while(len > 0) { - ret = read(dev->fd, buffer, len); +//CTP ret = read(dev->fd, buffer, len); + ret = remotefile_read(dev->fd, buffer, len); if(ret < 0) { /* One of the reads failed, too bad. We won't even bother @@ -241,7 +252,8 @@ * Adjust the file position 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); +//CTP /*off_t pos =*/ lseek(dev->fd, over_read, SEEK_CUR); + /*off_t pos =*/ remotefile_seek(dev->fd, over_read, SEEK_CUR); /* should have pos % 2048 == 0 */ return (int) (bytes / DVD_VIDEO_LB_LEN); } @@ -259,7 +271,10 @@ { int ret; - ret = close(dev->fd); +// FIXME: CTP +fprintf(stderr, "CTP: Inside file_close(%d)\n", dev->fd); +//CTP ret = close(dev->fd); + ret = remotefile_close(dev->fd); if(ret < 0) return ret; Index: libmythdvdnav.pro =================================================================== --- libmythdvdnav.pro (revision 25722) +++ libmythdvdnav.pro (working copy) @@ -12,6 +12,7 @@ # for -ldl LIBS += $$EXTRA_LIBS +LIBS += -L../libmythdb -lmythdb-$$LIBVERSION DEFINES += HAVE_AV_CONFIG_H