[mythtv-users] What major features are planned for 0.27?
HP-mini
blm-ubunet at slingshot.co.nz
Thu Nov 22 20:27:23 UTC 2012
> I've just compared the files and, unless I've missed something, Myth is
> upto svn1239, which is effectively svn1243 as the other changes were
> only in the readme, changelog and configure files, which Myth doesn't
> use anyway.
>
That might explain why only minor changes were needed to re-sync with
svn1243.
Was naive to think that could have been an easy fix.
Here's the mythtv0.25+fixes git patch diff to sync to dvdread/nav
svn1243
Might show up on gist: 4132683
-------------- next part --------------
diff --git a/mythtv/libs/libmythdvdnav/dvdnav/dvdnav.h b/mythtv/libs/libmythdvdnav/dvdnav/dvdnav.h
index a05ae84..6abe497 100644
--- a/mythtv/libs/libmythdvdnav/dvdnav/dvdnav.h
+++ b/mythtv/libs/libmythdvdnav/dvdnav/dvdnav.h
@@ -29,7 +29,7 @@
#define MP_DVDNAV 1
// Change this only when syncing to mplayer dvdnav trunk
-#define DVDNAV_SVN_REV "svnR1215"
+#define DVDNAV_SVN_REV "svnR1243"
#ifdef __cplusplus
extern "C" {
@@ -41,7 +41,7 @@ extern "C" {
#include <dvdread/ifo_types.h> /* For vm_cmd_t */
#include <dvdnav/dvdnav_events.h>
-#include "compat.h"
+
/*********************************************************************
* dvdnav data types *
@@ -400,6 +400,9 @@ dvdnav_status_t dvdnav_absolute_time_search(dvdnav_t *self,
int dvdnav_relative_time_search(dvdnav_t *self,
int relative_time);
+dvdnav_status_t dvdnav_time_search(dvdnav_t *self,
+ uint64_t time);
+
/*
* Stop playing current position and play the "GoUp"-program chain.
* (which generally leads to the title menu or a higher-level menu).
diff --git a/mythtv/libs/libmythdvdnav/dvdnav/dvdnav_internal.h b/mythtv/libs/libmythdvdnav/dvdnav/dvdnav_internal.h
index 2f4ebfa..e78470d 100644
--- a/mythtv/libs/libmythdvdnav/dvdnav/dvdnav_internal.h
+++ b/mythtv/libs/libmythdvdnav/dvdnav/dvdnav_internal.h
@@ -25,7 +25,7 @@
#include "config.h"
#endif
-#ifdef _WIN32
+#ifdef WIN32
/* pthread_mutex_* wrapper for win32 */
#include <windows.h>
@@ -36,7 +36,7 @@ typedef CRITICAL_SECTION pthread_mutex_t;
#define pthread_mutex_unlock(a) LeaveCriticalSection(a)
#define pthread_mutex_destroy(a) DeleteCriticalSection(a)
-#if HAVE_GETTIMEOFDAY == 0
+#ifndef HAVE_GETTIMEOFDAY
/* replacement gettimeofday implementation */
#include <sys/timeb.h>
static inline int _private_gettimeofday( struct timeval *tv, void *tz )
@@ -85,7 +85,7 @@ typedef struct read_cache_s read_cache_t;
#ifndef audio_status_t
typedef struct {
-#if HAVE_BIGENDIAN
+#ifdef WORDS_BIGENDIAN
unsigned int available : 1;
unsigned int zero1 : 4;
unsigned int stream_number : 3;
@@ -101,7 +101,7 @@ typedef struct {
#ifndef spu_status_t
typedef struct {
-#if HAVE_BIGENDIAN
+#ifdef WORDS_BIGENDIAN
unsigned int available : 1;
unsigned int zero1 : 2;
unsigned int stream_number_4_3 : 5;
diff --git a/mythtv/libs/libmythdvdnav/dvdnav/searching.c b/mythtv/libs/libmythdvdnav/dvdnav/searching.c
index 4c2f67f..8092407 100644
--- a/mythtv/libs/libmythdvdnav/dvdnav/searching.c
+++ b/mythtv/libs/libmythdvdnav/dvdnav/searching.c
@@ -47,7 +47,7 @@
/* Return placed in vobu. */
/* Returns error status */
/* FIXME: Maybe need to handle seeking outside current cell. */
-static dvdnav_status_t dvdnav_scan_admap(dvdnav_t *this, int32_t domain, uint32_t seekto_block, uint32_t *vobu) {
+static dvdnav_status_t dvdnav_scan_admap(dvdnav_t *this, int32_t domain, uint32_t seekto_block, int next, uint32_t *vobu) {
vobu_admap_t *admap = NULL;
#ifdef LOG_DEBUG
@@ -73,62 +73,31 @@ static dvdnav_status_t dvdnav_scan_admap(dvdnav_t *this, int32_t domain, uint32_
}
if(admap) {
uint32_t address = 0;
- uint32_t vobu_start, next_vobu, first_address, last_address;
- int32_t found = 0;
+ uint32_t vobu_start, next_vobu;
+ int admap_entries = (admap->last_byte + 1 - VOBU_ADMAP_SIZE)/VOBU_ADMAP_SIZE;
/* Search through ADMAP for best sector */
vobu_start = SRI_END_OF_CELL;
- /* use binary search algorithm to improve efficiency */
- if (admap->last_byte > 20 &&
- admap->vobu_start_sectors[20] >= seekto_block)
- {
- while((!found) && ((address<<2) < admap->last_byte)) {
- next_vobu = admap->vobu_start_sectors[address];
-
- if (next_vobu == seekto_block) {
- vobu_start = next_vobu;
- found = 1;
- } else if (vobu_start < seekto_block && next_vobu > seekto_block) {
- found = 1;
- } else {
- vobu_start = next_vobu;
- }
- address++;
- }
- }
- else {
- found = 0;
- first_address = 0;
- last_address = admap->last_byte >> 2;
- while (first_address <= last_address)
- {
- address = (first_address + last_address) / 2;
- next_vobu = admap->vobu_start_sectors[address];
- vobu_start = next_vobu;
- if (seekto_block > next_vobu)
- first_address = address + 1;
- else if (seekto_block < next_vobu)
- last_address = address - 1;
- else {
- break;
- }
- }
- found = 1;
- if (next_vobu > seekto_block)
- vobu_start = admap->vobu_start_sectors[last_address - 1];
- }
- if(found) {
- *vobu = vobu_start;
- return DVDNAV_STATUS_OK;
- } else {
- fprintf(MSG_OUT, "libdvdnav: Could not locate block\n");
- return DVDNAV_STATUS_ERR;
+ /* FIXME: Implement a faster search algorithm */
+ while(address < admap_entries) {
+ next_vobu = admap->vobu_start_sectors[address];
+
+ /* fprintf(MSG_OUT, "libdvdnav: Found block %u\n", next_vobu); */
+
+ if(vobu_start <= seekto_block && next_vobu > seekto_block)
+ break;
+ vobu_start = next_vobu;
+ address++;
}
+ *vobu = next ? next_vobu : vobu_start;
+ return DVDNAV_STATUS_OK;
}
fprintf(MSG_OUT, "libdvdnav: admap not located\n");
return DVDNAV_STATUS_ERR;
}
+/* FIXME: right now, this function does not use the time tables but interpolates
+ only the cell times */
dvdnav_status_t dvdnav_absolute_time_search(dvdnav_t *this,
uint64_t time, uint search_to_nearest_cell) {
@@ -138,12 +107,8 @@ dvdnav_status_t dvdnav_absolute_time_search(dvdnav_t *this,
uint64_t prev_length = 0;
uint32_t first_cell_nr, last_cell_nr, cell_nr;
int32_t found;
- uint64_t offset = 0;
- float diff2 = 1.0;
-
cell_playback_t *cell;
dvd_state_t *state;
- dvdnav_status_t result;
if(this->position_current.still != 0) {
printerr("Cannot seek in a still frame.");
@@ -178,19 +143,17 @@ dvdnav_status_t dvdnav_absolute_time_search(dvdnav_t *this,
cell = &(state->pgc->cell_playback[cell_nr-1]);
if(cell->block_type == BLOCK_TYPE_ANGLE_BLOCK && cell->block_mode != BLOCK_MODE_FIRST_CELL)
continue;
- cell_length = dvdnav_convert_time(&cell->playback_time);
- length += cell_length;
- if (target <= length) {
- offset = (cell->last_sector - cell->first_sector);
- diff2 = ((double)target - (double)prev_length) / (double)cell_length;
- offset = (diff2 * offset);
- target = cell->first_sector;
- if (!search_to_nearest_cell)
- target += offset;
+ length = dvdnav_convert_time(&cell->playback_time);
+ if (target >= length) {
+ target -= length;
+ } else {
+ /* FIXME: there must be a better way than interpolation */
+ target = target * (cell->last_sector - cell->first_sector + 1) / length;
+ target += cell->first_sector;
+
found = 1;
break;
}
- prev_length = length;
}
if(found) {
@@ -199,7 +162,7 @@ dvdnav_status_t dvdnav_absolute_time_search(dvdnav_t *this,
fprintf(MSG_OUT, "libdvdnav: Seeking to cell %i from choice of %i to %i\n",
cell_nr, first_cell_nr, last_cell_nr);
#endif
- if (dvdnav_scan_admap(this, state->domain, target, &vobu) == DVDNAV_STATUS_OK) {
+ if (dvdnav_scan_admap(this, state->domain, target, 0, &vobu) == DVDNAV_STATUS_OK) {
uint32_t start = state->pgc->cell_playback[cell_nr-1].first_sector;
if (vm_jump_cell_block(this->vm, cell_nr, vobu - start)) {
@@ -223,9 +186,13 @@ dvdnav_status_t dvdnav_absolute_time_search(dvdnav_t *this,
dvdnav_status_t dvdnav_sector_search(dvdnav_t *this,
uint64_t offset, int32_t origin) {
uint32_t target = 0;
+ uint32_t current_pos;
+ uint32_t cur_sector;
+ uint32_t cur_cell_nr;
uint32_t length = 0;
uint32_t first_cell_nr, last_cell_nr, cell_nr;
int32_t found;
+ int forward = 0;
cell_playback_t *cell;
dvd_state_t *state;
dvdnav_status_t result;
@@ -252,6 +219,10 @@ dvdnav_status_t dvdnav_sector_search(dvdnav_t *this,
fprintf(MSG_OUT, "libdvdnav: Before cellN=%u blockN=%u\n", state->cellN, state->blockN);
#endif
+ current_pos = target;
+ cur_sector = this->vobu.vobu_start + this->vobu.blockN;
+ cur_cell_nr = state->cellN;
+
switch(origin) {
case SEEK_SET:
if(offset >= length) {
@@ -283,6 +254,7 @@ dvdnav_status_t dvdnav_sector_search(dvdnav_t *this,
pthread_mutex_unlock(&this->vm_lock);
return DVDNAV_STATUS_ERR;
}
+ forward = target > current_pos;
this->cur_cell_time = 0;
if (this->pgc_based) {
@@ -309,6 +281,27 @@ dvdnav_status_t dvdnav_sector_search(dvdnav_t *this,
} else {
/* convert the target sector from Cell-relative to absolute physical sector */
target += cell->first_sector;
+ if (forward && (cell_nr == cur_cell_nr)) {
+ uint32_t vobu;
+ /* if we are seeking forward from the current position, make sure
+ * we move to a new position that is after our current position.
+ * simply truncating to the vobu will go backwards */
+ if (dvdnav_scan_admap(this, state->domain, target, 0, &vobu) != DVDNAV_STATUS_OK)
+ break;
+ if (vobu <= cur_sector) {
+ if (dvdnav_scan_admap(this, state->domain, target, 1, &vobu) != DVDNAV_STATUS_OK)
+ break;
+ if (vobu > cell->last_sector) {
+ if (cell_nr == last_cell_nr)
+ break;
+ cell_nr++;
+ cell = &(state->pgc->cell_playback[cell_nr-1]);
+ target = cell->first_sector;
+ } else {
+ target = vobu;
+ }
+ }
+ }
found = 1;
break;
}
@@ -320,7 +313,7 @@ dvdnav_status_t dvdnav_sector_search(dvdnav_t *this,
fprintf(MSG_OUT, "libdvdnav: Seeking to cell %i from choice of %i to %i\n",
cell_nr, first_cell_nr, last_cell_nr);
#endif
- if (dvdnav_scan_admap(this, state->domain, target, &vobu) == DVDNAV_STATUS_OK) {
+ if (dvdnav_scan_admap(this, state->domain, target, 0, &vobu) == DVDNAV_STATUS_OK) {
int32_t start = state->pgc->cell_playback[cell_nr-1].first_sector;
if (vm_jump_cell_block(this->vm, cell_nr, vobu - start)) {
@@ -351,12 +344,6 @@ dvdnav_status_t dvdnav_part_search(dvdnav_t *this, int32_t part) {
}
dvdnav_status_t dvdnav_prev_pg_search(dvdnav_t *this) {
-
- if(!this) {
- printerr("Passed a NULL pointer.");
- return DVDNAV_STATUS_ERR;
- }
-
pthread_mutex_lock(&this->vm_lock);
if(!this->vm->state.pgc) {
printerr("No current PGC.");
@@ -385,12 +372,6 @@ dvdnav_status_t dvdnav_prev_pg_search(dvdnav_t *this) {
}
dvdnav_status_t dvdnav_top_pg_search(dvdnav_t *this) {
-
- if(!this) {
- printerr("Passed a NULL pointer.");
- return DVDNAV_STATUS_ERR;
- }
-
pthread_mutex_lock(&this->vm_lock);
if(!this->vm->state.pgc) {
printerr("No current PGC.");
@@ -421,11 +402,6 @@ dvdnav_status_t dvdnav_top_pg_search(dvdnav_t *this) {
dvdnav_status_t dvdnav_next_pg_search(dvdnav_t *this) {
vm_t *try_vm;
- if(!this) {
- printerr("Passed a NULL pointer.");
- return DVDNAV_STATUS_ERR;
- }
-
pthread_mutex_lock(&this->vm_lock);
if(!this->vm->state.pgc) {
printerr("No current PGC.");
@@ -468,11 +444,6 @@ dvdnav_status_t dvdnav_next_pg_search(dvdnav_t *this) {
dvdnav_status_t dvdnav_menu_call(dvdnav_t *this, DVDMenuID_t menu) {
vm_t *try_vm;
- if(!this) {
- printerr("Passed a NULL pointer.");
- return DVDNAV_STATUS_ERR;
- }
-
pthread_mutex_lock(&this->vm_lock);
if(!this->vm->state.pgc) {
printerr("No current PGC.");
@@ -520,10 +491,6 @@ dvdnav_status_t dvdnav_get_position(dvdnav_t *this, uint32_t *pos,
cell_playback_t *cell;
dvd_state_t *state;
- if(!this || !pos || !len) {
- printerr("Passed a NULL pointer.");
- return DVDNAV_STATUS_ERR;
- }
if(!this->started) {
printerr("Virtual DVD machine not started.");
return DVDNAV_STATUS_ERR;
@@ -590,11 +557,6 @@ dvdnav_status_t dvdnav_get_position_in_title(dvdnav_t *this,
cell_playback_t *last_cell;
dvd_state_t *state;
- if(!this || !pos || !len) {
- printerr("Passed a NULL pointer.");
- return DVDNAV_STATUS_ERR;
- }
-
state = &(this->vm->state);
if(!state->pgc) {
printerr("No current PGC.");
@@ -704,7 +666,7 @@ dvdnav_status_t dvdnav_relative_time_search(dvdnav_t *this,
if (scan_admap)
{
- if (dvdnav_scan_admap(this, state->domain, offset, &new_vobu) == DVDNAV_STATUS_ERR) {
+ if (dvdnav_scan_admap(this, state->domain, offset, 0, &new_vobu) == DVDNAV_STATUS_ERR) {
pthread_mutex_unlock(&this->vm_lock);
return DVDNAV_STATUS_ERR;
}
diff --git a/mythtv/libs/libmythdvdnav/dvdnav/vm/decoder.c b/mythtv/libs/libmythdvdnav/dvdnav/vm/decoder.c
index dda44d6..fb4ade5 100644
--- a/mythtv/libs/libmythdvdnav/dvdnav/vm/decoder.c
+++ b/mythtv/libs/libmythdvdnav/dvdnav/vm/decoder.c
@@ -30,8 +30,8 @@
#include <limits.h>
#include <string.h> /* For memset */
#include <sys/time.h>
-#include "dvdread/nav_types.h"
-#include "dvdread/ifo_types.h" /* vm_cmd_t */
+#include <dvdread/nav_types.h>
+#include <dvdread/ifo_types.h> /* vm_cmd_t */
#include "dvdnav/dvdnav.h"
#include "remap.h"
diff --git a/mythtv/libs/libmythdvdnav/dvdnav/vm/vm.c b/mythtv/libs/libmythdvdnav/dvdnav/vm/vm.c
index 4c94ede..142924f 100644
--- a/mythtv/libs/libmythdvdnav/dvdnav/vm/vm.c
+++ b/mythtv/libs/libmythdvdnav/dvdnav/vm/vm.c
@@ -178,6 +178,7 @@ static void dvd_read_name(char *name, char *serial, const char *device) {
off = mythfile_seek( fd, 32 * (off_t) DVD_VIDEO_LB_LEN, SEEK_SET );
if( off == ( 32 * (off_t) DVD_VIDEO_LB_LEN ) ) {
off = mythfile_read( fd, data, DVD_VIDEO_LB_LEN );
+ /* src has close(fd); here */
if (off == ( (off_t) DVD_VIDEO_LB_LEN )) {
fprintf(MSG_OUT, "libdvdnav: DVD Title: ");
for(i=25; i < 73; i++ ) {
@@ -744,7 +745,7 @@ int vm_get_audio_stream(vm_t *vm, int audioN) {
} else if (stream_id >= AC3_OFFSET) {
stream_id -= AC3_OFFSET;
}
-
+
if((vm->state).domain != VTS_DOMAIN)
stream_id = 0;
diff --git a/mythtv/libs/libmythdvdnav/dvdread/bswap.h b/mythtv/libs/libmythdvdnav/dvdread/bswap.h
index 3180e71..d4a381d 100644
--- a/mythtv/libs/libmythdvdnav/dvdread/bswap.h
+++ b/mythtv/libs/libmythdvdnav/dvdread/bswap.h
@@ -24,7 +24,7 @@
#include <config.h>
-#if HAVE_BIGENDIAN
+#if defined(WORDS_BIGENDIAN)
/* All bigendian systems are fine, just ignore the swaps. */
#define B2N_16(x) (void)(x)
#define B2N_32(x) (void)(x)
@@ -33,7 +33,7 @@
#else
/* For __FreeBSD_version */
-#if HAVE_SYS_PARAM_H
+#if defined(HAVE_SYS_PARAM_H)
#include <sys/param.h>
#endif
@@ -101,6 +101,6 @@
#endif
-#endif /* HAVE_BIGENDIAN */
+#endif /* WORDS_BIGENDIAN */
#endif /* LIBDVDREAD_BSWAP_H */
diff --git a/mythtv/libs/libmythdvdnav/dvdread/dvd_input.c b/mythtv/libs/libmythdvdnav/dvdread/dvd_input.c
index 99cb76f..8261847 100644
--- a/mythtv/libs/libmythdvdnav/dvdread/dvd_input.c
+++ b/mythtv/libs/libmythdvdnav/dvdread/dvd_input.c
@@ -27,7 +27,6 @@
#include "config.h"
#include "dvdread/dvd_reader.h"
#include "dvd_input.h"
-#include "mythiowrapper.h"
/* The function pointers that is the exported interface of this file. */
@@ -50,15 +49,11 @@ char * (*dvdinput_error) (dvd_input_t);
#else
/* dlopening libdvdcss */
-#if HAVE_DLFCN_H
+#ifdef HAVE_DLFCN_H
#include <dlfcn.h>
#else
/* Only needed on MINGW at the moment */
-#include "compat.h"
-#endif
-
-#ifdef __APPLE__
-#include <CoreFoundation/CFBundle.h>
+#include "../../msvc/contrib/dlfcn.c"
#endif
typedef struct dvdcss_s *dvdcss_handle;
@@ -171,9 +166,9 @@ static dvd_input_t file_open(const char *target)
/* Open the device */
#if !defined(WIN32) && !defined(__OS2__)
- dev->fd = mythfile_open(target, O_RDONLY);
+ dev->fd = open(target, O_RDONLY);
#else
- dev->fd = mythfile_open(target, O_RDONLY | O_BINARY);
+ dev->fd = open(target, O_RDONLY | O_BINARY);
#endif
if(dev->fd < 0) {
perror("libdvdread: Could not open input");
@@ -200,7 +195,7 @@ static int file_seek(dvd_input_t dev, int blocks)
{
off_t pos;
- pos = mythfile_seek(dev->fd, (off_t)blocks * (off_t)DVD_VIDEO_LB_LEN, SEEK_SET);
+ pos = lseek(dev->fd, (off_t)blocks * (off_t)DVD_VIDEO_LB_LEN, SEEK_SET);
if(pos < 0) {
return pos;
}
@@ -228,7 +223,7 @@ static int file_read(dvd_input_t dev, void *buffer, int blocks, int flags)
while(len > 0) {
- ret = mythfile_read(dev->fd, buffer, len);
+ ret = read(dev->fd, buffer, len);
if(ret < 0) {
/* One of the reads failed, too bad. We won't even bother
@@ -242,7 +237,7 @@ static int file_read(dvd_input_t dev, void *buffer, int blocks, int flags)
* 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 =*/ mythfile_seek(dev->fd, over_read, SEEK_CUR);
+ /*off_t pos =*/ lseek(dev->fd, over_read, SEEK_CUR);
/* should have pos % 2048 == 0 */
return (int) (bytes / DVD_VIDEO_LB_LEN);
}
@@ -260,7 +255,7 @@ static int file_close(dvd_input_t dev)
{
int ret;
- ret = mythfile_close(dev->fd);
+ ret = close(dev->fd);
if(ret < 0)
return ret;
@@ -274,7 +269,7 @@ static int file_close(dvd_input_t dev)
/**
* Setup read functions with either libdvdcss or minimal DVD access.
*/
-int dvdinput_setup(const char *path)
+int dvdinput_setup(void)
{
void *dvdcss_library = NULL;
char **dvdcss_version = NULL;
@@ -299,33 +294,6 @@ int dvdinput_setup(const char *path)
#endif
dvdcss_library = dlopen(CSS_LIB, RTLD_LAZY);
-#ifdef __APPLE__
- if (!dvdcss_library)
- {
- fprintf(stderr, "libdvdread: dlopen(%s) failed.\n", CSS_LIB);
- CFURLRef appUrlRef = CFBundleCopyBundleURL(CFBundleGetMainBundle());
- CFStringRef macPath = CFURLCopyFileSystemPath(appUrlRef,
- kCFURLPOSIXPathStyle);
- static char *paths[] = {
- "%s/Contents/Frameworks/%s",
- "%s/Contents/PlugIns/%s", // proper spelling, important on case sensitive fs
- "%s/Contents/Plugins/%s", // to be compatible with old bundler
- NULL
- };
- char path[FILENAME_MAX];
- for (int i = 0; paths[i] != NULL && dvdcss_library == NULL; i++)
- {
- snprintf(path, FILENAME_MAX-1, paths[i],
- CFStringGetCStringPtr(macPath, CFStringGetSystemEncoding()),
- CSS_LIB);
- fprintf(stderr, "Trying %s\n", path);
- dvdcss_library = dlopen(path, RTLD_LAZY);
- }
- CFRelease(appUrlRef);
- CFRelease(macPath);
- }
-#endif
-
if(dvdcss_library != NULL) {
#if defined(__OpenBSD__) && !defined(__ELF__) || defined(__OS2__)
#define U_S "_"
@@ -363,8 +331,7 @@ int dvdinput_setup(const char *path)
}
#endif /* HAVE_DVDCSS_DVDCSS_H */
- // CSS isn't possible over the myth:// protocol
- if(strncmp(path, "myth://", 7) && dvdcss_library != NULL) {
+ if(dvdcss_library != NULL) {
/*
char *psz_method = getenv( "DVDCSS_METHOD" );
char *psz_verbose = getenv( "DVDCSS_VERBOSE" );
diff --git a/mythtv/libs/libmythdvdnav/dvdread/dvd_input.h b/mythtv/libs/libmythdvdnav/dvdread/dvd_input.h
index 208512e..e473100 100644
--- a/mythtv/libs/libmythdvdnav/dvdread/dvd_input.h
+++ b/mythtv/libs/libmythdvdnav/dvdread/dvd_input.h
@@ -31,8 +31,6 @@
typedef struct dvd_input_s *dvd_input_t;
-#include <sys/stat.h>
-
#if defined( __MINGW32__ )
# undef lseek
# define lseek _lseeki64
@@ -58,6 +56,6 @@ extern char * (*dvdinput_error) (dvd_input_t);
/**
* Setup function accessed by dvd_reader.c. Returns 1 if there is CSS support.
*/
-int dvdinput_setup(const char *);
+int dvdinput_setup(void);
#endif /* LIBDVDREAD_DVD_INPUT_H */
diff --git a/mythtv/libs/libmythdvdnav/dvdread/dvd_reader.c b/mythtv/libs/libmythdvdnav/dvdread/dvd_reader.c
index fd00d6c..831e40a 100644
--- a/mythtv/libs/libmythdvdnav/dvdread/dvd_reader.c
+++ b/mythtv/libs/libmythdvdnav/dvdread/dvd_reader.c
@@ -69,7 +69,6 @@ static inline int _private_gettimeofday( struct timeval *tv, void *tz )
#include "dvd_input.h"
#include "dvdread/dvd_reader.h"
#include "md5.h"
-#include "mythiowrapper.h"
#define DEFAULT_UDF_CACHE_LEVEL 1
@@ -241,7 +240,6 @@ static dvd_reader_t *DVDOpenImageFile( const char *location, int have_css )
dvdinput_close(dev);
return NULL;
}
- memset( dvd, 0, sizeof( dvd_reader_t ) );
dvd->isImageFile = 1;
dvd->dev = dev;
dvd->path_root = NULL;
@@ -356,7 +354,7 @@ dvd_reader_t *DVDOpen( const char *ppath )
goto DVDOpen_error;
/* Try to open libdvdcss or fall back to standard functions */
- have_css = dvdinput_setup(path);
+ have_css = dvdinput_setup();
#if defined(_WIN32) || defined(__OS2__)
/* Strip off the trailing \ if it is not a drive */
@@ -369,7 +367,7 @@ dvd_reader_t *DVDOpen( const char *ppath )
}
#endif
- ret = mythfile_stat( path, &fileinfo );
+ ret = stat( path, &fileinfo );
if( ret < 0 ) {
@@ -422,9 +420,6 @@ dvd_reader_t *DVDOpen( const char *ppath )
/* Also WIN32 does not have symlinks, so we don't need this bit of code. */
/* Resolve any symlinks and get the absolute dir name. */
- if (!strncmp(path, "myth://", 7))
- dev_name = strdup( path );
- else
{
if( ( cdir = open( ".", O_RDONLY ) ) >= 0 ) {
if( chdir( path_copy ) == -1 ) {
@@ -636,14 +631,6 @@ static int findDirFile( const char *path, const char *file, char *filename )
DIR *dir;
struct dirent *ent;
- if (!strncmp(path, "myth://", 7) && mythfile_exists(path, file))
- {
- sprintf( filename, "%s%s%s", path,
- ( ( path[ strlen( path ) - 1 ] == '/' ) ? "" : "/" ),
- file );
- return 0;
- }
-
dir = opendir( path );
if( !dir ) return -2;
@@ -726,10 +713,9 @@ static dvd_file_t *DVDOpenFilePath( dvd_reader_t *dvd, char *filename )
memset( dvd_file->title_devs, 0, sizeof( dvd_file->title_devs ) );
dvd_file->filesize = 0;
- if( mythfile_stat( full_path, &fileinfo ) < 0 ) {
+ if( stat( full_path, &fileinfo ) < 0 ) {
fprintf( stderr, "libdvdread: Can't stat() %s.\n", filename );
free( dvd_file );
- dvdinput_close(dev);
return NULL;
}
dvd_file->title_sizes[ 0 ] = fileinfo.st_size / DVD_VIDEO_LB_LEN;
@@ -825,7 +811,7 @@ static dvd_file_t *DVDOpenVOBPath( dvd_reader_t *dvd, int title, int menu )
return NULL;
}
- if( mythfile_stat( full_path, &fileinfo ) < 0 ) {
+ if( stat( full_path, &fileinfo ) < 0 ) {
fprintf( stderr, "libdvdread: Can't stat() %s.\n", filename );
dvdinput_close(dev);
free( dvd_file );
@@ -844,7 +830,7 @@ static dvd_file_t *DVDOpenVOBPath( dvd_reader_t *dvd, int title, int menu )
break;
}
- if( mythfile_stat( full_path, &fileinfo ) < 0 ) {
+ if( stat( full_path, &fileinfo ) < 0 ) {
fprintf( stderr, "libdvdread: Can't stat() %s.\n", filename );
break;
}
@@ -996,7 +982,7 @@ static int DVDFileStatVOBPath( dvd_reader_t *dvd, int title,
if( !findDVDFile( dvd, filename, full_path ) )
return -1;
- if( mythfile_stat( full_path, &fileinfo ) < 0 ) {
+ if( stat( full_path, &fileinfo ) < 0 ) {
fprintf( stderr, "libdvdread: Can't stat() %s.\n", filename );
return -1;
}
@@ -1012,7 +998,7 @@ static int DVDFileStatVOBPath( dvd_reader_t *dvd, int title,
if( !findDVDFile( dvd, filename, full_path ) )
break;
- if( mythfile_stat( full_path, &fileinfo ) < 0 ) {
+ if( stat( full_path, &fileinfo ) < 0 ) {
fprintf( stderr, "libdvdread: Can't stat() %s.\n", filename );
break;
}
@@ -1093,7 +1079,7 @@ int DVDFileStat( dvd_reader_t *dvd, int titlenum,
}
} else {
if( findDVDFile( dvd, filename, full_path ) ) {
- if( mythfile_stat( full_path, &fileinfo ) < 0 )
+ if( stat( full_path, &fileinfo ) < 0 )
fprintf( stderr, "libdvdread: Can't stat() %s.\n", filename );
else {
statbuf->size = fileinfo.st_size;
diff --git a/mythtv/libs/libmythdvdnav/dvdread/md5.h b/mythtv/libs/libmythdvdnav/dvdread/md5.h
index 3b0d42c..f1ddd4e 100644
--- a/mythtv/libs/libmythdvdnav/dvdread/md5.h
+++ b/mythtv/libs/libmythdvdnav/dvdread/md5.h
@@ -23,7 +23,7 @@
#include <stdio.h>
-#if HAVE_LIMITS_H || _LIBC
+#if defined HAVE_LIMITS_H || _LIBC
# include <limits.h>
#endif
More information about the mythtv-users
mailing list