summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuenter Bartsch <guenter@users.sourceforge.net>2001-06-02 21:44:01 +0000
committerGuenter Bartsch <guenter@users.sourceforge.net>2001-06-02 21:44:01 +0000
commit22d3c2d38b8d31826f0166b17bc2c631a369c9e4 (patch)
tree08d16a979b0eae4873ff83b94cb751e4fc509029
parentf3e31d167d315532e9e1f5ed6dee4fd6981e83b9 (diff)
downloadxine-lib-22d3c2d38b8d31826f0166b17bc2c631a369c9e4.tar.gz
xine-lib-22d3c2d38b8d31826f0166b17bc2c631a369c9e4.tar.bz2
make input plugins return file sizes in mrl_t (ls function)
CVS patchset: 114 CVS date: 2001/06/02 21:44:01
-rw-r--r--src/input/input_dvd.c11
-rw-r--r--src/input/input_file.c21
-rw-r--r--src/input/input_plugin.h7
-rw-r--r--src/input/input_vcd.c12
4 files changed, 32 insertions, 19 deletions
diff --git a/src/input/input_dvd.c b/src/input/input_dvd.c
index 2d5826fc4..b9ccda9cd 100644
--- a/src/input/input_dvd.c
+++ b/src/input/input_dvd.c
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: input_dvd.c,v 1.8 2001/05/30 21:48:23 f1rmb Exp $
+ * $Id: input_dvd.c,v 1.9 2001/06/02 21:44:01 guenter Exp $
*/
#ifdef HAVE_CONFIG_H
@@ -436,11 +436,16 @@ static mrl_t **dvd_plugin_get_dir (input_plugin_t *this_gen,
continue;
if (!strcasecmp (&this->filelist[i][nLen-4], ".VOB")) {
+ char str[1024];
- sprintf (this->mrls[nFiles2]->filename,
+ sprintf (this->mrls[nFiles2]->mrl,
"dvd://%s", this->filelist[i]);
this->mrls[nFiles2]->type = mrl_dvd;
+ /* determine size */
+ sprintf (str, "/VIDEO_TS/%s", this->filelist[i]);
+ UDFFindFile(fd, str, &this->mrls[nFiles2]->size);
+
nFiles2++;
}
@@ -550,7 +555,7 @@ input_plugin_t *init_input_plugin (int iface, config_values_t *config) {
this->filelist[i] = (char *) malloc (256);
this->filelist2[i] = (char *) malloc (256);
this->mrls[i] = (mrl_t *) malloc(sizeof(mrl_t));
- this->mrls[i]->filename = (char *) malloc (256);
+ this->mrls[i]->mrl = (char *) malloc (256);
}
this->mrls_allocated_entries = MAX_DIR_ENTRIES;
diff --git a/src/input/input_file.c b/src/input/input_file.c
index 8aee06d10..63c5b6b08 100644
--- a/src/input/input_file.c
+++ b/src/input/input_file.c
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: input_file.c,v 1.10 2001/05/30 02:09:24 f1rmb Exp $
+ * $Id: input_file.c,v 1.11 2001/06/02 21:44:01 guenter Exp $
*/
#ifdef HAVE_CONFIG_H
@@ -256,15 +256,18 @@ static mrl_t **file_plugin_get_dir (input_plugin_t *this_gen,
|| this->mrls_allocated_entries == 0) {
this->mrls[num_files] = (mrl_t *) malloc(sizeof(mrl_t));
- this->mrls[num_files]->filename = (char *)
+ this->mrls[num_files]->mrl = (char *)
malloc(strlen(pdirent->d_name + 1));
}
else
- this->mrls[num_files]->filename = (char *)
- realloc(this->mrls[num_files]->filename, strlen(pdirent->d_name + 1));
+ this->mrls[num_files]->mrl = (char *)
+ realloc(this->mrls[num_files]->mrl, strlen(pdirent->d_name + 1));
- strcpy(this->mrls[num_files]->filename, pdirent->d_name);
+ /* FIXME: store valid MRLs with valid path name */
+ strcpy(this->mrls[num_files]->mrl, pdirent->d_name);
+ this->mrls[num_files]->size = stat.st_size;
+
/*
* Ok, now check file type
*/
@@ -287,10 +290,10 @@ static mrl_t **file_plugin_get_dir (input_plugin_t *this_gen,
fprintf(stderr, "readlink() failed: %s\n", strerror(errno));
}
else {
- this->mrls[num_files]->filename = (char *)
- realloc(this->mrls[num_files]->filename, (linksize + 1));
- memset(this->mrls[num_files]->filename, 0, linksize + 1);
- strncpy(this->mrls[num_files]->filename, linkbuf, linksize);
+ this->mrls[num_files]->mrl = (char *)
+ realloc(this->mrls[num_files]->mrl, (linksize + 1));
+ memset(this->mrls[num_files]->mrl, 0, linksize + 1);
+ strncpy(this->mrls[num_files]->mrl, linkbuf, linksize);
}
}
}
diff --git a/src/input/input_plugin.h b/src/input/input_plugin.h
index 58c304b68..c0f42cb30 100644
--- a/src/input/input_plugin.h
+++ b/src/input/input_plugin.h
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: input_plugin.h,v 1.6 2001/05/07 01:31:44 f1rmb Exp $
+ * $Id: input_plugin.h,v 1.7 2001/06/02 21:44:01 guenter Exp $
*/
#ifndef HAVE_INPUT_PLUGIN_H
@@ -60,8 +60,9 @@ typedef struct { /* CLUT == Color LookUp Table */
#define mrl_type_exec 0xFFFF8000
typedef struct {
- char *filename; /* filename without pathname */
- int type; /* match to mrl_type enum */
+ char *mrl; /* <type>://<location */
+ int type; /* match to mrl_type enum */
+ off_t size; /* size of this source, may be 0 */
} mrl_t;
typedef struct input_plugin_s input_plugin_t;
diff --git a/src/input/input_vcd.c b/src/input/input_vcd.c
index 4ed93ffdf..4222e6e45 100644
--- a/src/input/input_vcd.c
+++ b/src/input/input_vcd.c
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: input_vcd.c,v 1.7 2001/05/30 21:48:23 f1rmb Exp $
+ * $Id: input_vcd.c,v 1.8 2001/06/02 21:44:01 guenter Exp $
*/
#ifdef HAVE_CONFIG_H
@@ -706,9 +706,12 @@ static mrl_t **vcd_plugin_get_dir (input_plugin_t *this_gen,
/* printf ("%d tracks\n", this->total_tracks); */
for (i=1; i<this->total_tracks; i++) { /* FIXME: check if track 0 contains valid data */
- sprintf (this->mrls[i-1]->filename, "vcd://%d",i);
+ sprintf (this->mrls[i-1]->mrl, "vcd://%d",i);
this->mrls[i-1]->type = mrl_vcd;
- /* printf ("list[%d] : %d %s\n", i, this->mrls[i-1]->filename); */
+
+ /* hack */
+ this->cur_track = i;
+ this->mrls[i-1]->size = vcd_plugin_get_length ((input_plugin_t *) this);
}
return this->mrls;
@@ -795,7 +798,8 @@ input_plugin_t *init_input_plugin (int iface, config_values_t *config) {
for (i = 0; i < 100; i++) {
this->filelist[i] = (char *) malloc (256);
this->mrls[i] = (mrl_t *) malloc(sizeof(mrl_t));
- this->mrls[i]->filename = (char *) malloc (256);
+ this->mrls[i]->mrl = (char *) malloc (256);
+ this->mrls[i]->size = 0;
}
this->mrls_allocated_entries = 100;