summaryrefslogtreecommitdiff
path: root/src/input/vcd/libvcd
diff options
context:
space:
mode:
Diffstat (limited to 'src/input/vcd/libvcd')
-rw-r--r--src/input/vcd/libvcd/data_structures.c262
-rw-r--r--src/input/vcd/libvcd/data_structures.h42
-rw-r--r--src/input/vcd/libvcd/dict.h34
-rw-r--r--src/input/vcd/libvcd/directory.c6
-rw-r--r--src/input/vcd/libvcd/files.c178
-rw-r--r--src/input/vcd/libvcd/image.c8
-rw-r--r--src/input/vcd/libvcd/image_bincue.c39
-rw-r--r--src/input/vcd/libvcd/image_cdrdao.c35
-rw-r--r--src/input/vcd/libvcd/image_nrg.c41
-rw-r--r--src/input/vcd/libvcd/image_sink.h6
-rw-r--r--src/input/vcd/libvcd/inf.c137
-rw-r--r--src/input/vcd/libvcd/info.c252
-rw-r--r--src/input/vcd/libvcd/info_private.c56
-rw-r--r--src/input/vcd/libvcd/info_private.h23
-rw-r--r--src/input/vcd/libvcd/libvcd/inf.h108
-rw-r--r--src/input/vcd/libvcd/libvcd/info.h56
-rw-r--r--src/input/vcd/libvcd/libvcd/types.h16
-rw-r--r--src/input/vcd/libvcd/libvcd/version.h2
-rw-r--r--src/input/vcd/libvcd/mpeg.h4
-rw-r--r--src/input/vcd/libvcd/mpeg_stream.c36
-rw-r--r--src/input/vcd/libvcd/obj.h20
-rw-r--r--src/input/vcd/libvcd/pbc.c156
-rw-r--r--src/input/vcd/libvcd/pbc.h8
-rw-r--r--src/input/vcd/libvcd/vcd.c235
-rw-r--r--src/input/vcd/libvcd/vcd_read.c8
-rw-r--r--src/input/vcd/libvcd/vcd_read.h6
-rw-r--r--src/input/vcd/libvcd/version.h11
27 files changed, 783 insertions, 1002 deletions
diff --git a/src/input/vcd/libvcd/data_structures.c b/src/input/vcd/libvcd/data_structures.c
index a269cc8f8..1fdca95c9 100644
--- a/src/input/vcd/libvcd/data_structures.c
+++ b/src/input/vcd/libvcd/data_structures.c
@@ -1,7 +1,8 @@
/*
- $Id: data_structures.c,v 1.2 2004/04/11 12:20:32 miguelfreitas Exp $
+ $Id: data_structures.c,v 1.3 2005/01/01 02:43:59 rockyb Exp $
Copyright (C) 2000 Herbert Valerio Riedel <hvr@gnu.org>
+ Copyright (C) 2004 Rocky Bernstein <rocky@panix.com>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -35,63 +36,38 @@
#include "data_structures.h"
#include "util.h"
-static const char _rcsid[] = "$Id: data_structures.c,v 1.2 2004/04/11 12:20:32 miguelfreitas Exp $";
+static const char _rcsid[] = "$Id: data_structures.c,v 1.3 2005/01/01 02:43:59 rockyb Exp $";
-struct _VcdList
+struct _CdioList
{
unsigned length;
- VcdListNode *begin;
- VcdListNode *end;
+ CdioListNode *begin;
+ CdioListNode *end;
};
-struct _VcdListNode
+struct _CdioListNode
{
- VcdList *list;
+ CdioList *list;
- VcdListNode *next;
+ CdioListNode *next;
void *data;
};
/* impl */
-VcdList *
-_vcd_list_new (void)
-{
- VcdList *new_obj = _vcd_malloc (sizeof (VcdList));
-
- return new_obj;
-}
-
-void
-_vcd_list_free (VcdList *list, int free_data)
-{
- while (_vcd_list_length (list))
- _vcd_list_node_free (_vcd_list_begin (list), free_data);
-
- free (list);
-}
-
-unsigned
-_vcd_list_length (const VcdList *list)
-{
- vcd_assert (list != NULL);
-
- return list->length;
-}
-
static bool
-_bubble_sort_iteration (VcdList *list, _vcd_list_cmp_func cmp_func)
+_bubble_sort_iteration (CdioList *list, _cdio_list_cmp_func cmp_func)
{
- VcdListNode **pnode;
+ CdioListNode **pnode;
bool changed = false;
for (pnode = &(list->begin);
(*pnode) != NULL && (*pnode)->next != NULL;
pnode = &((*pnode)->next))
{
- VcdListNode *node = *pnode;
+ CdioListNode *node = *pnode;
if (cmp_func (node->data, node->next->data) <= 0)
continue; /* n <= n->next */
@@ -110,7 +86,7 @@ _bubble_sort_iteration (VcdList *list, _vcd_list_cmp_func cmp_func)
return changed;
}
-void _vcd_list_sort (VcdList *list, _vcd_list_cmp_func cmp_func)
+void _vcd_list_sort (CdioList *list, _cdio_list_cmp_func cmp_func)
{
/* fixme -- this is bubble sort -- worst sorting algo... */
@@ -120,187 +96,27 @@ void _vcd_list_sort (VcdList *list, _vcd_list_cmp_func cmp_func)
while (_bubble_sort_iteration (list, cmp_func));
}
-void
-_vcd_list_prepend (VcdList *list, void *data)
-{
- VcdListNode *new_node;
-
- vcd_assert (list != NULL);
-
- new_node = _vcd_malloc (sizeof (VcdListNode));
-
- new_node->list = list;
- new_node->next = list->begin;
- new_node->data = data;
-
- list->begin = new_node;
- if (list->length == 0)
- list->end = new_node;
-
- list->length++;
-}
-
-void
-_vcd_list_append (VcdList *list, void *data)
-{
- vcd_assert (list != NULL);
-
- if (list->length == 0)
- {
- _vcd_list_prepend (list, data);
- }
- else
- {
- VcdListNode *new_node = _vcd_malloc (sizeof (VcdListNode));
-
- new_node->list = list;
- new_node->next = NULL;
- new_node->data = data;
-
- list->end->next = new_node;
- list->end = new_node;
-
- list->length++;
- }
-}
-
-void
-_vcd_list_foreach (VcdList *list, _vcd_list_iterfunc func, void *user_data)
-{
- VcdListNode *node;
-
- vcd_assert (list != NULL);
- vcd_assert (func != 0);
-
- for (node = _vcd_list_begin (list);
- node != NULL;
- node = _vcd_list_node_next (node))
- func (_vcd_list_node_data (node), user_data);
-}
-
-VcdListNode *
-_vcd_list_find (VcdList *list, _vcd_list_iterfunc cmp_func, void *user_data)
-{
- VcdListNode *node;
-
- vcd_assert (list != NULL);
- vcd_assert (cmp_func != 0);
-
- for (node = _vcd_list_begin (list);
- node != NULL;
- node = _vcd_list_node_next (node))
- if (cmp_func (_vcd_list_node_data (node), user_data))
- break;
-
- return node;
-}
-
/* node ops */
-VcdListNode *
-_vcd_list_at (VcdList *list, int idx)
+CdioListNode *
+_vcd_list_at (CdioList *list, int idx)
{
- VcdListNode *node = _vcd_list_begin (list);
+ CdioListNode *node = _cdio_list_begin (list);
if (idx < 0)
- return _vcd_list_at (list, _vcd_list_length (list) + idx);
+ return _vcd_list_at (list, _cdio_list_length (list) + idx);
vcd_assert (idx >= 0);
while (node && idx)
{
- node = _vcd_list_node_next (node);
+ node = _cdio_list_node_next (node);
idx--;
}
return node;
}
-VcdListNode *
-_vcd_list_begin (const VcdList *list)
-{
- vcd_assert (list != NULL);
-
- return list->begin;
-}
-
-VcdListNode *
-_vcd_list_end (VcdList *list)
-{
- vcd_assert (list != NULL);
-
- return list->end;
-}
-
-VcdListNode *
-_vcd_list_node_next (VcdListNode *node)
-{
- if (node)
- return node->next;
-
- return NULL;
-}
-
-void
-_vcd_list_node_free (VcdListNode *node, int free_data)
-{
- VcdList *list;
- VcdListNode *prev_node;
-
- vcd_assert (node != NULL);
-
- list = node->list;
-
- vcd_assert (_vcd_list_length (list) > 0);
-
- if (free_data)
- free (_vcd_list_node_data (node));
-
- if (_vcd_list_length (list) == 1)
- {
- vcd_assert (list->begin == list->end);
-
- list->end = list->begin = NULL;
- list->length = 0;
- free (node);
- return;
- }
-
- vcd_assert (list->begin != list->end);
-
- if (list->begin == node)
- {
- list->begin = node->next;
- free (node);
- list->length--;
- return;
- }
-
- for (prev_node = list->begin; prev_node->next; prev_node = prev_node->next)
- if (prev_node->next == node)
- break;
-
- vcd_assert (prev_node->next != NULL);
-
- if (list->end == node)
- list->end = prev_node;
-
- prev_node->next = node->next;
-
- list->length--;
-
- free (node);
-}
-
-void *
-_vcd_list_node_data (VcdListNode *node)
-{
- if (node)
- return node->data;
-
- return NULL;
-}
-
/*
* n-way tree based on list -- somewhat inefficent
*/
@@ -314,10 +130,10 @@ struct _VcdTreeNode
{
void *data;
- VcdListNode *listnode;
+ CdioListNode *listnode;
VcdTree *tree;
VcdTreeNode *parent;
- VcdList *children;
+ CdioList *children;
};
VcdTree *
@@ -363,8 +179,8 @@ _vcd_tree_node_destroy (VcdTreeNode *node, bool free_data)
if (node->children)
{
- vcd_assert (_vcd_list_length (node->children) == 0);
- _vcd_list_free (node->children, true);
+ vcd_assert (_cdio_list_length (node->children) == 0);
+ _cdio_list_free (node->children, true);
node->children = NULL;
}
@@ -372,7 +188,7 @@ _vcd_tree_node_destroy (VcdTreeNode *node, bool free_data)
free (_vcd_tree_node_set_data (node, NULL));
if (node->parent)
- _vcd_list_node_free (node->listnode, true);
+ _cdio_list_node_free (node->listnode, true);
else
_vcd_tree_node_set_data (node, NULL);
}
@@ -407,16 +223,16 @@ _vcd_tree_node_append_child (VcdTreeNode *pnode, void *cdata)
vcd_assert (pnode != NULL);
if (!pnode->children)
- pnode->children = _vcd_list_new ();
+ pnode->children = _cdio_list_new ();
nnode = _vcd_malloc (sizeof (VcdTreeNode));
- _vcd_list_append (pnode->children, nnode);
+ _cdio_list_append (pnode->children, nnode);
nnode->data = cdata;
nnode->parent = pnode;
nnode->tree = pnode->tree;
- nnode->listnode = _vcd_list_end (pnode->children);
+ nnode->listnode = _cdio_list_end (pnode->children);
return nnode;
}
@@ -429,7 +245,7 @@ _vcd_tree_node_first_child (VcdTreeNode *node)
if (!node->children)
return NULL;
- return _vcd_list_node_data (_vcd_list_begin (node->children));
+ return _cdio_list_node_data (_cdio_list_begin (node->children));
}
VcdTreeNode *
@@ -437,7 +253,7 @@ _vcd_tree_node_next_sibling (VcdTreeNode *node)
{
vcd_assert (node != NULL);
- return _vcd_list_node_data (_vcd_list_node_next (node->listnode));
+ return _cdio_list_node_data (_cdio_list_node_next (node->listnode));
}
void
@@ -446,7 +262,7 @@ _vcd_tree_node_sort_children (VcdTreeNode *node, _vcd_tree_node_cmp_func cmp_fun
vcd_assert (node != NULL);
if (node->children)
- _vcd_list_sort (node->children, (_vcd_list_cmp_func) cmp_func);
+ _vcd_list_sort (node->children, (_cdio_list_cmp_func) cmp_func);
}
void
@@ -471,31 +287,31 @@ _vcd_tree_node_traverse_bf (VcdTreeNode *node,
_vcd_tree_node_traversal_func trav_func,
void *user_data) /* breath-first */
{
- VcdList *queue;
+ CdioList *queue;
vcd_assert (node != NULL);
- queue = _vcd_list_new ();
+ queue = _cdio_list_new ();
- _vcd_list_prepend (queue, node);
+ _cdio_list_prepend (queue, node);
- while (_vcd_list_length (queue))
+ while (_cdio_list_length (queue))
{
- VcdListNode *lastnode = _vcd_list_end (queue);
- VcdTreeNode *treenode = _vcd_list_node_data (lastnode);
- VcdTreeNode *childnode;
+ CdioListNode *lastnode = _cdio_list_end (queue);
+ VcdTreeNode *treenode = _cdio_list_node_data (lastnode);
+ VcdTreeNode *childnode;
- _vcd_list_node_free (lastnode, false);
+ _cdio_list_node_free (lastnode, false);
trav_func (treenode, user_data);
_VCD_CHILD_FOREACH (childnode, treenode)
{
- _vcd_list_prepend (queue, childnode);
+ _cdio_list_prepend (queue, childnode);
}
}
- _vcd_list_free (queue, false);
+ _cdio_list_free (queue, false);
}
VcdTreeNode *_vcd_tree_node_parent (VcdTreeNode *node)
diff --git a/src/input/vcd/libvcd/data_structures.h b/src/input/vcd/libvcd/data_structures.h
index 9ce996f01..70fe88045 100644
--- a/src/input/vcd/libvcd/data_structures.h
+++ b/src/input/vcd/libvcd/data_structures.h
@@ -1,5 +1,5 @@
/*
- $Id: data_structures.h,v 1.2 2004/04/11 12:20:32 miguelfreitas Exp $
+ $Id: data_structures.h,v 1.3 2005/01/01 02:43:59 rockyb Exp $
Copyright (C) 2000 Herbert Valerio Riedel <hvr@gnu.org>
@@ -21,48 +21,14 @@
#ifndef __VCD_DATA_STRUCTURES_H__
#define __VCD_DATA_STRUCTURES_H__
+#include <cdio/ds.h>
#include <libvcd/types.h>
-/* opaque... */
-
-typedef int (*_vcd_list_cmp_func) (void *data1, void *data2);
-
-typedef int (*_vcd_list_iterfunc) (void *data, void *user_data);
-
-/* methods */
-VcdList *_vcd_list_new (void);
-
-void _vcd_list_free (VcdList *list, int free_data);
-
-unsigned _vcd_list_length (const VcdList *list);
-
-void _vcd_list_sort (VcdList *list, _vcd_list_cmp_func cmp_func);
-
-void _vcd_list_prepend (VcdList *list, void *data);
-
-void _vcd_list_append (VcdList *list, void *data);
-
-void _vcd_list_foreach (VcdList *list, _vcd_list_iterfunc func, void *user_data);
-
-VcdListNode *_vcd_list_find (VcdList *list, _vcd_list_iterfunc cmp_func, void *user_data);
-
-#define _VCD_LIST_FOREACH(node, list) \
- for (node = _vcd_list_begin (list); node; node = _vcd_list_node_next (node))
-
/* node ops */
-VcdListNode *_vcd_list_at (VcdList *list, int idx);
-
-VcdListNode *_vcd_list_begin (const VcdList *list);
-
-VcdListNode *_vcd_list_end (VcdList *list);
-
-VcdListNode *_vcd_list_node_next (VcdListNode *node);
-
-void _vcd_list_node_free (VcdListNode *node, int free_data);
-
-void *_vcd_list_node_data (VcdListNode *node);
+CdioListNode *_vcd_list_at (CdioList *list, int idx);
+void _vcd_list_sort (CdioList *list, _cdio_list_cmp_func cmp_func);
/* n-way tree */
diff --git a/src/input/vcd/libvcd/dict.h b/src/input/vcd/libvcd/dict.h
index f7de3b1c9..229ad5706 100644
--- a/src/input/vcd/libvcd/dict.h
+++ b/src/input/vcd/libvcd/dict.h
@@ -1,7 +1,7 @@
/*
- $Id: dict.h,v 1.2 2004/04/11 12:20:32 miguelfreitas Exp $
+ $Id: dict.h,v 1.3 2005/01/01 02:43:59 rockyb Exp $
- Copyright (C) 2000 Herbert Valerio Riedel <hvr@gnu.org>
+ Copyright (C) 2000, 2004 Herbert Valerio Riedel <hvr@gnu.org>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -58,7 +58,7 @@ _dict_insert (VcdObj *obj, const char key[], uint32_t sector, uint32_t length,
_new_node->buf = _vcd_malloc (length * ISO_BLOCKSIZE);
_new_node->flags = end_flags;
- _vcd_list_prepend (obj->buffer_dict_list, _new_node);
+ _cdio_list_prepend (obj->buffer_dict_list, _new_node);
}
static
@@ -82,17 +82,17 @@ int _dict_sector_cmp (struct _dict_t *a, uint32_t *b)
static const struct _dict_t *
_dict_get_bykey (VcdObj *obj, const char key[])
{
- VcdListNode *node;
+ CdioListNode *node;
vcd_assert (obj != NULL);
vcd_assert (key != NULL);
- node = _vcd_list_find (obj->buffer_dict_list,
- (_vcd_list_iterfunc) _dict_key_cmp,
- (char *) key);
+ node = _cdio_list_find (obj->buffer_dict_list,
+ (_cdio_list_iterfunc) _dict_key_cmp,
+ (char *) key);
if (node)
- return _vcd_list_node_data (node);
+ return _cdio_list_node_data (node);
return NULL;
}
@@ -100,17 +100,17 @@ _dict_get_bykey (VcdObj *obj, const char key[])
static const struct _dict_t *
_dict_get_bysector (VcdObj *obj, uint32_t sector)
{
- VcdListNode *node;
+ CdioListNode *node;
vcd_assert (obj != NULL);
vcd_assert (sector != SECTOR_NIL);
- node = _vcd_list_find (obj->buffer_dict_list,
- (_vcd_list_iterfunc) _dict_sector_cmp,
- &sector);
+ node = _cdio_list_find (obj->buffer_dict_list,
+ (_cdio_list_iterfunc) _dict_sector_cmp,
+ &sector);
if (node)
- return _vcd_list_node_data (node);
+ return _cdio_list_node_data (node);
return NULL;
}
@@ -149,16 +149,16 @@ _dict_get_sector (VcdObj *obj, uint32_t sector)
static void
_dict_clean (VcdObj *obj)
{
- VcdListNode *node;
+ CdioListNode *node;
- while ((node = _vcd_list_begin (obj->buffer_dict_list)))
+ while ((node = _cdio_list_begin (obj->buffer_dict_list)))
{
- struct _dict_t *p = _vcd_list_node_data (node);
+ struct _dict_t *p = _cdio_list_node_data (node);
free (p->key);
free (p->buf);
- _vcd_list_node_free (node, true);
+ _cdio_list_node_free (node, true);
}
}
diff --git a/src/input/vcd/libvcd/directory.c b/src/input/vcd/libvcd/directory.c
index 49cc8fe8a..750bcd10c 100644
--- a/src/input/vcd/libvcd/directory.c
+++ b/src/input/vcd/libvcd/directory.c
@@ -1,5 +1,5 @@
/*
- $Id: directory.c,v 1.2 2004/04/11 12:20:32 miguelfreitas Exp $
+ $Id: directory.c,v 1.3 2005/01/01 02:43:59 rockyb Exp $
Copyright (C) 2000 Herbert Valerio Riedel <hvr@gnu.org>
@@ -26,16 +26,16 @@
#include <string.h>
/* Public headers */
+#include <cdio/bytesex.h>
#include <cdio/iso9660.h>
#include <libvcd/logging.h>
/* Private headers */
#include "vcd_assert.h"
-#include "bytesex.h"
#include "directory.h"
#include "util.h"
-static const char _rcsid[] = "$Id: directory.c,v 1.2 2004/04/11 12:20:32 miguelfreitas Exp $";
+static const char _rcsid[] = "$Id: directory.c,v 1.3 2005/01/01 02:43:59 rockyb Exp $";
/* CD-ROM XA */
diff --git a/src/input/vcd/libvcd/files.c b/src/input/vcd/libvcd/files.c
index 47210da7f..82d28eaf7 100644
--- a/src/input/vcd/libvcd/files.c
+++ b/src/input/vcd/libvcd/files.c
@@ -1,7 +1,7 @@
/*
- $Id: files.c,v 1.2 2004/04/11 12:20:32 miguelfreitas Exp $
+ $Id: files.c,v 1.3 2005/01/01 02:43:59 rockyb Exp $
- Copyright (C) 2000 Herbert Valerio Riedel <hvr@gnu.org>
+ Copyright (C) 2000, 2004 Herbert Valerio Riedel <hvr@gnu.org>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -28,6 +28,7 @@
#include <math.h>
#include <cdio/cdio.h>
+#include <cdio/bytesex.h>
#include <cdio/util.h>
/* Public headers */
@@ -40,13 +41,12 @@
/* Private headers */
#include "vcd_assert.h"
-#include "bytesex.h"
#include "mpeg_stream.h"
#include "obj.h"
#include "pbc.h"
#include "util.h"
-static const char _rcsid[] = "$Id: files.c,v 1.2 2004/04/11 12:20:32 miguelfreitas Exp $";
+static const char _rcsid[] = "$Id: files.c,v 1.3 2005/01/01 02:43:59 rockyb Exp $";
inline static bool
_pal_p (const struct vcd_mpeg_stream_vid_info *_info)
@@ -136,15 +136,15 @@ _derive_aud_type (const struct vcd_mpeg_stream_info *_info, bool svcd)
void
set_entries_vcd (VcdObj *obj, void *buf)
{
- VcdListNode *node = NULL;
+ CdioListNode *node = NULL;
int idx = 0;
int track_idx = 0;
- EntriesVcd entries_vcd;
+ EntriesVcd_t entries_vcd;
- vcd_assert (sizeof(EntriesVcd) == 2048);
+ vcd_assert (sizeof(EntriesVcd_t) == 2048);
- vcd_assert (_vcd_list_length (obj->mpeg_track_list) <= MAX_ENTRIES);
- vcd_assert (_vcd_list_length (obj->mpeg_track_list) > 0);
+ vcd_assert (_cdio_list_length (obj->mpeg_track_list) <= MAX_ENTRIES);
+ vcd_assert (_cdio_list_length (obj->mpeg_track_list) > 0);
memset(&entries_vcd, 0, sizeof(entries_vcd)); /* paranoia / fixme */
@@ -193,29 +193,29 @@ set_entries_vcd (VcdObj *obj, void *buf)
idx = 0;
track_idx = 2;
- _VCD_LIST_FOREACH (node, obj->mpeg_sequence_list)
+ _CDIO_LIST_FOREACH (node, obj->mpeg_sequence_list)
{
- mpeg_sequence_t *track = _vcd_list_node_data (node);
+ mpeg_sequence_t *track = _cdio_list_node_data (node);
uint32_t lsect = track->relative_start_extent;
- VcdListNode *node2;
+ CdioListNode *node2;
lsect += obj->iso_size;
- entries_vcd.entry[idx].n = to_bcd8(track_idx);
+ entries_vcd.entry[idx].n = cdio_to_bcd8(track_idx);
cdio_lba_to_msf(cdio_lsn_to_lba(lsect),
&(entries_vcd.entry[idx].msf));
idx++;
lsect += obj->track_front_margin;
- _VCD_LIST_FOREACH (node2, track->entry_list)
+ _CDIO_LIST_FOREACH (node2, track->entry_list)
{
- entry_t *_entry = _vcd_list_node_data (node2);
+ entry_t *_entry = _cdio_list_node_data (node2);
/* additional entries */
vcd_assert (idx < MAX_ENTRIES);
- entries_vcd.entry[idx].n = to_bcd8(track_idx);
+ entries_vcd.entry[idx].n = cdio_to_bcd8(track_idx);
cdio_lba_to_msf(lsect + cdio_lsn_to_lba(_entry->aps.packet_no),
&(entries_vcd.entry[idx].msf));
@@ -257,16 +257,16 @@ get_psd_size (VcdObj *obj, bool extended)
void
set_psd_vcd (VcdObj *obj, void *buf, bool extended)
{
- VcdListNode *node;
+ CdioListNode *node;
if (extended)
vcd_assert (_vcd_obj_has_cap_p (obj, _CAP_PBC_X));
vcd_assert (_vcd_pbc_available (obj));
- _VCD_LIST_FOREACH (node, obj->pbc_list)
+ _CDIO_LIST_FOREACH (node, obj->pbc_list)
{
- pbc_t *_pbc = _vcd_list_node_data (node);
+ pbc_t *_pbc = _cdio_list_node_data (node);
char *_buf = buf;
unsigned offset = (extended ? _pbc->offset_ext : _pbc->offset);
@@ -279,23 +279,23 @@ set_psd_vcd (VcdObj *obj, void *buf, bool extended)
void
set_lot_vcd(VcdObj *obj, void *buf, bool extended)
{
- LotVcd *lot_vcd = NULL;
- VcdListNode *node;
+ LotVcd_t *lot_vcd = NULL;
+ CdioListNode *node;
if (extended)
vcd_assert (_vcd_obj_has_cap_p (obj, _CAP_PBC_X));
vcd_assert (_vcd_pbc_available (obj));
- lot_vcd = _vcd_malloc (sizeof (LotVcd));
- memset(lot_vcd, 0xff, sizeof(LotVcd));
+ lot_vcd = _vcd_malloc (sizeof (LotVcd_t));
+ memset(lot_vcd, 0xff, sizeof(LotVcd_t));
lot_vcd->reserved = 0x0000;
- _VCD_LIST_FOREACH (node, obj->pbc_list)
+ _CDIO_LIST_FOREACH (node, obj->pbc_list)
{
- pbc_t *_pbc = _vcd_list_node_data (node);
- unsigned offset = extended ? _pbc->offset_ext : _pbc->offset;
+ pbc_t *_pbc = _cdio_list_node_data (node);
+ unsigned int offset = extended ? _pbc->offset_ext : _pbc->offset;
vcd_assert (offset % INFO_OFFSET_MULT == 0);
@@ -307,19 +307,19 @@ set_lot_vcd(VcdObj *obj, void *buf, bool extended)
lot_vcd->offset[_pbc->lid - 1] = uint16_to_be (offset);
}
- memcpy(buf, lot_vcd, sizeof(LotVcd));
+ memcpy(buf, lot_vcd, sizeof(LotVcd_t));
free(lot_vcd);
}
void
set_info_vcd(VcdObj *obj, void *buf)
{
- InfoVcd info_vcd;
- VcdListNode *node = NULL;
+ InfoVcd_t info_vcd;
+ CdioListNode *node = NULL;
int n = 0;
- vcd_assert (sizeof (InfoVcd) == 2048);
- vcd_assert (_vcd_list_length (obj->mpeg_track_list) <= 98);
+ vcd_assert (sizeof (InfoVcd_t) == 2048);
+ vcd_assert (_cdio_list_length (obj->mpeg_track_list) <= 98);
memset (&info_vcd, 0, sizeof (info_vcd));
@@ -373,9 +373,9 @@ set_info_vcd(VcdObj *obj, void *buf)
/* NTSC/PAL bitset */
n = 0;
- _VCD_LIST_FOREACH (node, obj->mpeg_track_list)
+ _CDIO_LIST_FOREACH (node, obj->mpeg_track_list)
{
- mpeg_track_t *track = _vcd_list_node_data (node);
+ mpeg_track_t *track = _cdio_list_node_data (node);
const struct vcd_mpeg_stream_vid_info *_info = &track->info->shdr[0];
@@ -407,7 +407,7 @@ set_info_vcd(VcdObj *obj, void *buf)
info_vcd.offset_mult = _vcd_pbc_available (obj) ? INFO_OFFSET_MULT : 0;
info_vcd.lot_entries = uint16_to_be (_vcd_pbc_max_lid (obj));
- if (_vcd_list_length (obj->mpeg_segment_list))
+ if (_cdio_list_length (obj->mpeg_segment_list))
{
unsigned segments = 0;
@@ -415,9 +415,9 @@ set_info_vcd(VcdObj *obj, void *buf)
vcd_warn ("segment items available, but no PBC items set!"
" SPIs will be unreachable");
- _VCD_LIST_FOREACH (node, obj->mpeg_segment_list)
+ _CDIO_LIST_FOREACH (node, obj->mpeg_segment_list)
{
- mpeg_segment_t *segment = _vcd_list_node_data (node);
+ mpeg_segment_t *segment = _cdio_list_node_data (node);
unsigned idx;
InfoSpiContents contents = { 0, };
@@ -465,20 +465,20 @@ set_tracks_svd_v30 (VcdObj *obj, void *buf)
{
char tracks_svd_buf[ISO_BLOCKSIZE] = { 0, };
TracksSVD_v30 *tracks_svd = (void *) tracks_svd_buf;
- VcdListNode *node;
+ CdioListNode *node;
double playtime;
int n;
strncpy (tracks_svd->file_id, TRACKS_SVD_FILE_ID,
sizeof (TRACKS_SVD_FILE_ID));
tracks_svd->version = TRACKS_SVD_VERSION;
- tracks_svd->tracks = _vcd_list_length (obj->mpeg_track_list);
+ tracks_svd->tracks = _cdio_list_length (obj->mpeg_track_list);
n = 0;
playtime = 0;
- _VCD_LIST_FOREACH (node, obj->mpeg_track_list)
+ _CDIO_LIST_FOREACH (node, obj->mpeg_track_list)
{
- mpeg_track_t *track = _vcd_list_node_data (node);
+ mpeg_track_t *track = _cdio_list_node_data (node);
int i;
playtime += track->info->playing_time;
@@ -502,7 +502,8 @@ set_tracks_svd_v30 (VcdObj *obj, void *buf)
f = modf(playtime, &i);
cdio_lba_to_msf (i * 75, &tracks_svd->track[n].cum_playing_time);
- tracks_svd->track[n].cum_playing_time.f = to_bcd8 (floor (f * 75.0));
+ tracks_svd->track[n].cum_playing_time.f =
+ cdio_to_bcd8 (floor (f * 75.0));
}
n++;
@@ -517,7 +518,7 @@ set_tracks_svd (VcdObj *obj, void *buf)
char tracks_svd[ISO_BLOCKSIZE] = { 0, };
TracksSVD *tracks_svd1 = (void *) tracks_svd;
TracksSVD2 *tracks_svd2;
- VcdListNode *node;
+ CdioListNode *node;
int n;
vcd_assert (_vcd_obj_has_cap_p (obj, _CAP_4C_SVCD));
@@ -533,15 +534,15 @@ set_tracks_svd (VcdObj *obj, void *buf)
strncpy (tracks_svd1->file_id, TRACKS_SVD_FILE_ID, sizeof (TRACKS_SVD_FILE_ID));
tracks_svd1->version = TRACKS_SVD_VERSION;
- tracks_svd1->tracks = _vcd_list_length (obj->mpeg_track_list);
+ tracks_svd1->tracks = _cdio_list_length (obj->mpeg_track_list);
tracks_svd2 = (void *) &(tracks_svd1->playing_time[tracks_svd1->tracks]);
n = 0;
- _VCD_LIST_FOREACH (node, obj->mpeg_track_list)
+ _CDIO_LIST_FOREACH (node, obj->mpeg_track_list)
{
- mpeg_track_t *track = _vcd_list_node_data (node);
+ mpeg_track_t *track = _cdio_list_node_data (node);
const double playtime = track->info->playing_time;
int _video;
@@ -574,7 +575,7 @@ set_tracks_svd (VcdObj *obj, void *buf)
}
cdio_lba_to_msf (i * 75, &(tracks_svd1->playing_time[n]));
- tracks_svd1->playing_time[n].f = to_bcd8 (floor (f * 75.0));
+ tracks_svd1->playing_time[n].f = cdio_to_bcd8 (floor (f * 75.0));
}
n++;
@@ -587,11 +588,11 @@ static double
_get_cumulative_playing_time (const VcdObj *obj, unsigned up_to_track_no)
{
double result = 0;
- VcdListNode *node;
+ CdioListNode *node;
- _VCD_LIST_FOREACH (node, obj->mpeg_track_list)
+ _CDIO_LIST_FOREACH (node, obj->mpeg_track_list)
{
- mpeg_track_t *track = _vcd_list_node_data (node);
+ mpeg_track_t *track = _cdio_list_node_data (node);
if (!up_to_track_no)
break;
@@ -611,7 +612,7 @@ _get_scanpoint_count (const VcdObj *obj)
{
double total_playing_time;
- total_playing_time = _get_cumulative_playing_time (obj, _vcd_list_length (obj->mpeg_track_list));
+ total_playing_time = _get_cumulative_playing_time (obj, _cdio_list_length (obj->mpeg_track_list));
return ceil (total_playing_time * 2.0);
}
@@ -623,39 +624,39 @@ get_search_dat_size (const VcdObj *obj)
+ (_get_scanpoint_count (obj) * sizeof (msf_t));
}
-static VcdList *
+static CdioList *
_make_track_scantable (const VcdObj *obj)
{
- VcdList *all_aps = _vcd_list_new ();
- VcdList *scantable = _vcd_list_new ();
+ CdioList *all_aps = _cdio_list_new ();
+ CdioList *scantable = _cdio_list_new ();
unsigned scanpoints = _get_scanpoint_count (obj);
unsigned track_no;
- VcdListNode *node;
+ CdioListNode *node;
track_no = 0;
- _VCD_LIST_FOREACH (node, obj->mpeg_track_list)
+ _CDIO_LIST_FOREACH (node, obj->mpeg_track_list)
{
- mpeg_track_t *track = _vcd_list_node_data (node);
- VcdListNode *node2;
+ mpeg_track_t *track = _cdio_list_node_data (node);
+ CdioListNode *node2;
- _VCD_LIST_FOREACH (node2, track->info->shdr[0].aps_list)
+ _CDIO_LIST_FOREACH (node2, track->info->shdr[0].aps_list)
{
struct aps_data *_data = _vcd_malloc (sizeof (struct aps_data));
- *_data = *(struct aps_data *)_vcd_list_node_data (node2);
+ *_data = *(struct aps_data *)_cdio_list_node_data (node2);
_data->timestamp += _get_cumulative_playing_time (obj, track_no);
_data->packet_no += obj->iso_size + track->relative_start_extent;
_data->packet_no += obj->track_front_margin;
- _vcd_list_append (all_aps, _data);
+ _cdio_list_append (all_aps, _data);
}
track_no++;
}
{
- VcdListNode *aps_node = _vcd_list_begin (all_aps);
- VcdListNode *n;
+ CdioListNode *aps_node = _cdio_list_begin (all_aps);
+ CdioListNode *n;
struct aps_data *_data;
double aps_time;
double playing_time;
@@ -667,15 +668,16 @@ _make_track_scantable (const VcdObj *obj)
vcd_assert (aps_node != NULL);
- _data = _vcd_list_node_data (aps_node);
+ _data = _cdio_list_node_data (aps_node);
aps_time = _data->timestamp;
aps_packet = _data->packet_no;
for (t = 0; t < playing_time; t += 0.5)
{
- for(n = _vcd_list_node_next (aps_node); n; n = _vcd_list_node_next (n))
+ for(n = _cdio_list_node_next (aps_node); n;
+ n = _cdio_list_node_next (n))
{
- _data = _vcd_list_node_data (n);
+ _data = _cdio_list_node_data (n);
if (fabs (_data->timestamp - t) < fabs (aps_time - t))
{
@@ -691,16 +693,16 @@ _make_track_scantable (const VcdObj *obj)
uint32_t *lsect = _vcd_malloc (sizeof (uint32_t));
*lsect = aps_packet;
- _vcd_list_append (scantable, lsect);
+ _cdio_list_append (scantable, lsect);
}
}
}
- _vcd_list_free (all_aps, true);
+ _cdio_list_free (all_aps, true);
- vcd_assert (scanpoints == _vcd_list_length (scantable));
+ vcd_assert (scanpoints == _cdio_list_length (scantable));
return scantable;
}
@@ -708,8 +710,8 @@ _make_track_scantable (const VcdObj *obj)
void
set_search_dat (VcdObj *obj, void *buf)
{
- VcdList *scantable;
- VcdListNode *node;
+ CdioList *scantable;
+ CdioListNode *node;
SearchDat search_dat;
unsigned n;
@@ -729,10 +731,10 @@ set_search_dat (VcdObj *obj, void *buf)
scantable = _make_track_scantable (obj);
n = 0;
- _VCD_LIST_FOREACH (node, scantable)
+ _CDIO_LIST_FOREACH (node, scantable)
{
SearchDat *search_dat2 = buf;
- uint32_t sect = *(uint32_t *) _vcd_list_node_data (node);
+ uint32_t sect = *(uint32_t *) _cdio_list_node_data (node);
cdio_lba_to_msf(cdio_lsn_to_lba(sect), &(search_dat2->points[n]));
n++;
@@ -740,7 +742,7 @@ set_search_dat (VcdObj *obj, void *buf)
vcd_assert (n = _get_scanpoint_count (obj));
- _vcd_list_free (scantable, true);
+ _cdio_list_free (scantable, true);
}
static uint32_t
@@ -752,7 +754,7 @@ _get_scandata_count (const struct vcd_mpeg_stream_info *info)
static uint32_t *
_get_scandata_table (const struct vcd_mpeg_stream_info *info)
{
- VcdListNode *n, *aps_node = _vcd_list_begin (info->shdr[0].aps_list);
+ CdioListNode *n, *aps_node = _cdio_list_begin (info->shdr[0].aps_list);
struct aps_data *_data;
double aps_time, t;
int aps_packet;
@@ -761,15 +763,15 @@ _get_scandata_table (const struct vcd_mpeg_stream_info *info)
retval = _vcd_malloc (_get_scandata_count (info) * sizeof (uint32_t));
- _data = _vcd_list_node_data (aps_node);
+ _data = _cdio_list_node_data (aps_node);
aps_time = _data->timestamp;
aps_packet = _data->packet_no;
for (t = 0, i = 0; t < info->playing_time; t += 0.5, i++)
{
- for(n = _vcd_list_node_next (aps_node); n; n = _vcd_list_node_next (n))
+ for(n = _cdio_list_node_next (aps_node); n; n = _cdio_list_node_next (n))
{
- _data = _vcd_list_node_data (n);
+ _data = _cdio_list_node_data (n);
if (fabs (_data->timestamp - t) < fabs (aps_time - t))
{
@@ -800,7 +802,7 @@ get_scandata_dat_size (const VcdObj *obj)
/* struct 1 */
retval += sizeof (ScandataDat1);
- retval += sizeof (msf_t) * _vcd_list_length (obj->mpeg_track_list);
+ retval += sizeof (msf_t) * _cdio_list_length (obj->mpeg_track_list);
/* struct 2 */
/* vcd_assert (sizeof (ScandataDat2) == 0);
@@ -809,16 +811,16 @@ get_scandata_dat_size (const VcdObj *obj)
/* struct 3 */
retval += sizeof (ScandataDat3);
- retval += (sizeof (uint8_t) + sizeof (uint16_t)) * _vcd_list_length (obj->mpeg_track_list);
+ retval += (sizeof (uint8_t) + sizeof (uint16_t)) * _cdio_list_length (obj->mpeg_track_list);
/* struct 4 */
/* vcd_assert (sizeof (ScandataDat4) == 0);
retval += sizeof (ScandataDat4); */
{
- VcdListNode *node;
- _VCD_LIST_FOREACH (node, obj->mpeg_track_list)
+ CdioListNode *node;
+ _CDIO_LIST_FOREACH (node, obj->mpeg_track_list)
{
- const mpeg_track_t *track = _vcd_list_node_data (node);
+ const mpeg_track_t *track = _cdio_list_node_data (node);
retval += sizeof (msf_t) * _get_scandata_count (track->info);
}
@@ -830,7 +832,7 @@ get_scandata_dat_size (const VcdObj *obj)
void
set_scandata_dat (VcdObj *obj, void *buf)
{
- const unsigned tracks = _vcd_list_length (obj->mpeg_track_list);
+ const unsigned tracks = _cdio_list_length (obj->mpeg_track_list);
ScandataDat1 *scandata_dat1 = (ScandataDat1 *) buf;
ScandataDat2 *scandata_dat2 =
@@ -844,7 +846,7 @@ set_scandata_dat (VcdObj *obj, void *buf)
__cd_offsetof (ScandataDat3, mpeg_track_offsets[tracks])
- __cd_offsetof (ScandataDat3, mpeg_track_offsets);
- VcdListNode *node;
+ CdioListNode *node;
unsigned n;
uint16_t _tmp_offset;
@@ -875,7 +877,7 @@ set_scandata_dat (VcdObj *obj, void *buf)
vcd_assert (i >= 0);
cdio_lba_to_msf (i * 75, &(scandata_dat1->cum_playtimes[n]));
- scandata_dat1->cum_playtimes[n].f = to_bcd8 (floor (f * 75.0));
+ scandata_dat1->cum_playtimes[n].f = cdio_to_bcd8 (floor (f * 75.0));
}
/* struct 2 -- nothing yet */
@@ -890,9 +892,9 @@ set_scandata_dat (VcdObj *obj, void *buf)
scandata_dat3->mpegtrack_start_index = uint16_to_be (_begin_offset);
n = 0;
- _VCD_LIST_FOREACH (node, obj->mpeg_track_list)
+ _CDIO_LIST_FOREACH (node, obj->mpeg_track_list)
{
- const mpeg_track_t *track = _vcd_list_node_data (node);
+ const mpeg_track_t *track = _cdio_list_node_data (node);
uint32_t *_table;
const unsigned scanpoints = _get_scandata_count (track->info);
const unsigned _table_ofs =
@@ -932,7 +934,7 @@ set_scandata_dat (VcdObj *obj, void *buf)
vcd_type_t
vcd_files_info_detect_type (const void *info_buf)
{
- const InfoVcd *_info = info_buf;
+ const InfoVcd_t *_info = info_buf;
vcd_type_t _type = VCD_TYPE_INVALID;
vcd_assert (info_buf != NULL);
diff --git a/src/input/vcd/libvcd/image.c b/src/input/vcd/libvcd/image.c
index 8824d3b79..d26bb0910 100644
--- a/src/input/vcd/libvcd/image.c
+++ b/src/input/vcd/libvcd/image.c
@@ -1,5 +1,5 @@
/*
- $Id: image.c,v 1.2 2004/04/11 12:20:32 miguelfreitas Exp $
+ $Id: image.c,v 1.3 2005/01/01 02:43:59 rockyb Exp $
Copyright (C) 2001 Herbert Valerio Riedel <hvr@gnu.org>
2002 Rocky Bernstein <rocky@panix.com>
@@ -34,7 +34,7 @@
#include "image_sink.h"
#include "util.h"
-static const char _rcsid[] = "$Id: image.c,v 1.2 2004/04/11 12:20:32 miguelfreitas Exp $";
+static const char _rcsid[] = "$Id: image.c,v 1.3 2005/01/01 02:43:59 rockyb Exp $";
/*
* VcdImageSink routines next.
@@ -68,7 +68,7 @@ vcd_image_sink_destroy (VcdImageSink *obj)
}
int
-vcd_image_sink_set_cuesheet (VcdImageSink *obj, const VcdList *vcd_cue_list)
+vcd_image_sink_set_cuesheet (VcdImageSink *obj, const CdioList *vcd_cue_list)
{
vcd_assert (obj != NULL);
@@ -76,7 +76,7 @@ vcd_image_sink_set_cuesheet (VcdImageSink *obj, const VcdList *vcd_cue_list)
}
int
-vcd_image_sink_write (VcdImageSink *obj, void *buf, uint32_t lsn)
+vcd_image_sink_write (VcdImageSink *obj, void *buf, lsn_t lsn)
{
vcd_assert (obj != NULL);
diff --git a/src/input/vcd/libvcd/image_bincue.c b/src/input/vcd/libvcd/image_bincue.c
index f8af4bbe0..9c447a42a 100644
--- a/src/input/vcd/libvcd/image_bincue.c
+++ b/src/input/vcd/libvcd/image_bincue.c
@@ -1,7 +1,7 @@
/*
- $Id: image_bincue.c,v 1.2 2004/04/11 12:20:32 miguelfreitas Exp $
+ $Id: image_bincue.c,v 1.3 2005/01/01 02:43:59 rockyb Exp $
- Copyright (C) 2001 Herbert Valerio Riedel <hvr@gnu.org>
+ Copyright (C) 2001, 2004 Herbert Valerio Riedel <hvr@gnu.org>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -27,6 +27,7 @@
#include <string.h>
#include <cdio/cdio.h>
+#include <cdio/bytesex.h>
#include <cdio/iso9660.h>
/* Public headers */
@@ -35,12 +36,11 @@
/* Private headers */
#include "vcd_assert.h"
-#include "bytesex.h"
#include "image_sink.h"
#include "stream_stdio.h"
#include "util.h"
-static const char _rcsid[] = "$Id: image_bincue.c,v 1.2 2004/04/11 12:20:32 miguelfreitas Exp $";
+static const char _rcsid[] = "$Id: image_bincue.c,v 1.3 2005/01/01 02:43:59 rockyb Exp $";
/* reader */
@@ -88,10 +88,10 @@ _sink_free (void *user_data)
}
static int
-_set_cuesheet (void *user_data, const VcdList *vcd_cue_list)
+_set_cuesheet (void *user_data, const CdioList *vcd_cue_list)
{
_img_bincue_snk_t *_obj = user_data;
- VcdListNode *node;
+ CdioListNode *node;
int track_no, index_no;
const vcd_cue_t *_last_cue = 0;
@@ -102,9 +102,10 @@ _set_cuesheet (void *user_data, const VcdList *vcd_cue_list)
track_no = 0;
index_no = 0;
- _VCD_LIST_FOREACH (node, (VcdList *) vcd_cue_list)
+ _CDIO_LIST_FOREACH (node, (CdioList *) vcd_cue_list)
{
- const vcd_cue_t *_cue = _vcd_list_node_data (node);
+ const vcd_cue_t *_cue = _cdio_list_node_data (node);
+ char *psz_msf;
msf_t _msf = { 0, 0, 0 };
@@ -122,19 +123,23 @@ _set_cuesheet (void *user_data, const VcdList *vcd_cue_list)
if (_last_cue && _last_cue->type == VCD_CUE_PREGAP_START)
{
cdio_lba_to_msf (_last_cue->lsn, &_msf);
+ psz_msf = cdio_msf_to_str(&_msf);
vcd_data_sink_printf (_obj->cue_snk,
- " INDEX %2.2d %2.2x:%2.2x:%2.2x\r\n",
- index_no, _msf.m, _msf.s, _msf.f);
+ " INDEX %2.2d %s\r\n",
+ index_no, psz_msf);
+ free(psz_msf);
}
index_no++;
cdio_lba_to_msf (_cue->lsn, &_msf);
+ psz_msf = cdio_msf_to_str(&_msf);
vcd_data_sink_printf (_obj->cue_snk,
- " INDEX %2.2d %2.2x:%2.2x:%2.2x\r\n",
- index_no, _msf.m, _msf.s, _msf.f);
+ " INDEX %2.2d %s\r\n",
+ index_no, psz_msf);
+ free(psz_msf);
break;
case VCD_CUE_PREGAP_START:
@@ -145,13 +150,15 @@ _set_cuesheet (void *user_data, const VcdList *vcd_cue_list)
vcd_assert (_last_cue != 0);
index_no++;
- vcd_assert (index_no < 100);
+ vcd_assert (index_no <= CDIO_CD_MAX_TRACKS);
cdio_lba_to_msf (_cue->lsn, &_msf);
+ psz_msf = cdio_msf_to_str(&_msf);
vcd_data_sink_printf (_obj->cue_snk,
- " INDEX %2.2d %2.2x:%2.2x:%2.2x\r\n",
- index_no, _msf.m, _msf.s, _msf.f);
+ " INDEX %2.2d %s\r\n",
+ index_no, psz_msf);
+ free(psz_msf);
break;
case VCD_CUE_END:
@@ -172,7 +179,7 @@ _set_cuesheet (void *user_data, const VcdList *vcd_cue_list)
}
static int
-_vcd_image_bincue_write (void *user_data, const void *data, uint32_t lsn)
+_vcd_image_bincue_write (void *user_data, const void *data, lsn_t lsn)
{
const char *buf = data;
_img_bincue_snk_t *_obj = user_data;
diff --git a/src/input/vcd/libvcd/image_cdrdao.c b/src/input/vcd/libvcd/image_cdrdao.c
index 58543ff8e..5e00c14ee 100644
--- a/src/input/vcd/libvcd/image_cdrdao.c
+++ b/src/input/vcd/libvcd/image_cdrdao.c
@@ -1,5 +1,5 @@
/*
- $Id: image_cdrdao.c,v 1.2 2004/04/11 12:20:32 miguelfreitas Exp $
+ $Id: image_cdrdao.c,v 1.3 2005/01/01 02:43:59 rockyb Exp $
Copyright (C) 2001 Herbert Valerio Riedel <hvr@gnu.org>
@@ -28,18 +28,18 @@
/* Public headers */
#include <cdio/iso9660.h>
+#include <cdio/bytesex.h>
#include <libvcd/sector.h>
#include <libvcd/logging.h>
/* Private headers */
#include "vcd_assert.h"
-#include "bytesex.h"
#include "image_sink.h"
#include "stream_stdio.h"
#include "util.h"
#include "vcd.h"
-static const char _rcsid[] = "$Id: image_cdrdao.c,v 1.2 2004/04/11 12:20:32 miguelfreitas Exp $";
+static const char _rcsid[] = "$Id: image_cdrdao.c,v 1.3 2005/01/01 02:43:59 rockyb Exp $";
/* reader */
@@ -56,7 +56,7 @@ typedef struct {
int last_snk_idx;
bool last_pause;
- VcdList *vcd_cue_list;
+ CdioList *vcd_cue_list;
} _img_cdrdao_snk_t;
static void
@@ -73,12 +73,12 @@ _sink_free (void *user_data)
}
static int
-_set_cuesheet (void *user_data, const VcdList *vcd_cue_list)
+_set_cuesheet (void *user_data, const CdioList *vcd_cue_list)
{
_img_cdrdao_snk_t *_obj = user_data;
VcdDataSink *toc_snk = vcd_data_sink_new_stdio (_obj->toc_fname);
- VcdListNode *node;
+ CdioListNode *node;
int track_no, index_no;
const vcd_cue_t *_last_cue = 0;
@@ -89,18 +89,18 @@ _set_cuesheet (void *user_data, const VcdList *vcd_cue_list)
"// generated by %s\n\n"
"CD_ROM_XA\n", vcd_version_string (false));
- _obj->vcd_cue_list = _vcd_list_new ();
+ _obj->vcd_cue_list = _cdio_list_new ();
index_no = track_no = 0;
- _VCD_LIST_FOREACH (node, (VcdList *) vcd_cue_list)
+ _CDIO_LIST_FOREACH (node, (CdioList *) vcd_cue_list)
{
- const vcd_cue_t *_cue = _vcd_list_node_data (node);
+ const vcd_cue_t *_cue = _cdio_list_node_data (node);
/* copy cue list while traversing */
{
vcd_cue_t *_cue2 = _vcd_malloc (sizeof (vcd_cue_t));
*_cue2 = *_cue;
- _vcd_list_append (_obj->vcd_cue_list, _cue2);
+ _cdio_list_append (_obj->vcd_cue_list, _cue2);
}
switch (_cue->type)
@@ -139,12 +139,13 @@ _set_cuesheet (void *user_data, const VcdList *vcd_cue_list)
{
msf_t _msf = { 0, 0, 0 };
+ char *psz_msf;
cdio_lba_to_msf (_cue->lsn - last_track_lsn, &_msf);
+ psz_msf = cdio_msf_to_str(&_msf);
- vcd_data_sink_printf (toc_snk,
- " INDEX %2.2x:%2.2x:%2.2x\n",
- _msf.m, _msf.s, _msf.f);
+ vcd_data_sink_printf (toc_snk, " INDEX %s\n", psz_msf);
+ free(psz_msf);
}
break;
@@ -170,23 +171,23 @@ _set_cuesheet (void *user_data, const VcdList *vcd_cue_list)
}
static int
-_vcd_image_cdrdao_write (void *user_data, const void *data, uint32_t lsn)
+_vcd_image_cdrdao_write (void *user_data, const void *data, lsn_t lsn)
{
const char *buf = data;
_img_cdrdao_snk_t *_obj = user_data;
long offset;
{
- VcdListNode *node;
+ CdioListNode *node;
uint32_t _last = 0;
uint32_t _ofs = 0;
bool _lpregap = false;
bool _pregap = false;
int num = 0, in_track = 0;
- _VCD_LIST_FOREACH (node, _obj->vcd_cue_list)
+ _CDIO_LIST_FOREACH (node, _obj->vcd_cue_list)
{
- const vcd_cue_t *_cue = _vcd_list_node_data (node);
+ const vcd_cue_t *_cue = _cdio_list_node_data (node);
switch (_cue->type)
{
diff --git a/src/input/vcd/libvcd/image_nrg.c b/src/input/vcd/libvcd/image_nrg.c
index 29798d724..c7912e26a 100644
--- a/src/input/vcd/libvcd/image_nrg.c
+++ b/src/input/vcd/libvcd/image_nrg.c
@@ -1,7 +1,7 @@
/*
- $Id: image_nrg.c,v 1.2 2004/04/11 12:20:32 miguelfreitas Exp $
+ $Id: image_nrg.c,v 1.3 2005/01/01 02:43:59 rockyb Exp $
- Copyright (C) 2001,2003 Herbert Valerio Riedel <hvr@gnu.org>
+ Copyright (C) 2001, 2003, 2004 Herbert Valerio Riedel <hvr@gnu.org>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -31,6 +31,7 @@
#include <string.h>
#include <cdio/cdio.h>
+#include <cdio/bytesex.h>
#include <cdio/iso9660.h>
/* Public headers */
@@ -39,12 +40,11 @@
/* Private headers */
#include "vcd_assert.h"
-#include "bytesex.h"
#include "image_sink.h"
#include "stream_stdio.h"
#include "util.h"
-static const char _rcsid[] = "$Id: image_nrg.c,v 1.2 2004/04/11 12:20:32 miguelfreitas Exp $";
+static const char _rcsid[] = "$Id: image_nrg.c,v 1.3 2005/01/01 02:43:59 rockyb Exp $";
/* structures used */
@@ -107,7 +107,7 @@ typedef struct {
VcdDataSink *nrg_snk;
char *nrg_fname;
- VcdList *vcd_cue_list;
+ CdioList *vcd_cue_list;
int tracks;
uint32_t cue_end_lsn;
@@ -139,23 +139,23 @@ _sink_free (void *user_data)
}
static int
-_set_cuesheet (void *user_data, const VcdList *vcd_cue_list)
+_set_cuesheet (void *user_data, const CdioList *vcd_cue_list)
{
_img_nrg_snk_t *_obj = user_data;
- VcdListNode *node;
+ CdioListNode *node;
int num;
_sink_init (_obj);
- _obj->vcd_cue_list = _vcd_list_new ();
+ _obj->vcd_cue_list = _cdio_list_new ();
num = 0;
- _VCD_LIST_FOREACH (node, (VcdList *) vcd_cue_list)
+ _CDIO_LIST_FOREACH (node, (CdioList *) vcd_cue_list)
{
- const vcd_cue_t *_cue = _vcd_list_node_data (node);
+ const vcd_cue_t *_cue = _cdio_list_node_data (node);
vcd_cue_t *_cue2 = _vcd_malloc (sizeof (vcd_cue_t));
*_cue2 = *_cue;
- _vcd_list_append (_obj->vcd_cue_list, _cue2);
+ _cdio_list_append (_obj->vcd_cue_list, _cue2);
if (_cue->type == VCD_CUE_TRACK_START)
num++;
@@ -166,7 +166,7 @@ _set_cuesheet (void *user_data, const VcdList *vcd_cue_list)
_obj->tracks = num;
- vcd_assert (num > 0 && num < 100);
+ vcd_assert (CDIO_CD_MIN_TRACK_NO >= 1 && num <= CDIO_CD_MAX_TRACKS);
return 0;
}
@@ -174,15 +174,15 @@ _set_cuesheet (void *user_data, const VcdList *vcd_cue_list)
static uint32_t
_map (_img_nrg_snk_t *_obj, uint32_t lsn)
{
- VcdListNode *node;
+ CdioListNode *node;
uint32_t result = lsn;
vcd_cue_t *_cue = NULL, *_last = NULL;
vcd_assert (_obj->cue_end_lsn > lsn);
- _VCD_LIST_FOREACH (node, _obj->vcd_cue_list)
+ _CDIO_LIST_FOREACH (node, _obj->vcd_cue_list)
{
- _cue = _vcd_list_node_data (node);
+ _cue = _cdio_list_node_data (node);
if (lsn < _cue->lsn)
break;
@@ -226,7 +226,7 @@ _map (_img_nrg_snk_t *_obj, uint32_t lsn)
static int
_write_tail (_img_nrg_snk_t *_obj, uint32_t offset)
{
- VcdListNode *node;
+ CdioListNode *node;
int _size;
_chunk_t _chunk;
@@ -238,13 +238,14 @@ _write_tail (_img_nrg_snk_t *_obj, uint32_t offset)
vcd_data_sink_write (_obj->nrg_snk, &_chunk, sizeof (_chunk_t), 1);
- _VCD_LIST_FOREACH (node, _obj->vcd_cue_list)
+ _CDIO_LIST_FOREACH (node, _obj->vcd_cue_list)
{
- vcd_cue_t *_cue = _vcd_list_node_data (node);
+ vcd_cue_t *_cue = _cdio_list_node_data (node);
if (_cue->type == VCD_CUE_TRACK_START)
{
- vcd_cue_t *_cue2 = _vcd_list_node_data (_vcd_list_node_next (node));
+ vcd_cue_t *_cue2 =
+ _cdio_list_node_data (_cdio_list_node_next (node));
_etnf_array_t _etnf = { 0, };
@@ -281,7 +282,7 @@ _write_tail (_img_nrg_snk_t *_obj, uint32_t offset)
}
static int
-_vcd_image_nrg_write (void *user_data, const void *data, uint32_t lsn)
+_vcd_image_nrg_write (void *user_data, const void *data, lsn_t lsn)
{
const char *buf = data;
_img_nrg_snk_t *_obj = user_data;
diff --git a/src/input/vcd/libvcd/image_sink.h b/src/input/vcd/libvcd/image_sink.h
index 98bbc0eb5..a71e30199 100644
--- a/src/input/vcd/libvcd/image_sink.h
+++ b/src/input/vcd/libvcd/image_sink.h
@@ -1,5 +1,5 @@
/*
- $Id: image_sink.h,v 1.2 2004/04/11 12:20:32 miguelfreitas Exp $
+ $Id: image_sink.h,v 1.3 2005/01/01 02:43:59 rockyb Exp $
Copyright (C) 2001 Herbert Valerio Riedel <hvr@gnu.org>
@@ -48,7 +48,7 @@ typedef struct {
} vcd_cue_t;
typedef struct {
- int (*set_cuesheet) (void *user_data, const VcdList *vcd_cue_list);
+ int (*set_cuesheet) (void *user_data, const CdioList *vcd_cue_list);
int (*write) (void *user_data, const void *buf, lsn_t lsn);
void (*free) (void *user_data);
int (*set_arg) (void *user_data, const char key[], const char value[]);
@@ -61,7 +61,7 @@ void
vcd_image_sink_destroy (VcdImageSink *obj);
int
-vcd_image_sink_set_cuesheet (VcdImageSink *obj, const VcdList *vcd_cue_list);
+vcd_image_sink_set_cuesheet (VcdImageSink *obj, const CdioList *vcd_cue_list);
int
vcd_image_sink_write (VcdImageSink *obj, void *buf, lsn_t lsn);
diff --git a/src/input/vcd/libvcd/inf.c b/src/input/vcd/libvcd/inf.c
index c483f76af..588c8e5f7 100644
--- a/src/input/vcd/libvcd/inf.c
+++ b/src/input/vcd/libvcd/inf.c
@@ -1,5 +1,5 @@
/*
- $Id: inf.c,v 1.2 2004/04/11 12:20:32 miguelfreitas Exp $
+ $Id: inf.c,v 1.3 2005/01/01 02:43:59 rockyb Exp $
Copyright (C) 2002,2003 Rocky Bernstein <rocky@panix.com>
@@ -50,17 +50,17 @@
#endif
#include <cdio/cdio.h>
+#include <cdio/bytesex.h>
#include <cdio/util.h>
/* Eventually move above libvcd includes but having vcdinfo including. */
#include <libvcd/info.h>
/* Private headers */
-#include "bytesex.h"
#include "info_private.h"
#include "pbc.h"
-static const char _rcsid[] = "$Id: inf.c,v 1.2 2004/04/11 12:20:32 miguelfreitas Exp $";
+static const char _rcsid[] = "$Id: inf.c,v 1.3 2005/01/01 02:43:59 rockyb Exp $";
#define BUF_COUNT 16
#define BUF_SIZE 80
@@ -105,29 +105,18 @@ vcdinf_area_str (const struct psd_area_t *_area)
some problem in getting this.
*/
const char *
-vcdinf_get_album_id(const InfoVcd *info)
+vcdinf_get_album_id(const InfoVcd_t *info)
{
if (NULL==info) return NULL;
return vcdinfo_strip_trail (info->album_desc, MAX_ALBUM_LEN);
}
/*!
- Return the VCD application ID.
- NULL is returned if there is some problem in getting this.
-*/
-const char *
-vcdinf_get_application_id(const iso9660_pvd_t *pvd)
-{
- if (NULL==pvd) return NULL;
- return(vcdinfo_strip_trail(pvd->application_id, MAX_APPLICATION_ID));
-}
-
-/*!
Get autowait time value for PsdPlayListDescriptor *d.
Time is in seconds unless it is -1 (unlimited).
*/
int
-vcdinf_get_autowait_time (const PsdPlayListDescriptor *d)
+vcdinf_get_autowait_time (const PsdPlayListDescriptor_t *d)
{
return vcdinfo_get_wait_time (d->atime);
}
@@ -137,7 +126,7 @@ vcdinf_get_autowait_time (const PsdPlayListDescriptor *d)
is an error.
*/
unsigned int
-vcdinf_get_bsn(const PsdSelectionListDescriptor *psd)
+vcdinf_get_bsn(const PsdSelectionListDescriptor_t *psd)
{
if (NULL==psd) return VCDINFO_INVALID_BSN;
return(psd->bsn);
@@ -179,7 +168,7 @@ vcdinf_get_format_version_str (vcd_type_t vcd_type)
Return loop count. 0 is infinite loop.
*/
uint16_t
-vcdinf_get_loop_count (const PsdSelectionListDescriptor *psd)
+vcdinf_get_loop_count (const PsdSelectionListDescriptor_t *psd)
{
return 0x7f & psd->loop;
}
@@ -188,7 +177,7 @@ vcdinf_get_loop_count (const PsdSelectionListDescriptor *psd)
Return LOT offset
*/
uint16_t
-vcdinf_get_lot_offset (const LotVcd *lot, unsigned int n)
+vcdinf_get_lot_offset (const LotVcd_t *lot, unsigned int n)
{
return uint16_from_be (lot->offset[n]);
}
@@ -197,7 +186,7 @@ vcdinf_get_lot_offset (const LotVcd *lot, unsigned int n)
Return the number of entries in the VCD.
*/
unsigned int
-vcdinf_get_num_entries(const EntriesVcd *entries)
+vcdinf_get_num_entries(const EntriesVcd_t *entries)
{
if (NULL==entries) return 0;
return (uint16_from_be (entries->entry_count));
@@ -207,7 +196,7 @@ vcdinf_get_num_entries(const EntriesVcd *entries)
Return the number of segments in the VCD.
*/
segnum_t
-vcdinf_get_num_segments(const InfoVcd *info)
+vcdinf_get_num_segments(const InfoVcd_t *info)
{
if (NULL==info) return 0;
return (uint16_from_be (info->item_count));
@@ -217,7 +206,7 @@ vcdinf_get_num_segments(const InfoVcd *info)
Return number of LIDs.
*/
lid_t
-vcdinf_get_num_LIDs (const InfoVcd *info)
+vcdinf_get_num_LIDs (const InfoVcd_t *info)
{
if (NULL==info) return 0;
/* Should probably use _vcd_pbc_max_lid instead? */
@@ -228,7 +217,7 @@ vcdinf_get_num_LIDs (const InfoVcd *info)
Return the number of menu selections for selection list descriptor psd.
*/
unsigned int
-vcdinf_get_num_selections(const PsdSelectionListDescriptor *psd)
+vcdinf_get_num_selections(const PsdSelectionListDescriptor_t *psd)
{
return psd->nos;
}
@@ -238,62 +227,29 @@ vcdinf_get_num_selections(const PsdSelectionListDescriptor *psd)
Time is in 1/15-second units.
*/
uint16_t
-vcdinf_get_play_time (const PsdPlayListDescriptor *d)
+vcdinf_get_play_time (const PsdPlayListDescriptor_t *d)
{
if (NULL==d) return 0;
return uint16_from_be (d->ptime);
}
/*!
- Return a string containing the VCD preparer id with trailing
- blanks removed.
-*/
-const char *
-vcdinf_get_preparer_id(const iso9660_pvd_t *pvd)
-{
- if (NULL==pvd) return NULL;
- return(vcdinfo_strip_trail(pvd->preparer_id, MAX_PREPARER_ID));
-}
-
-/*!
- Return a string containing the VCD publisher id with trailing
- blanks removed.
-*/
-const char *
-vcdinf_get_publisher_id(const iso9660_pvd_t *pvd)
-{
- if (NULL==pvd) return NULL;
- return(vcdinfo_strip_trail(pvd->publisher_id, MAX_PUBLISHER_ID));
-}
-
-/*!
Return number of bytes in PSD.
*/
uint32_t
-vcdinf_get_psd_size (const InfoVcd *info)
+vcdinf_get_psd_size (const InfoVcd_t *info)
{
if (NULL==info) return 0;
return uint32_from_be (info->psd_size);
}
/*!
- Return a string containing the VCD system id with trailing
- blanks removed.
-*/
-const char *
-vcdinf_get_system_id(const iso9660_pvd_t *pvd)
-{
- if (NULL==pvd) return NULL;
- return(vcdinfo_strip_trail(pvd->system_id, MAX_SYSTEM_ID));
-}
-
-/*!
Get timeout wait time value for PsdPlayListDescriptor *d.
Return VCDINFO_INVALID_OFFSET if d is NULL;
Time is in seconds unless it is -1 (unlimited).
*/
uint16_t
-vcdinf_get_timeout_offset (const PsdSelectionListDescriptor *d)
+vcdinf_get_timeout_offset (const PsdSelectionListDescriptor_t *d)
{
if (NULL == d) return VCDINFO_INVALID_OFFSET;
return uint16_from_be (d->timeout_ofs);
@@ -304,7 +260,7 @@ vcdinf_get_timeout_offset (const PsdSelectionListDescriptor *d)
Time is in seconds unless it is -1 (unlimited).
*/
int
-vcdinf_get_timeout_time (const PsdSelectionListDescriptor *d)
+vcdinf_get_timeout_time (const PsdSelectionListDescriptor_t *d)
{
return vcdinfo_get_wait_time (d->totime);
}
@@ -315,12 +271,12 @@ vcdinf_get_timeout_time (const PsdSelectionListDescriptor *d)
(We don't count the header track?)
*/
track_t
-vcdinf_get_track(const EntriesVcd *entries, const unsigned int entry_num)
+vcdinf_get_track(const EntriesVcd_t *entries, const unsigned int entry_num)
{
const unsigned int entry_count = uint16_from_be (entries->entry_count);
/* Note entry_num is 0 origin. */
return entry_num < entry_count ?
- from_bcd8 (entries->entry[entry_num].n):
+ cdio_from_bcd8 (entries->entry[entry_num].n):
VCDINFO_INVALID_TRACK;
}
@@ -328,50 +284,29 @@ vcdinf_get_track(const EntriesVcd *entries, const unsigned int entry_num)
Return the VCD volume count - the number of CD's in the collection.
*/
unsigned int
-vcdinf_get_volume_count(const InfoVcd *info)
+vcdinf_get_volume_count(const InfoVcd_t *info)
{
if (NULL==info) return 0;
return(uint16_from_be( info->vol_count));
}
/*!
- Return the VCD ID.
-*/
-const char *
-vcdinf_get_volume_id(const iso9660_pvd_t *pvd)
-{
- if (NULL == pvd) return NULL;
- return(vcdinfo_strip_trail(pvd->volume_id, MAX_VOLUME_ID));
-}
-
-/*!
Return the VCD volume num - the number of the CD in the collection.
This is a number between 1 and the volume count.
*/
unsigned int
-vcdinf_get_volume_num(const InfoVcd *info)
+vcdinf_get_volume_num(const InfoVcd_t *info)
{
if (NULL == info) return 0;
return uint16_from_be(info->vol_id);
}
/*!
- Return the VCD volumeset ID.
- NULL is returned if there is some problem in getting this.
-*/
-const char *
-vcdinf_get_volumeset_id(const iso9660_pvd_t *pvd)
-{
- if ( NULL == pvd ) return NULL;
- return vcdinfo_strip_trail(pvd->volume_set_id, MAX_VOLUMESET_ID);
-}
-
-/*!
Get wait time value for PsdPlayListDescriptor *d.
Time is in seconds unless it is -1 (unlimited).
*/
int
-vcdinf_get_wait_time (const PsdPlayListDescriptor *d)
+vcdinf_get_wait_time (const PsdPlayListDescriptor_t *d)
{
return vcdinfo_get_wait_time (d->wtime);
}
@@ -380,7 +315,7 @@ vcdinf_get_wait_time (const PsdPlayListDescriptor *d)
Return true if loop has a jump delay
*/
bool
-vcdinf_has_jump_delay (const PsdSelectionListDescriptor *psd)
+vcdinf_has_jump_delay (const PsdSelectionListDescriptor_t *psd)
{
if (NULL==psd) return false;
return ((0x80 & psd->loop) != 0);
@@ -419,7 +354,7 @@ vcdinf_lid_t_cmp (vcdinfo_offset_t *a, vcdinfo_offset_t *b)
VCDINFO_REJECTED_MASK is returned d on error or pld is NULL.
*/
lid_t
-vcdinf_pld_get_lid(const PsdPlayListDescriptor *pld)
+vcdinf_pld_get_lid(const PsdPlayListDescriptor_t *pld)
{
return (pld != NULL)
? uint16_from_be (pld->lid) & VCDINFO_LID_MASK
@@ -433,7 +368,7 @@ vcdinf_pld_get_lid(const PsdPlayListDescriptor *pld)
entry or pld is NULL. Otherwise the LID offset is returned.
*/
uint16_t
-vcdinf_pld_get_next_offset(const PsdPlayListDescriptor *pld)
+vcdinf_pld_get_next_offset(const PsdPlayListDescriptor_t *pld)
{
if (NULL == pld) return VCDINFO_INVALID_OFFSET;
return uint16_from_be (pld->next_ofs);
@@ -443,7 +378,7 @@ vcdinf_pld_get_next_offset(const PsdPlayListDescriptor *pld)
Return number of items in LIDs. Return 0 if error or not found.
*/
int
-vcdinf_pld_get_noi (const PsdPlayListDescriptor *pld)
+vcdinf_pld_get_noi (const PsdPlayListDescriptor_t *pld)
{
if ( NULL == pld ) return 0;
return pld->noi;
@@ -453,7 +388,7 @@ vcdinf_pld_get_noi (const PsdPlayListDescriptor *pld)
Return the playlist item i in d.
*/
uint16_t
-vcdinf_pld_get_play_item(const PsdPlayListDescriptor *pld, unsigned int i)
+vcdinf_pld_get_play_item(const PsdPlayListDescriptor_t *pld, unsigned int i)
{
if (NULL==pld) return 0;
return uint16_from_be(pld->itemid[i]);
@@ -466,7 +401,7 @@ vcdinf_pld_get_play_item(const PsdPlayListDescriptor *pld, unsigned int i)
entry or pld is NULL. Otherwise the LID offset is returned.
*/
uint16_t
-vcdinf_pld_get_prev_offset(const PsdPlayListDescriptor *pld)
+vcdinf_pld_get_prev_offset(const PsdPlayListDescriptor_t *pld)
{
return (pld != NULL) ?
uint16_from_be (pld->prev_ofs) : VCDINFO_INVALID_OFFSET;
@@ -479,7 +414,7 @@ vcdinf_pld_get_prev_offset(const PsdPlayListDescriptor *pld)
"return" entry or pld is NULL. Otherwise the LID offset is returned.
*/
uint16_t
-vcdinf_pld_get_return_offset(const PsdPlayListDescriptor *pld)
+vcdinf_pld_get_return_offset(const PsdPlayListDescriptor_t *pld)
{
return (pld != NULL) ?
uint16_from_be (pld->return_ofs) : VCDINFO_INVALID_OFFSET;
@@ -492,7 +427,7 @@ vcdinf_pld_get_return_offset(const PsdPlayListDescriptor *pld)
* NULL. Otherwise the LID offset is returned.
*/
uint16_t
-vcdinf_psd_get_default_offset(const PsdSelectionListDescriptor *psd)
+vcdinf_psd_get_default_offset(const PsdSelectionListDescriptor_t *psd)
{
if (NULL == psd) return VCDINFO_INVALID_OFFSET;
return uint16_from_be (psd->default_ofs);
@@ -503,7 +438,7 @@ vcdinf_psd_get_default_offset(const PsdSelectionListDescriptor *psd)
VCDINFO_REJECTED_MASK is returned on error or if psd is NULL.
*/
uint16_t
-vcdinf_psd_get_itemid(const PsdSelectionListDescriptor *psd)
+vcdinf_psd_get_itemid(const PsdSelectionListDescriptor_t *psd)
{
return (psd != NULL) ? uint16_from_be(psd->itemid) : VCDINFO_REJECTED_MASK;
}
@@ -513,7 +448,7 @@ vcdinf_psd_get_itemid(const PsdSelectionListDescriptor *psd)
VCDINFO_REJECTED_MASK is returned on error or psd is NULL.
*/
lid_t
-vcdinf_psd_get_lid(const PsdSelectionListDescriptor *psd)
+vcdinf_psd_get_lid(const PsdSelectionListDescriptor_t *psd)
{
return (psd != NULL)
? uint16_from_be (psd->lid) & VCDINFO_LID_MASK
@@ -525,7 +460,7 @@ vcdinf_psd_get_lid(const PsdSelectionListDescriptor *psd)
true is also returned d is NULL.
*/
bool
-vcdinf_psd_get_lid_rejected(const PsdSelectionListDescriptor *psd)
+vcdinf_psd_get_lid_rejected(const PsdSelectionListDescriptor_t *psd)
{
return (psd != NULL)
? vcdinfo_is_rejected(uint16_from_be(psd->lid))
@@ -539,7 +474,7 @@ vcdinf_psd_get_lid_rejected(const PsdSelectionListDescriptor *psd)
* NULL. Otherwise the LID offset is returned.
*/
uint16_t
-vcdinf_psd_get_next_offset(const PsdSelectionListDescriptor *psd)
+vcdinf_psd_get_next_offset(const PsdSelectionListDescriptor_t *psd)
{
if (NULL == psd) return VCDINFO_INVALID_OFFSET;
return uint16_from_be (psd->next_ofs);
@@ -553,7 +488,7 @@ vcdinf_psd_get_next_offset(const PsdSelectionListDescriptor *psd)
* NULL. Otherwise the LID offset is returned.
*/
uint16_t
-vcdinf_psd_get_offset(const PsdSelectionListDescriptor *psd,
+vcdinf_psd_get_offset(const PsdSelectionListDescriptor_t *psd,
unsigned int entry_num)
{
return (psd != NULL && entry_num < vcdinf_get_num_selections(psd))
@@ -567,7 +502,7 @@ vcdinf_psd_get_offset(const PsdSelectionListDescriptor *psd,
entry or psd is NULL. Otherwise the LID offset is returned.
*/
uint16_t
-vcdinf_psd_get_prev_offset(const PsdSelectionListDescriptor *psd)
+vcdinf_psd_get_prev_offset(const PsdSelectionListDescriptor_t *psd)
{
return (psd != NULL) ?
uint16_from_be (psd->prev_ofs) : VCDINFO_INVALID_OFFSET;
@@ -580,7 +515,7 @@ vcdinf_psd_get_prev_offset(const PsdSelectionListDescriptor *psd)
"return" entry or psd is NULL. Otherwise the LID offset is returned.
*/
uint16_t
-vcdinf_psd_get_return_offset(const PsdSelectionListDescriptor *psd)
+vcdinf_psd_get_return_offset(const PsdSelectionListDescriptor_t *psd)
{
return (psd != NULL) ?
uint16_from_be (psd->return_ofs) : VCDINFO_INVALID_OFFSET;
diff --git a/src/input/vcd/libvcd/info.c b/src/input/vcd/libvcd/info.c
index 096cb0b84..accd3e77f 100644
--- a/src/input/vcd/libvcd/info.c
+++ b/src/input/vcd/libvcd/info.c
@@ -1,7 +1,7 @@
/*
- $Id: info.c,v 1.2 2004/04/11 12:20:32 miguelfreitas Exp $
+ $Id: info.c,v 1.3 2005/01/01 02:43:59 rockyb Exp $
- Copyright (C) 2002,2003 Rocky Bernstein <rocky@panix.com>
+ Copyright (C) 2002, 2003, 2004 Rocky Bernstein <rocky@panix.com>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -27,7 +27,6 @@
/* Private headers */
#include "info_private.h"
#include "vcd_assert.h"
-#include "bytesex.h"
#include "pbc.h"
#include "util.h"
#include "vcd_read.h"
@@ -49,6 +48,7 @@
#endif
#include <cdio/cdio.h>
+#include <cdio/bytesex.h>
#include <cdio/cd_types.h>
#include <cdio/util.h>
@@ -59,11 +59,7 @@
#include <stddef.h>
#include <errno.h>
-static const char _rcsid[] = "$Id: info.c,v 1.2 2004/04/11 12:20:32 miguelfreitas Exp $";
-
-#define MIN_ENCODED_TRACK_NUM 100
-#define MIN_ENCODED_SEGMENT_NUM 1000
-#define MAX_ENCODED_SEGMENT_NUM 2979
+static const char _rcsid[] = "$Id: info.c,v 1.3 2005/01/01 02:43:59 rockyb Exp $";
#define BUF_COUNT 16
#define BUF_SIZE 80
@@ -98,10 +94,10 @@ _getbuf (void)
static void
_init_segments (vcdinfo_obj_t *obj)
{
- InfoVcd *info = vcdinfo_get_infoVcd(obj);
+ InfoVcd_t *info = vcdinfo_get_infoVcd(obj);
segnum_t num_segments = vcdinfo_get_num_segments(obj);
- VcdListNode *entnode;
- VcdList *entlist;
+ CdioListNode *entnode;
+ CdioList *entlist;
int i;
lsn_t last_lsn=0;
@@ -113,8 +109,8 @@ _init_segments (vcdinfo_obj_t *obj)
entlist = iso9660_fs_readdir(obj->img, "SEGMENT", true);
i=0;
- _VCD_LIST_FOREACH (entnode, entlist) {
- iso9660_stat_t *statbuf = _vcd_list_node_data (entnode);
+ _CDIO_LIST_FOREACH (entnode, entlist) {
+ iso9660_stat_t *statbuf = _cdio_list_node_data (entnode);
if (statbuf->type == _STAT_DIR) continue;
@@ -145,7 +141,7 @@ _init_segments (vcdinfo_obj_t *obj)
vcd_warn ("Number of segments found %d is not number of segments %d",
i, num_segments);
- _vcd_list_free (entlist, true);
+ _cdio_list_free (entlist, true);
#if 0
@@ -281,7 +277,7 @@ vcdinfo_audio_type2str(const vcdinfo_obj_t *obj, unsigned int audio_type)
const char *
vcdinfo_ogt2str(const vcdinfo_obj_t *obj, segnum_t seg_num)
{
- const InfoVcd *info = &obj->info;
+ const InfoVcd_t *info = &obj->info;
const char *ogt_str[] =
{
"None",
@@ -356,7 +352,7 @@ vcdinfo_pin2str (uint16_t itemid_num)
snprintf (buf, BUF_SIZE, "play nothing (0x%4.4x)", itemid.num);
break;
case VCDINFO_ITEM_TYPE_TRACK:
- snprintf (buf, BUF_SIZE, "SEQUENCE[%d] (0x%4.4x)", itemid.num,
+ snprintf (buf, BUF_SIZE, "SEQUENCE[%d] (0x%4.4x)", itemid.num-1,
itemid_num);
break;
case VCDINFO_ITEM_TYPE_ENTRY:
@@ -391,11 +387,11 @@ vcdinfo_get_album_id(const vcdinfo_obj_t *obj)
Return the VCD ID.
NULL is returned if there is some problem in getting this.
*/
-const char *
-vcdinfo_get_application_id(const vcdinfo_obj_t *obj)
+char *
+vcdinfo_get_application_id(vcdinfo_obj_t *p_obj)
{
- if ( NULL == obj ) return (NULL);
- return(vcdinf_get_application_id(&obj->pvd));
+ if ( NULL == p_obj ) return (NULL);
+ return iso9660_get_application_id(&p_obj->pvd);
}
/*!
@@ -452,16 +448,25 @@ lid_t vcdinfo_selection_get_lid(const vcdinfo_obj_t *obj, lid_t lid,
Return the LID offset associated with a the selection number of the
passed-in LID parameter.
- \return VCDINFO_INVALID_OFFSET is returned if obj on error or obj
- is NULL. Otherwise the LID offset is returned.
+ \return VCDINFO_INVALID_OFFSET is returned if error, obj is NULL or
+ the lid is not some type of selection list. Otherwise the LID offset
+ is returned.
*/
uint16_t vcdinfo_selection_get_offset(const vcdinfo_obj_t *obj, lid_t lid,
unsigned int selection)
{
unsigned int bsn;
- PsdListDescriptor pxd;
+ PsdListDescriptor_t pxd;
vcdinfo_lid_get_pxd(obj, &pxd, lid);
+ if (pxd.descriptor_type != PSD_TYPE_SELECTION_LIST &&
+ pxd.descriptor_type != PSD_TYPE_EXT_SELECTION_LIST) {
+ vcd_warn( "Requesting selection of LID %i which not a selection list -"
+ " type is 0x%x",
+ lid, pxd.descriptor_type );
+ return VCDINFO_INVALID_OFFSET;
+ }
+
bsn=vcdinf_get_bsn(pxd.psd);
if ( (selection - bsn + 1) > 0) {
@@ -483,7 +488,7 @@ vcdinfo_get_default_offset(const vcdinfo_obj_t *obj, lid_t lid)
{
if (NULL != obj) {
- PsdListDescriptor pxd;
+ PsdListDescriptor_t pxd;
vcdinfo_lid_get_pxd(obj, &pxd, lid);
@@ -518,9 +523,14 @@ vcdinfo_get_default_offset(const vcdinfo_obj_t *obj, lid_t lid)
*/
lid_t
vcdinfo_get_multi_default_lid(const vcdinfo_obj_t *obj, lid_t lid,
- unsigned int entry_num)
+ lsn_t lsn)
{
- unsigned int offset = vcdinfo_get_multi_default_offset(obj, lid, entry_num);
+ unsigned int offset;
+ unsigned int entry_num;
+
+ entry_num = vcdinfo_lsn_get_entry(obj, lsn);
+ offset = vcdinfo_get_multi_default_offset(obj, lid, entry_num);
+
switch (offset) {
case VCDINFO_INVALID_OFFSET:
case PSD_OFS_MULTI_DEF:
@@ -560,21 +570,34 @@ vcdinfo_get_multi_default_offset(const vcdinfo_obj_t *obj, lid_t lid,
case PSD_OFS_MULTI_DEF_NO_NUM:
{
/* Have some work todo... Figure the selection number. */
- unsigned int selection=0;
- track_t track=vcdinfo_get_track(obj, entry_num);
- track_t prev_track=VCDINFO_INVALID_TRACK;
- for (selection=1;
- track != VCDINFO_INVALID_TRACK
- && track != prev_track
- && entry_num > 0;
- selection++) {
- prev_track = track;
- track=vcdinfo_get_track(obj, --entry_num);
+ PsdListDescriptor_t pxd;
+
+ vcdinfo_lid_get_pxd(obj, &pxd, lid);
+
+ switch (pxd.descriptor_type) {
+
+ case PSD_TYPE_SELECTION_LIST:
+ case PSD_TYPE_EXT_SELECTION_LIST: {
+ vcdinfo_itemid_t selection_itemid;
+ uint16_t selection_itemid_num;
+ unsigned int start_entry_num;
+
+ if (pxd.psd == NULL) return VCDINFO_INVALID_OFFSET;
+ selection_itemid_num = vcdinf_psd_get_itemid(pxd.psd);
+ vcdinfo_classify_itemid(selection_itemid_num, &selection_itemid);
+ if (selection_itemid.type != VCDINFO_ITEM_TYPE_TRACK) {
+ return VCDINFO_INVALID_OFFSET;
+ }
+
+ start_entry_num = vcdinfo_track_get_entry(obj, selection_itemid.num);
+ return vcdinfo_selection_get_offset(obj, lid,
+ entry_num-start_entry_num);
+ }
+ default: ;
}
- return vcdinfo_selection_get_offset(obj, lid, selection);
}
- default:
- return offset;
+ default:
+ return VCDINFO_INVALID_OFFSET;
}
}
@@ -605,7 +628,7 @@ vcdinfo_get_default_device (const vcdinfo_obj_t *vcd_obj)
uint32_t
vcdinfo_get_entry_sect_count (const vcdinfo_obj_t *obj, unsigned int entry_num)
{
- const EntriesVcd *entries = &obj->entries;
+ const EntriesVcd_t *entries = &obj->entries;
const unsigned int entry_count = vcdinf_get_num_entries(entries);
if (entry_num > entry_count)
return 0;
@@ -665,7 +688,7 @@ vcdinfo_get_entry_sect_count (const vcdinfo_obj_t *obj, unsigned int entry_num)
const msf_t *
vcdinfo_get_entry_msf(const vcdinfo_obj_t *obj, unsigned int entry_num)
{
- const EntriesVcd *entries = &obj->entries;
+ const EntriesVcd_t *entries = &obj->entries;
return vcdinf_get_entry_msf(entries, entry_num);
}
@@ -696,6 +719,13 @@ vcdinfo_get_entry_lsn(const vcdinfo_obj_t *obj, unsigned int entry_num)
}
}
+EntriesVcd_t *
+vcdinfo_get_entriesVcd (vcdinfo_obj_t *obj)
+{
+ if (NULL == obj) return NULL;
+ return &obj->entries;
+}
+
/*!
Get the VCD format (VCD 1.0 VCD 1.1, SVCD, ... for this object.
The type is also set inside obj.
@@ -717,25 +747,41 @@ vcdinfo_get_format_version_str (const vcdinfo_obj_t *obj)
return vcdinf_get_format_version_str(obj->vcd_type);
}
-EntriesVcd *
-vcdinfo_get_entriesVcd (vcdinfo_obj_t *obj)
+InfoVcd_t *
+vcdinfo_get_infoVcd (vcdinfo_obj_t *obj)
{
if (NULL == obj) return NULL;
- return &obj->entries;
+ return &obj->info;
}
-InfoVcd *
-vcdinfo_get_infoVcd (vcdinfo_obj_t *obj)
+/*! Return the entry number closest and before the given LSN.
+ */
+unsigned int
+vcdinfo_lsn_get_entry(const vcdinfo_obj_t *obj, lsn_t lsn)
{
- if (NULL == obj) return NULL;
- return &obj->info;
+
+ /* Do a binary search to find the entry. */
+ unsigned int i = 0;
+ unsigned int j = vcdinfo_get_num_entries(obj);
+ unsigned int mid;
+ unsigned int mid_lsn;
+ do {
+ mid = (i+j)/2;
+ mid_lsn = vcdinfo_get_entry_lsn(obj, mid);
+ if ( lsn <= mid_lsn ) j = mid-1;
+ if ( lsn >= mid_lsn ) i = mid+1;
+ } while (i <= j);
+
+ /* We want the entry closest but before. */
+ return (lsn == mid_lsn) ? mid : mid-1;
}
+
void *
-vcdinfo_get_tracksSVD (vcdinfo_obj_t *obj)
+vcdinfo_get_pvd (vcdinfo_obj_t *obj)
{
if (NULL == obj) return NULL;
- return obj->tracks_buf;
+ return &obj->pvd;
}
void *
@@ -753,10 +799,10 @@ vcdinfo_get_searchDat (vcdinfo_obj_t *obj)
}
void *
-vcdinfo_get_pvd (vcdinfo_obj_t *obj)
+vcdinfo_get_tracksSVD (vcdinfo_obj_t *obj)
{
if (NULL == obj) return NULL;
- return &obj->pvd;
+ return obj->tracks_buf;
}
/*!
@@ -766,7 +812,7 @@ vcdinfo_get_pvd (vcdinfo_obj_t *obj)
uint16_t
vcdinfo_lid_get_itemid(const vcdinfo_obj_t *obj, lid_t lid)
{
- PsdListDescriptor pxd;
+ PsdListDescriptor_t pxd;
if (obj == NULL) return VCDINFO_REJECTED_MASK;
vcdinfo_lid_get_pxd(obj, &pxd, lid);
@@ -790,7 +836,7 @@ vcdinfo_lid_get_itemid(const vcdinfo_obj_t *obj, lid_t lid)
/*!
Get the LOT pointer.
*/
-LotVcd *
+LotVcd_t *
vcdinfo_get_lot(const vcdinfo_obj_t *obj)
{
if (NULL == obj) return NULL;
@@ -800,7 +846,7 @@ vcdinfo_get_lot(const vcdinfo_obj_t *obj)
/*!
Get the extended LOT pointer.
*/
-LotVcd *
+LotVcd_t *
vcdinfo_get_lot_x(const vcdinfo_obj_t *obj)
{
if (NULL == obj) return NULL;
@@ -824,7 +870,7 @@ vcdinfo_get_num_LIDs (const vcdinfo_obj_t *obj)
unsigned int
vcdinfo_get_num_entries(const vcdinfo_obj_t *obj)
{
- const EntriesVcd *entries = &obj->entries;
+ const EntriesVcd_t *entries = &obj->entries;
return vcdinf_get_num_entries(entries);
}
@@ -849,7 +895,7 @@ uint16_t
vcdinfo_lid_get_offset(const vcdinfo_obj_t *obj, lid_t lid,
unsigned int entry_num)
{
- PsdListDescriptor pxd;
+ PsdListDescriptor_t pxd;
if (obj == NULL) return VCDINFO_INVALID_OFFSET;
vcdinfo_lid_get_pxd(obj, &pxd, lid);
@@ -876,8 +922,8 @@ vcdinfo_lid_get_offset(const vcdinfo_obj_t *obj, lid_t lid,
static vcdinfo_offset_t *
_vcdinfo_get_offset_t (const vcdinfo_obj_t *obj, unsigned int offset, bool ext)
{
- VcdListNode *node;
- VcdList *offset_list = ext ? obj->offset_x_list : obj->offset_list;
+ CdioListNode *node;
+ CdioList *offset_list = ext ? obj->offset_x_list : obj->offset_list;
switch (offset) {
case PSD_OFS_DISABLED:
@@ -887,9 +933,9 @@ _vcdinfo_get_offset_t (const vcdinfo_obj_t *obj, unsigned int offset, bool ext)
default: ;
}
- _VCD_LIST_FOREACH (node, offset_list)
+ _CDIO_LIST_FOREACH (node, offset_list)
{
- vcdinfo_offset_t *ofs = _vcd_list_node_data (node);
+ vcdinfo_offset_t *ofs = _cdio_list_node_data (node);
if (offset == ofs->offset)
return ofs;
}
@@ -899,7 +945,7 @@ _vcdinfo_get_offset_t (const vcdinfo_obj_t *obj, unsigned int offset, bool ext)
/*!
Get the VCD info list.
*/
-VcdList *
+CdioList *
vcdinfo_get_offset_list(const vcdinfo_obj_t *obj)
{
if (NULL == obj) return NULL;
@@ -910,7 +956,7 @@ vcdinfo_get_offset_list(const vcdinfo_obj_t *obj)
/*!
Get the VCD info extended offset list.
*/
-VcdList *
+CdioList *
vcdinfo_get_offset_x_list(const vcdinfo_obj_t *obj)
{
if (NULL == obj) return NULL;
@@ -947,7 +993,7 @@ const char *
vcdinfo_get_preparer_id(const vcdinfo_obj_t *obj)
{
if ( NULL == obj ) return (NULL);
- return vcdinf_get_preparer_id(&obj->pvd);
+ return iso9660_get_preparer_id(&obj->pvd);
}
/*!
@@ -998,7 +1044,7 @@ const char *
vcdinfo_get_publisher_id(const vcdinfo_obj_t *obj)
{
if ( NULL == obj ) return (NULL);
- return vcdinf_get_publisher_id(&obj->pvd);
+ return iso9660_get_publisher_id(&obj->pvd);
}
/*!
@@ -1006,19 +1052,19 @@ vcdinfo_get_publisher_id(const vcdinfo_obj_t *obj)
NULL is returned if error or not found.
*/
static bool
-_vcdinfo_lid_get_pxd(const vcdinfo_obj_t *obj, PsdListDescriptor *pxd,
+_vcdinfo_lid_get_pxd(const vcdinfo_obj_t *obj, PsdListDescriptor_t *pxd,
uint16_t lid, bool ext)
{
- VcdListNode *node;
+ CdioListNode *node;
unsigned mult = obj->info.offset_mult;
const uint8_t *psd = ext ? obj->psd_x : obj->psd;
- VcdList *offset_list = ext ? obj->offset_x_list : obj->offset_list;
+ CdioList *offset_list = ext ? obj->offset_x_list : obj->offset_list;
if (offset_list == NULL) return false;
- _VCD_LIST_FOREACH (node, offset_list)
+ _CDIO_LIST_FOREACH (node, offset_list)
{
- vcdinfo_offset_t *ofs = _vcd_list_node_data (node);
+ vcdinfo_offset_t *ofs = _cdio_list_node_data (node);
unsigned _rofs = ofs->offset * mult;
pxd->descriptor_type = psd[_rofs];
@@ -1027,7 +1073,7 @@ _vcdinfo_lid_get_pxd(const vcdinfo_obj_t *obj, PsdListDescriptor *pxd,
{
case PSD_TYPE_PLAY_LIST:
{
- pxd->pld = (PsdPlayListDescriptor *) (psd + _rofs);
+ pxd->pld = (PsdPlayListDescriptor_t *) (psd + _rofs);
if (vcdinf_pld_get_lid(pxd->pld) == lid) {
return true;
}
@@ -1037,7 +1083,7 @@ _vcdinfo_lid_get_pxd(const vcdinfo_obj_t *obj, PsdListDescriptor *pxd,
case PSD_TYPE_EXT_SELECTION_LIST:
case PSD_TYPE_SELECTION_LIST:
{
- pxd->psd = (PsdSelectionListDescriptor *) (psd + _rofs);
+ pxd->psd = (PsdSelectionListDescriptor_t *) (psd + _rofs);
if (vcdinf_psd_get_lid(pxd->psd) == lid) {
return true;
}
@@ -1054,7 +1100,7 @@ _vcdinfo_lid_get_pxd(const vcdinfo_obj_t *obj, PsdListDescriptor *pxd,
False is returned if not found.
*/
bool
-vcdinfo_lid_get_pxd(const vcdinfo_obj_t *obj, PsdListDescriptor *pxd,
+vcdinfo_lid_get_pxd(const vcdinfo_obj_t *obj, PsdListDescriptor_t *pxd,
uint16_t lid)
{
if (_vcdinfo_lid_get_pxd(obj, pxd, lid, true))
@@ -1073,7 +1119,7 @@ vcdinfo_get_return_offset(const vcdinfo_obj_t *obj, lid_t lid)
{
if (NULL != obj) {
- PsdListDescriptor pxd;
+ PsdListDescriptor_t pxd;
vcdinfo_lid_get_pxd(obj, &pxd, lid);
@@ -1189,7 +1235,7 @@ const char *
vcdinfo_get_system_id(const vcdinfo_obj_t *obj)
{
if ( NULL == obj || NULL == &obj->pvd ) return (NULL);
- return(vcdinf_get_system_id(&obj->pvd));
+ return(iso9660_get_system_id(&obj->pvd));
}
/*!
@@ -1202,7 +1248,7 @@ vcdinfo_get_system_id(const vcdinfo_obj_t *obj)
track_t
vcdinfo_get_track(const vcdinfo_obj_t *obj, const unsigned int entry_num)
{
- const EntriesVcd *entries = &obj->entries;
+ const EntriesVcd_t *entries = &obj->entries;
const unsigned int entry_count = vcdinf_get_num_entries(entries);
/* Note entry_num is 0 origin. */
return entry_num < entry_count ?
@@ -1311,9 +1357,9 @@ vcdinfo_get_track_msf(const vcdinfo_obj_t *obj, track_t track_num,
/* CdIo tracks start at 1 rather than 0. */
if (cdio_get_track_msf(obj->img, track_num+1, &msf)) {
- *min = from_bcd8(msf.m);
- *sec = from_bcd8(msf.s);
- *frame = from_bcd8(msf.f);
+ *min = cdio_from_bcd8(msf.m);
+ *sec = cdio_from_bcd8(msf.s);
+ *frame = cdio_from_bcd8(msf.f);
return 0;
}
@@ -1398,7 +1444,7 @@ vcdinfo_get_track_size(const vcdinfo_obj_t *obj, track_t track_num)
vcdinfo_video_segment_type_t
vcdinfo_get_video_type(const vcdinfo_obj_t *obj, segnum_t seg_num)
{
- const InfoVcd *info;
+ const InfoVcd_t *info;
if (obj == NULL) return VCDINFO_FILES_VIDEO_INVALID;
info = &obj->info;
if (info == NULL) return VCDINFO_FILES_VIDEO_INVALID;
@@ -1435,7 +1481,7 @@ const char *
vcdinfo_get_volume_id(const vcdinfo_obj_t *obj)
{
if ( NULL == obj || NULL == &obj->pvd ) return (NULL);
- return(vcdinf_get_volume_id(&obj->pvd));
+ return(iso9660_get_volume_id(&obj->pvd));
}
/*!
@@ -1446,7 +1492,7 @@ const char *
vcdinfo_get_volumeset_id(const vcdinfo_obj_t *obj)
{
if ( NULL == obj || NULL == &obj->pvd ) return (NULL);
- return(vcdinfo_strip_trail(obj->pvd.volume_set_id, MAX_VOLUMESET_ID));
+ return(vcdinfo_strip_trail(obj->pvd.volume_set_id, ISO_MAX_VOLUMESET_ID));
}
/*!
@@ -1615,6 +1661,17 @@ vcdinfo_read_psd (vcdinfo_obj_t *obj)
return true;
}
+/*! Return the entry number for the given track. */
+unsigned int
+vcdinfo_track_get_entry(const vcdinfo_obj_t *obj, track_t i_track)
+{
+ /* FIXME: Add structure to directly map track to first entry number.
+ Until then...
+ */
+ lsn_t lsn= vcdinfo_get_track_lsn(obj, i_track);
+ return vcdinfo_lsn_get_entry(obj, lsn);
+}
+
/*!
Calls recursive routine to populate obj->offset_list or obj->offset_x_list
by going through LOT.
@@ -1641,10 +1698,10 @@ vcdinfo_visit_lot (vcdinfo_obj_t *obj, bool extended)
ret = vcdinf_visit_lot(&pbc_ctx);
if (NULL != obj->offset_x_list)
- _vcd_list_free(obj->offset_x_list, true);
+ _cdio_list_free(obj->offset_x_list, true);
obj->offset_x_list = pbc_ctx.offset_x_list;
if (NULL != obj->offset_list)
- _vcd_list_free(obj->offset_list, true);
+ _cdio_list_free(obj->offset_list, true);
obj->offset_list = pbc_ctx.offset_list;
return ret;
}
@@ -1747,10 +1804,10 @@ vcdinfo_open(vcdinfo_obj_t **obj_p, char *source_name[],
*/
if (NULL == *source_name && source_type == DRIVER_UNKNOWN) {
char **cd_drives=NULL;
- cd_drives = cdio_get_devices_with_cap(NULL,
+ cd_drives = cdio_get_devices_with_cap_ret(NULL,
(CDIO_FS_ANAL_SVCD|CDIO_FS_ANAL_CVD|CDIO_FS_ANAL_VIDEOCD
|CDIO_FS_UNKNOWN),
- true);
+ true, &source_type);
if ( NULL == cd_drives || NULL == cd_drives[0] ) {
return VCDINFO_OPEN_ERROR;
}
@@ -1776,7 +1833,7 @@ vcdinfo_open(vcdinfo_obj_t **obj_p, char *source_name[],
memset (obj, 0, sizeof (vcdinfo_obj_t));
obj->img = img; /* Note we do this after the above wipeout! */
- if (!read_pvd(obj->img, &(obj->pvd))) {
+ if (!iso9660_fs_read_pvd(obj->img, &(obj->pvd))) {
return VCDINFO_OPEN_ERROR;
}
@@ -1806,7 +1863,7 @@ vcdinfo_open(vcdinfo_obj_t **obj_p, char *source_name[],
}
if (obj->vcd_type == VCD_TYPE_SVCD || obj->vcd_type == VCD_TYPE_HQVCD) {
- statbuf = iso9660_fs_stat (obj->img, "MPEGAV", true);
+ statbuf = iso9660_fs_stat (obj->img, "MPEGAV");
if (NULL != statbuf) {
vcd_warn ("non compliant /MPEGAV folder detected!");
@@ -1814,7 +1871,7 @@ vcdinfo_open(vcdinfo_obj_t **obj_p, char *source_name[],
}
- statbuf = iso9660_fs_stat (obj->img, "SVCD/TRACKS.SVD;1", true);
+ statbuf = iso9660_fs_stat (obj->img, "SVCD/TRACKS.SVD;1");
if (NULL != statbuf) {
lsn_t lsn = statbuf->lsn;
if (statbuf->size != ISO_BLOCKSIZE)
@@ -1836,7 +1893,7 @@ vcdinfo_open(vcdinfo_obj_t **obj_p, char *source_name[],
iso9660_fs_readdir(img, "EXT", true) and then scanning for
the files listed below.
*/
- statbuf = iso9660_fs_stat (img, "EXT/PSD_X.VCD;1", true);
+ statbuf = iso9660_fs_stat (img, "EXT/PSD_X.VCD;1");
if (NULL != statbuf) {
lsn_t lsn = statbuf->lsn;
uint32_t secsize = statbuf->secsize;
@@ -1852,7 +1909,7 @@ vcdinfo_open(vcdinfo_obj_t **obj_p, char *source_name[],
return VCDINFO_OPEN_ERROR;
}
- statbuf = iso9660_fs_stat (img, "EXT/LOT_X.VCD;1", true);
+ statbuf = iso9660_fs_stat (img, "EXT/LOT_X.VCD;1");
if (NULL != statbuf) {
lsn_t lsn = statbuf->lsn;
uint32_t secsize = statbuf->secsize;
@@ -1877,13 +1934,13 @@ vcdinfo_open(vcdinfo_obj_t **obj_p, char *source_name[],
iso9660_fs_readdir(img, "SVCD", true) and then scanning for
the files listed below.
*/
- statbuf = iso9660_fs_stat (img, "MPEGAV", true);
+ statbuf = iso9660_fs_stat (img, "MPEGAV");
if (NULL != statbuf) {
vcd_warn ("non compliant /MPEGAV folder detected!");
free(statbuf);
}
- statbuf = iso9660_fs_stat (img, "SVCD/TRACKS.SVD;1", true);
+ statbuf = iso9660_fs_stat (img, "SVCD/TRACKS.SVD;1");
if (NULL == statbuf)
vcd_warn ("mandatory /SVCD/TRACKS.SVD not found!");
else {
@@ -1892,7 +1949,7 @@ vcdinfo_open(vcdinfo_obj_t **obj_p, char *source_name[],
free(statbuf);
}
- statbuf = iso9660_fs_stat (img, "SVCD/SEARCH.DAT;1", true);
+ statbuf = iso9660_fs_stat (img, "SVCD/SEARCH.DAT;1");
if (NULL == statbuf)
vcd_warn ("mandatory /SVCD/SEARCH.DAT not found!");
else {
@@ -1931,7 +1988,7 @@ vcdinfo_open(vcdinfo_obj_t **obj_p, char *source_name[],
;
}
- statbuf = iso9660_fs_stat (img, "EXT/SCANDATA.DAT;1", true);
+ statbuf = iso9660_fs_stat (img, "EXT/SCANDATA.DAT;1");
if (statbuf != NULL) {
lsn_t lsn = statbuf->lsn;
uint32_t secsize = statbuf->secsize;
@@ -1960,13 +2017,14 @@ vcdinfo_close(vcdinfo_obj_t *obj)
{
if (obj != NULL) {
if (obj->offset_list != NULL)
- _vcd_list_free(obj->offset_list, true);
+ _cdio_list_free(obj->offset_list, true);
if (obj->offset_x_list != NULL)
- _vcd_list_free(obj->offset_x_list, true);
+ _cdio_list_free(obj->offset_x_list, true);
free(obj->seg_sizes);
free(obj->lot);
free(obj->lot_x);
if (obj->psd_x) free(obj->psd_x);
+ if (obj->psd) free(obj->psd);
if (obj->scandata_buf) free(obj->scandata_buf);
free(obj->tracks_buf);
free(obj->search_buf);
diff --git a/src/input/vcd/libvcd/info_private.c b/src/input/vcd/libvcd/info_private.c
index bf86d9b89..9f89a3dcb 100644
--- a/src/input/vcd/libvcd/info_private.c
+++ b/src/input/vcd/libvcd/info_private.c
@@ -1,5 +1,5 @@
/*
- $Id: info_private.c,v 1.2 2004/04/11 12:20:32 miguelfreitas Exp $
+ $Id: info_private.c,v 1.3 2005/01/01 02:43:59 rockyb Exp $
Copyright (C) 2003 Rocky Bernstein <rocky@panix.com>
@@ -47,6 +47,7 @@
#endif
#include <cdio/cdio.h>
+#include <cdio/bytesex.h>
#include <cdio/util.h>
#include <libvcd/types.h>
@@ -56,12 +57,11 @@
/* Private headers */
#include "vcd_assert.h"
-#include "bytesex.h"
#include "data_structures.h"
#include "info_private.h"
#include "pbc.h"
-static const char _rcsid[] = "$Id: info_private.c,v 1.2 2004/04/11 12:20:32 miguelfreitas Exp $";
+static const char _rcsid[] = "$Id: info_private.c,v 1.3 2005/01/01 02:43:59 rockyb Exp $";
/*
This fills in unassigned LIDs in the offset table. Due to
@@ -75,25 +75,25 @@ vcdinf_update_offset_list(struct _vcdinf_pbc_ctx *obj, bool extended)
{
if (NULL==obj) return;
{
- VcdListNode *node;
- VcdList *unused_lids = _vcd_list_new();
- VcdListNode *next_unused_node = _vcd_list_begin(unused_lids);
+ CdioListNode *node;
+ CdioList *unused_lids = _cdio_list_new();
+ CdioListNode *next_unused_node = _cdio_list_begin(unused_lids);
unsigned int last_lid=0;
- VcdList *offset_list = extended ? obj->offset_x_list : obj->offset_list;
+ CdioList *offset_list = extended ? obj->offset_x_list : obj->offset_list;
lid_t max_seen_lid=0;
- _VCD_LIST_FOREACH (node, offset_list)
+ _CDIO_LIST_FOREACH (node, offset_list)
{
- vcdinfo_offset_t *ofs = _vcd_list_node_data (node);
+ vcdinfo_offset_t *ofs = _cdio_list_node_data (node);
if (!ofs->lid) {
/* We have a customer! Assign a LID from the free pool
or take one from the end if no skipped LIDs.
*/
- VcdListNode *node=_vcd_list_node_next(next_unused_node);
+ CdioListNode *node=_cdio_list_node_next(next_unused_node);
if (node != NULL) {
- lid_t *next_unused_lid=_vcd_list_node_data(node);
+ lid_t *next_unused_lid=_cdio_list_node_data(node);
ofs->lid = *next_unused_lid;
next_unused_node=node;
} else {
@@ -106,12 +106,12 @@ vcdinf_update_offset_list(struct _vcdinf_pbc_ctx *obj, bool extended)
while (last_lid != ofs->lid ) {
lid_t * lid=_vcd_malloc (sizeof(lid_t));
*lid = last_lid;
- _vcd_list_append(unused_lids, lid);
+ _cdio_list_append(unused_lids, lid);
}
if (last_lid > max_seen_lid) max_seen_lid=last_lid;
}
}
- _vcd_list_free(unused_lids, true);
+ _cdio_list_free(unused_lids, true);
}
}
@@ -124,7 +124,7 @@ vcdinf_update_offset_list(struct _vcdinf_pbc_ctx *obj, bool extended)
bool
vcdinf_visit_lot (struct _vcdinf_pbc_ctx *obj)
{
- const LotVcd *lot = obj->extended ? obj->lot_x : obj->lot;
+ const LotVcd_t *lot = obj->extended ? obj->lot_x : obj->lot;
unsigned int n, tmp;
bool ret=true;
@@ -137,7 +137,7 @@ vcdinf_visit_lot (struct _vcdinf_pbc_ctx *obj)
ret &= vcdinf_visit_pbc (obj, n + 1, tmp, true);
_vcd_list_sort (obj->extended ? obj->offset_x_list : obj->offset_list,
- (_vcd_list_cmp_func) vcdinf_lid_t_cmp);
+ (_cdio_list_cmp_func) vcdinf_lid_t_cmp);
/* Now really complete the offset table with LIDs. This routine
might obviate the need for vcdinf_visit_pbc() or some of it which is
@@ -156,12 +156,12 @@ bool
vcdinf_visit_pbc (struct _vcdinf_pbc_ctx *obj, lid_t lid, unsigned int offset,
bool in_lot)
{
- VcdListNode *node;
+ CdioListNode *node;
vcdinfo_offset_t *ofs;
unsigned int psd_size = obj->extended ? obj->psd_x_size : obj->psd_size;
const uint8_t *psd = obj->extended ? obj->psd_x : obj->psd;
unsigned int _rofs = offset * obj->offset_mult;
- VcdList *offset_list;
+ CdioList *offset_list;
bool ret=true;
vcd_assert (psd_size % 8 == 0);
@@ -188,19 +188,19 @@ vcdinf_visit_pbc (struct _vcdinf_pbc_ctx *obj, lid_t lid, unsigned int offset,
}
if (!obj->offset_list)
- obj->offset_list = _vcd_list_new ();
+ obj->offset_list = _cdio_list_new ();
if (!obj->offset_x_list)
- obj->offset_x_list = _vcd_list_new ();
+ obj->offset_x_list = _cdio_list_new ();
if (obj->extended) {
offset_list = obj->offset_x_list;
} else
offset_list = obj->offset_list;
- _VCD_LIST_FOREACH (node, offset_list)
+ _CDIO_LIST_FOREACH (node, offset_list)
{
- ofs = _vcd_list_node_data (node);
+ ofs = _cdio_list_node_data (node);
if (offset == ofs->offset)
{
@@ -232,9 +232,9 @@ vcdinf_visit_pbc (struct _vcdinf_pbc_ctx *obj, lid_t lid, unsigned int offset,
switch (ofs->type)
{
case PSD_TYPE_PLAY_LIST:
- _vcd_list_append (offset_list, ofs);
+ _cdio_list_append (offset_list, ofs);
{
- const PsdPlayListDescriptor *d = (const void *) (psd + _rofs);
+ const PsdPlayListDescriptor_t *d = (const void *) (psd + _rofs);
const lid_t lid = vcdinf_pld_get_lid(d);
if (!ofs->lid)
@@ -253,9 +253,9 @@ vcdinf_visit_pbc (struct _vcdinf_pbc_ctx *obj, lid_t lid, unsigned int offset,
case PSD_TYPE_EXT_SELECTION_LIST:
case PSD_TYPE_SELECTION_LIST:
- _vcd_list_append (offset_list, ofs);
+ _cdio_list_append (offset_list, ofs);
{
- const PsdSelectionListDescriptor *d =
+ const PsdSelectionListDescriptor_t *d =
(const void *) (psd + _rofs);
int idx;
@@ -283,7 +283,7 @@ vcdinf_visit_pbc (struct _vcdinf_pbc_ctx *obj, lid_t lid, unsigned int offset,
break;
case PSD_TYPE_END_LIST:
- _vcd_list_append (offset_list, ofs);
+ _cdio_list_append (offset_list, ofs);
break;
default:
@@ -299,7 +299,7 @@ vcdinf_visit_pbc (struct _vcdinf_pbc_ctx *obj, lid_t lid, unsigned int offset,
entry_num in obj. VCDINFO_NULL_LBA is returned if there is no entry.
*/
lba_t
-vcdinf_get_entry_lba(const EntriesVcd *entries, unsigned int entry_num)
+vcdinf_get_entry_lba(const EntriesVcd_t *entries, unsigned int entry_num)
{
const msf_t *msf = vcdinf_get_entry_msf(entries, entry_num);
return (msf != NULL) ? cdio_msf_to_lba(msf) : VCDINFO_NULL_LBA;
@@ -310,7 +310,7 @@ vcdinf_get_entry_lba(const EntriesVcd *entries, unsigned int entry_num)
The first entry number is 0.
*/
const msf_t *
-vcdinf_get_entry_msf(const EntriesVcd *entries, unsigned int entry_num)
+vcdinf_get_entry_msf(const EntriesVcd_t *entries, unsigned int entry_num)
{
const unsigned int entry_count = uint16_from_be (entries->entry_count);
return entry_num < entry_count ?
diff --git a/src/input/vcd/libvcd/info_private.h b/src/input/vcd/libvcd/info_private.h
index a0152abae..d17b6680b 100644
--- a/src/input/vcd/libvcd/info_private.h
+++ b/src/input/vcd/libvcd/info_private.h
@@ -31,6 +31,7 @@
#endif
#include <cdio/cdio.h>
+#include <cdio/ds.h>
#include <cdio/iso9660.h>
#include <libvcd/types.h>
#include <libvcd/files_private.h>
@@ -46,16 +47,16 @@ extern "C" {
iso9660_pvd_t pvd;
- InfoVcd info;
- EntriesVcd entries;
+ InfoVcd_t info;
+ EntriesVcd_t entries;
- VcdList *offset_list;
- VcdList *offset_x_list;
+ CdioList *offset_list;
+ CdioList *offset_x_list;
uint32_t *seg_sizes;
lsn_t first_segment_lsn;
- LotVcd *lot;
- LotVcd *lot_x;
+ LotVcd_t *lot;
+ LotVcd_t *lot_x;
uint8_t *psd;
uint8_t *psd_x;
unsigned int psd_x_size;
@@ -75,18 +76,18 @@ extern "C" {
entry_num in obj. NULL is returned if there is no entry.
The first entry number is 0.
*/
- const msf_t * vcdinf_get_entry_msf(const EntriesVcd *entries,
+ const msf_t * vcdinf_get_entry_msf(const EntriesVcd_t *entries,
unsigned int entry_num);
struct _vcdinf_pbc_ctx {
unsigned int psd_size;
lid_t maximum_lid;
unsigned offset_mult;
- VcdList *offset_x_list;
- VcdList *offset_list;
+ CdioList *offset_x_list;
+ CdioList *offset_list;
- LotVcd *lot;
- LotVcd *lot_x;
+ LotVcd_t *lot;
+ LotVcd_t *lot_x;
uint8_t *psd;
uint8_t *psd_x;
unsigned int psd_x_size;
diff --git a/src/input/vcd/libvcd/libvcd/inf.h b/src/input/vcd/libvcd/libvcd/inf.h
index 8da69264a..fcd9098e2 100644
--- a/src/input/vcd/libvcd/libvcd/inf.h
+++ b/src/input/vcd/libvcd/libvcd/inf.h
@@ -1,7 +1,7 @@
/*!
\file inf.h
- Copyright (C) 2002,2003 Rocky Bernstein <rocky@panix.com>
+ Copyright (C) 2002, 2003, 2004 Rocky Bernstein <rocky@panix.com>
\verbatim
This program is free software; you can redistribute it and/or modify
@@ -29,7 +29,6 @@
#ifndef _VCD_INF_H
#define _VCD_INF_H
-#include <cdio/iso9660.h>
#include <libvcd/info.h>
const char * vcdinf_area_str (const struct psd_area_t *_area);
@@ -37,31 +36,25 @@
/*!
Return a string containing the VCD album id.
*/
- const char * vcdinf_get_album_id(const InfoVcd *info);
-
- /*!
- Return the VCD application ID.
- NULL is returned if there is some problem in getting this.
- */
- const char * vcdinf_get_application_id(const iso9660_pvd_t *pvd);
+ const char * vcdinf_get_album_id(const InfoVcd_t *info);
/*!
Get autowait time value for PsdPlayListDescriptor *d.
Time is in seconds unless it is -1 (unlimited).
*/
- int vcdinf_get_autowait_time (const PsdPlayListDescriptor *d);
+ int vcdinf_get_autowait_time (const PsdPlayListDescriptor_t *d);
/*!
Return the base selection number. VCD_INVALID_BSN is returned if there
is an error.
*/
- unsigned int vcdinf_get_bsn(const PsdSelectionListDescriptor *psd);
+ unsigned int vcdinf_get_bsn(const PsdSelectionListDescriptor_t *psd);
/*! Return the starting LBA (logical block address) for sequence
entry_num in obj. VCDINFO_NULL_LBA is returned if there is no entry.
The first entry number is 0.
*/
- lba_t vcdinf_get_entry_lba(const EntriesVcd *entries,
+ lba_t vcdinf_get_entry_lba(const EntriesVcd_t *entries,
unsigned int entry_num);
const char * vcdinf_get_format_version_str (vcd_type_t vcd_type);
@@ -69,118 +62,85 @@
/*!
Return loop count. 0 is infinite loop.
*/
- uint16_t vcdinf_get_loop_count (const PsdSelectionListDescriptor *psd);
+ uint16_t vcdinf_get_loop_count (const PsdSelectionListDescriptor_t *psd);
/*!
Return LOT offset
*/
- uint16_t vcdinf_get_lot_offset (const LotVcd *lot, unsigned int n);
-
- /*!
- Return a string containing the VCD preparer id with trailing
- blanks removed.
- NULL is returned if there is some problem in getting this.
- */
- const char * vcdinf_get_preparer_id(const iso9660_pvd_t *pvd);
+ uint16_t vcdinf_get_lot_offset (const LotVcd_t *lot, unsigned int n);
/*!
Return number of bytes in PSD.
*/
- uint32_t vcdinf_get_psd_size (const InfoVcd *info);
+ uint32_t vcdinf_get_psd_size (const InfoVcd_t *info);
/*!
- Return a string containing the VCD publisher id with trailing
- blanks removed.
- NULL is returned if there is some problem in getting this.
- */
- const char * vcdinf_get_publisher_id(const iso9660_pvd_t *pvd);
-
- /*!
Return the number of segments in the VCD.
*/
- unsigned int vcdinf_get_num_entries(const EntriesVcd *entries);
+ unsigned int vcdinf_get_num_entries(const EntriesVcd_t *entries);
/*!
Return number of LIDs.
*/
- lid_t vcdinf_get_num_LIDs (const InfoVcd *info);
+ lid_t vcdinf_get_num_LIDs (const InfoVcd_t *info);
/*!
Return the number of segments in the VCD.
*/
- segnum_t vcdinf_get_num_segments(const InfoVcd *info);
+ segnum_t vcdinf_get_num_segments(const InfoVcd_t *info);
/*!
Return the number of menu selections for selection-list descriptor d.
*/
- unsigned int vcdinf_get_num_selections(const PsdSelectionListDescriptor *d);
+ unsigned int vcdinf_get_num_selections(const PsdSelectionListDescriptor_t *d);
/*!
Get play-time value for PsdPlayListDescriptor *d.
Time is in 1/15-second units.
*/
- uint16_t vcdinf_get_play_time (const PsdPlayListDescriptor *d);
-
- /*!
- Return a string containing the VCD system id with trailing
- blanks removed.
- NULL is returned if there is some problem in getting this.
- */
- const char * vcdinf_get_system_id(const iso9660_pvd_t *pvd);
+ uint16_t vcdinf_get_play_time (const PsdPlayListDescriptor_t *d);
/*!
Get timeout offset for PsdPlayListDescriptor *d. Return
VCDINFO_INVALID_OFFSET if d is NULL;
Time is in seconds unless it is -1 (unlimited).
*/
- uint16_t vcdinf_get_timeout_offset (const PsdSelectionListDescriptor *d);
+ uint16_t vcdinf_get_timeout_offset (const PsdSelectionListDescriptor_t *d);
/*!
Get timeout wait value for PsdPlayListDescriptor *d.
Time is in seconds unless it is -1 (unlimited).
*/
- int vcdinf_get_timeout_time (const PsdSelectionListDescriptor *d);
+ int vcdinf_get_timeout_time (const PsdSelectionListDescriptor_t *d);
/*!
Return the track number for entry n in obj. The first track starts
at 1.
*/
- track_t vcdinf_get_track(const EntriesVcd *entries,
+ track_t vcdinf_get_track(const EntriesVcd_t *entries,
const unsigned int entry_num);
/*!
Return the VCD volume num - the number of the CD in the collection.
This is a number between 1 and the volume count.
*/
- unsigned int vcdinf_get_volume_num(const InfoVcd *info);
+ unsigned int vcdinf_get_volume_num(const InfoVcd_t *info);
/*!
Return the VCD volume count - the number of CD's in the collection.
*/
- unsigned int vcdinf_get_volume_count(const InfoVcd *info);
-
- /*!
- Return the VCD ID.
- NULL is returned if there is some problem in getting this.
- */
- const char * vcdinf_get_volume_id(const iso9660_pvd_t *pvd);
-
- /*!
- Return the VCD volumeset ID.
- NULL is returned if there is some problem in getting this.
- */
- const char * vcdinf_get_volumeset_id(const iso9660_pvd_t *pvd);
+ unsigned int vcdinf_get_volume_count(const InfoVcd_t *info);
/*!
Get wait time value for PsdPlayListDescriptor *d.
Time is in seconds unless it is -1 (unlimited).
*/
- int vcdinf_get_wait_time (const PsdPlayListDescriptor *d);
+ int vcdinf_get_wait_time (const PsdPlayListDescriptor_t *d);
/*!
Return true if loop has a jump delay
*/
- bool vcdinf_has_jump_delay (const PsdSelectionListDescriptor *psd);
+ bool vcdinf_has_jump_delay (const PsdSelectionListDescriptor_t *psd);
/*!
Comparison routine used in sorting. We compare LIDs and if those are
@@ -197,18 +157,18 @@
\return VCDINFO_INVALID_OFFSET is returned on error or if pld has no
"next" entry or pld is NULL. Otherwise the LID offset is returned.
*/
- uint16_t vcdinf_pld_get_next_offset(const PsdPlayListDescriptor *pld);
+ uint16_t vcdinf_pld_get_next_offset(const PsdPlayListDescriptor_t *pld);
/*!
Get the LID from a given play-list descriptor.
VCDINFO_REJECTED_MASK is returned on error or pld is NULL.
*/
- uint16_t vcdinf_pld_get_lid(const PsdPlayListDescriptor *pld);
+ uint16_t vcdinf_pld_get_lid(const PsdPlayListDescriptor_t *pld);
/*!
Return the playlist item i in d.
*/
- uint16_t vcdinf_pld_get_play_item(const PsdPlayListDescriptor *pld,
+ uint16_t vcdinf_pld_get_play_item(const PsdPlayListDescriptor_t *pld,
unsigned int i);
/**
@@ -217,7 +177,7 @@
\return VCDINFO_INVALID_OFFSET is returned on error or if pld has no
"prev" entry or pld is NULL. Otherwise the LID offset is returned.
*/
- uint16_t vcdinf_pld_get_prev_offset(const PsdPlayListDescriptor *pld);
+ uint16_t vcdinf_pld_get_prev_offset(const PsdPlayListDescriptor_t *pld);
/**
\fn vcdinf_pld_get_return_offset(const PsdPlayListDescriptor *pld);
@@ -225,12 +185,12 @@
\return VCDINFO_INVALID_OFFSET is returned on error or if pld has no
"return" entry or pld is NULL. Otherwise the LID offset is returned.
*/
- uint16_t vcdinf_pld_get_return_offset(const PsdPlayListDescriptor *pld);
+ uint16_t vcdinf_pld_get_return_offset(const PsdPlayListDescriptor_t *pld);
/*!
Return number of items in LIDs. Return 0 if error or not found.
*/
- int vcdinf_pld_get_noi (const PsdPlayListDescriptor *pld);
+ int vcdinf_pld_get_noi (const PsdPlayListDescriptor_t *pld);
/**
* \fn vcdinfo_psd_get_default_offset(const PsdSelectionListDescriptor *psd);
@@ -238,26 +198,26 @@
* \return VCDINFO_INVALID_OFFSET is returned on error or if psd is
* NULL. Otherwise the LID offset is returned.
*/
- uint16_t vcdinf_psd_get_default_offset(const PsdSelectionListDescriptor *psd);
+ uint16_t vcdinf_psd_get_default_offset(const PsdSelectionListDescriptor_t *psd);
/*!
Get the item id for a given selection-list descriptor.
VCDINFO_REJECTED_MASK is returned on error or if psd is NULL.
*/
- uint16_t vcdinf_psd_get_itemid(const PsdSelectionListDescriptor *psd);
+ uint16_t vcdinf_psd_get_itemid(const PsdSelectionListDescriptor_t *psd);
/*!
Get the LID from a given selection-list descriptor.
VCDINFO_REJECTED_MASK is returned on error or psd is NULL.
*/
- uint16_t vcdinf_psd_get_lid(const PsdSelectionListDescriptor *psd);
+ uint16_t vcdinf_psd_get_lid(const PsdSelectionListDescriptor_t *psd);
/*!
Get the LID rejected status for a given selection-list descriptor.
true is also returned d is NULL.
*/
bool
- vcdinf_psd_get_lid_rejected(const PsdSelectionListDescriptor *psd);
+ vcdinf_psd_get_lid_rejected(const PsdSelectionListDescriptor_t *psd);
/**
\fn vcdinf_psd_get_next_offset(const PsdSelectionListDescriptor *psd);
@@ -265,7 +225,7 @@
\return VCDINFO_INVALID_OFFSET is returned on error or if psd has no
"next" entry or psd is NULL. Otherwise the LID offset is returned.
*/
- lid_t vcdinf_psd_get_next_offset(const PsdSelectionListDescriptor *psd);
+ lid_t vcdinf_psd_get_next_offset(const PsdSelectionListDescriptor_t *psd);
/*!
\brief Get offset entry_num for a given PSD selector descriptor.
@@ -274,7 +234,7 @@
\return VCDINFO_INVALID_OFFSET is returned if d on error or d is
NULL. Otherwise the LID offset is returned.
*/
- uint16_t vcdinf_psd_get_offset(const PsdSelectionListDescriptor *d,
+ uint16_t vcdinf_psd_get_offset(const PsdSelectionListDescriptor_t *d,
unsigned int entry_num);
/**
\fn vcdinf_psd_get_prev_offset(const PsdPlayListDescriptor *psd);
@@ -283,7 +243,7 @@
"prev"
entry or psd is NULL. Otherwise the LID offset is returned.
*/
- uint16_t vcdinf_psd_get_prev_offset(const PsdSelectionListDescriptor *psd);
+ uint16_t vcdinf_psd_get_prev_offset(const PsdSelectionListDescriptor_t *psd);
/**
* \fn vcdinf_psd_get_return_offset(const PsdSelectionListDescriptor *psd);
@@ -291,7 +251,7 @@
\return VCDINFO_INVALID_OFFSET is returned on error or if psd has no
"return" entry or psd is NULL. Otherwise the LID offset is returned.
*/
- uint16_t vcdinf_psd_get_return_offset(const PsdSelectionListDescriptor *psd);
+ uint16_t vcdinf_psd_get_return_offset(const PsdSelectionListDescriptor_t *psd);
#ifdef __cplusplus
}
diff --git a/src/input/vcd/libvcd/libvcd/info.h b/src/input/vcd/libvcd/libvcd/info.h
index e90253bc7..82aa78272 100644
--- a/src/input/vcd/libvcd/libvcd/info.h
+++ b/src/input/vcd/libvcd/libvcd/info.h
@@ -1,7 +1,7 @@
/*!
\file info.h
- Copyright (C) 2002,2003 Rocky Bernstein <rocky@panix.com>
+ Copyright (C) 2002, 2003, 2004 Rocky Bernstein <rocky@panix.com>
\verbatim
This program is free software; you can redistribute it and/or modify
@@ -29,9 +29,11 @@
#ifndef _VCD_INFO_H
#define _VCD_INFO_H
+#include <libvcd/version.h>
#include <libvcd/types.h>
#include <libvcd/files.h>
#include <cdio/cdio.h>
+#include <cdio/ds.h>
#ifdef __cplusplus
extern "C" {
@@ -41,12 +43,13 @@ extern "C" {
/*! \def Max # characters in an album id. */
#define MAX_ALBUM_LEN 16
-#define MAX_APPLICATION_ID 128
-#define MAX_PREPARER_ID 128
-#define MAX_PUBLISHER_ID 128
-#define MAX_SYSTEM_ID 32
-#define MAX_VOLUME_ID 32
-#define MAX_VOLUMESET_ID 128
+
+/*! \def Max # of selections allowed in a PBC selection list. */
+#define MAX_PBC_SELECTIONS 99
+
+#define MIN_ENCODED_TRACK_NUM 100
+#define MIN_ENCODED_SEGMENT_NUM 1000
+#define MAX_ENCODED_SEGMENT_NUM 2979
/*!
Invalid LBA, Note: VCD player uses the fact that this is a very high
@@ -189,11 +192,14 @@ extern "C" {
/* Only one of pld or psd is used below. Not all
C compiler accept the anonymous unions commented out below. */
/* union { */
- PsdPlayListDescriptor *pld;
- PsdSelectionListDescriptor *psd;
+ PsdPlayListDescriptor_t *pld;
+ PsdSelectionListDescriptor_t *psd;
/* }; */
- } PsdListDescriptor;
+ } PsdListDescriptor_t;
+
+ /* For backwards compatibility. Don't use PsdListDescriptor. */
+#define PsdListDescriptor PsdListDescriptor_t
/*!
Return the number of audio channels implied by "audio_type".
@@ -245,8 +251,8 @@ extern "C" {
Return the VCD application ID.
NULL is returned if there is some problem in getting this.
*/
- const char *
- vcdinfo_get_application_id(const vcdinfo_obj_t *obj);
+ char *
+ vcdinfo_get_application_id(vcdinfo_obj_t *obj);
/*!
Return a pointer to the cdio structure for the CD image opened or
@@ -324,9 +330,9 @@ extern "C" {
const char *
vcdinfo_get_format_version_str (const vcdinfo_obj_t *obj);
- EntriesVcd * vcdinfo_get_entriesVcd (vcdinfo_obj_t *obj);
+ EntriesVcd_t * vcdinfo_get_entriesVcd (vcdinfo_obj_t *obj);
- InfoVcd * vcdinfo_get_infoVcd (vcdinfo_obj_t *obj);
+ InfoVcd_t * vcdinfo_get_infoVcd (vcdinfo_obj_t *obj);
/*!
\brief Get default or multi-default LID.
@@ -345,7 +351,7 @@ extern "C" {
*/
lid_t
vcdinfo_get_multi_default_lid(const vcdinfo_obj_t *obj, lid_t lid,
- unsigned int selection);
+ lsn_t lsn);
/*!
\brief Get default or multi-default LID offset.
@@ -377,13 +383,13 @@ extern "C" {
/*!
Get the LOT pointer.
*/
- LotVcd *
+ LotVcd_t *
vcdinfo_get_lot(const vcdinfo_obj_t *obj);
/*!
Get the extended LOT pointer.
*/
- LotVcd *
+ LotVcd_t *
vcdinfo_get_lot_x(const vcdinfo_obj_t *obj);
/*!
@@ -426,12 +432,12 @@ extern "C" {
/*!
Get the VCD info list.
*/
- VcdList *vcdinfo_get_offset_list(const vcdinfo_obj_t *obj);
+ CdioList *vcdinfo_get_offset_list(const vcdinfo_obj_t *obj);
/*!
Get the VCD info extended offset list.
*/
- VcdList *vcdinfo_get_offset_x_list(const vcdinfo_obj_t *obj);
+ CdioList *vcdinfo_get_offset_x_list(const vcdinfo_obj_t *obj);
/*!
Get the VCD info offset multiplier.
@@ -726,9 +732,14 @@ extern "C" {
Get the PSD Selection List Descriptor for a given lid.
False is returned if not found.
*/
- bool vcdinfo_lid_get_pxd(const vcdinfo_obj_t *obj, PsdListDescriptor *pxd,
+ bool vcdinfo_lid_get_pxd(const vcdinfo_obj_t *obj, PsdListDescriptor_t *pxd,
uint16_t lid);
+ /*! Return the entry number closest and before the given LSN.
+ */
+ unsigned int
+ vcdinfo_lsn_get_entry(const vcdinfo_obj_t *obj, lsn_t lsn);
+
/*!
Convert minutes, seconds and frame (MSF components) into a
logical block address (or LBA).
@@ -789,6 +800,11 @@ extern "C" {
*/
const char * vcdinfo_strip_trail (const char str[], size_t n);
+ /*! Return the entry number for the given track.
+ */
+ unsigned int
+ vcdinfo_track_get_entry(const vcdinfo_obj_t *obj, track_t track);
+
/*!
Initialize the vcdinfo structure "obj". Should be done before other
routines using obj are called.
diff --git a/src/input/vcd/libvcd/libvcd/types.h b/src/input/vcd/libvcd/libvcd/types.h
index bde56e3c7..56a07d447 100644
--- a/src/input/vcd/libvcd/libvcd/types.h
+++ b/src/input/vcd/libvcd/libvcd/types.h
@@ -1,7 +1,7 @@
/*
- $Id: types.h,v 1.2 2004/04/11 12:20:32 miguelfreitas Exp $
+ $Id: types.h,v 1.3 2005/01/01 02:43:59 rockyb Exp $
- Copyright (C) 2000 Herbert Valerio Riedel <hvr@gnu.org>
+ Copyright (C) 2000, 2004 Herbert Valerio Riedel <hvr@gnu.org>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -34,13 +34,13 @@ extern "C" {
typedef struct _VcdListNode VcdListNode;
/* Defined fully in files_private.h */
- typedef struct _InfoVcd_tag InfoVcd;
- typedef struct _EntriesVcd_tag EntriesVcd;
- typedef struct _LotVcd_tag LotVcd;
-
- typedef struct _PsdPlayListDescriptor_tag PsdPlayListDescriptor;
- typedef struct _PsdSelectionListDescriptor_tag PsdSelectionListDescriptor;
+ typedef struct _InfoVcd_tag InfoVcd_t;
+ typedef struct _EntriesVcd_tag EntriesVcd_t;
+ typedef struct _LotVcd_tag LotVcd_t;
+ typedef struct _PsdPlayListDescriptor_tag PsdPlayListDescriptor_t;
+ typedef struct _PsdSelectionListDescriptor_tag PsdSelectionListDescriptor_t;
+
/* Overall data structure representing a VideoCD object.
Defined fully in info_private.h.
*/
diff --git a/src/input/vcd/libvcd/libvcd/version.h b/src/input/vcd/libvcd/libvcd/version.h
index 054519ece..d71374724 100644
--- a/src/input/vcd/libvcd/libvcd/version.h
+++ b/src/input/vcd/libvcd/libvcd/version.h
@@ -1 +1 @@
-#define LIBVCD_VERSION "0.7.20"
+#define LIBVCD_VERSION "0.7.20a"
diff --git a/src/input/vcd/libvcd/mpeg.h b/src/input/vcd/libvcd/mpeg.h
index d57c1a36e..2d28d2aef 100644
--- a/src/input/vcd/libvcd/mpeg.h
+++ b/src/input/vcd/libvcd/mpeg.h
@@ -1,5 +1,5 @@
/*
- $Id: mpeg.h,v 1.2 2004/04/11 12:20:32 miguelfreitas Exp $
+ $Id: mpeg.h,v 1.3 2005/01/01 02:43:59 rockyb Exp $
Copyright (C) 2000 Herbert Valerio Riedel <hvr@gnu.org>
@@ -103,7 +103,7 @@ typedef struct {
unsigned vbvsize;
bool constrained_flag;
- VcdList *aps_list; /* filled up by vcd_mpeg_source */
+ CdioList *aps_list; /* filled up by vcd_mpeg_source */
double last_aps_pts; /* temp, see ->packet */
} shdr[3];
diff --git a/src/input/vcd/libvcd/mpeg_stream.c b/src/input/vcd/libvcd/mpeg_stream.c
index 4fcc1fa8b..e5466766a 100644
--- a/src/input/vcd/libvcd/mpeg_stream.c
+++ b/src/input/vcd/libvcd/mpeg_stream.c
@@ -1,7 +1,7 @@
/*
- $Id: mpeg_stream.c,v 1.2 2004/04/11 12:20:32 miguelfreitas Exp $
+ $Id: mpeg_stream.c,v 1.3 2005/01/01 02:43:59 rockyb Exp $
- Copyright (C) 2000 Herbert Valerio Riedel <hvr@gnu.org>
+ Copyright (C) 2000, 2004 Herbert Valerio Riedel <hvr@gnu.org>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -27,18 +27,18 @@
#include <stdlib.h>
#include <cdio/cdio.h>
+#include <cdio/bytesex.h>
#include <libvcd/logging.h>
/* Private headers */
#include "vcd_assert.h"
#include "mpeg_stream.h"
-#include "bytesex.h"
#include "data_structures.h"
#include "mpeg.h"
#include "util.h"
-static const char _rcsid[] = "$Id: mpeg_stream.c,v 1.2 2004/04/11 12:20:32 miguelfreitas Exp $";
+static const char _rcsid[] = "$Id: mpeg_stream.c,v 1.3 2005/01/01 02:43:59 rockyb Exp $";
struct _VcdMpegSource
{
@@ -83,7 +83,7 @@ vcd_mpeg_source_destroy (VcdMpegSource *obj, bool destroy_file_obj)
for (i = 0; i < 3; i++)
if (obj->info.shdr[i].aps_list)
- _vcd_list_free (obj->info.shdr[i].aps_list, true);
+ _cdio_list_free (obj->info.shdr[i].aps_list, true);
free (obj);
}
@@ -117,7 +117,7 @@ vcd_mpeg_source_scan (VcdMpegSource *obj, bool strict_aps, bool fix_scan_info,
unsigned padbytes = 0;
unsigned padpackets = 0;
VcdMpegStreamCtx state;
- VcdListNode *n;
+ CdioListNode *n;
vcd_mpeg_prog_info_t _progress = { 0, };
vcd_assert (obj != NULL);
@@ -194,9 +194,9 @@ vcd_mpeg_source_scan (VcdMpegSource *obj, bool strict_aps, bool fix_scan_info,
_data->timestamp = state.packet.aps_pts;
if (!state.stream.shdr[state.packet.aps_idx].aps_list)
- state.stream.shdr[state.packet.aps_idx].aps_list = _vcd_list_new ();
+ state.stream.shdr[state.packet.aps_idx].aps_list = _cdio_list_new ();
- _vcd_list_append (state.stream.shdr[state.packet.aps_idx].aps_list, _data);
+ _cdio_list_append (state.stream.shdr[state.packet.aps_idx].aps_list, _data);
}
break;
@@ -251,9 +251,9 @@ vcd_mpeg_source_scan (VcdMpegSource *obj, bool strict_aps, bool fix_scan_info,
for (i = 0; i < 3; i++)
if (obj->info.shdr[i].aps_list)
- _VCD_LIST_FOREACH (n, obj->info.shdr[i].aps_list)
+ _CDIO_LIST_FOREACH (n, obj->info.shdr[i].aps_list)
{
- struct aps_data *_data = _vcd_list_node_data (n);
+ struct aps_data *_data = _cdio_list_node_data (n);
_data->timestamp -= obj->info.min_pts;
}
@@ -268,18 +268,18 @@ vcd_mpeg_source_scan (VcdMpegSource *obj, bool strict_aps, bool fix_scan_info,
}
static double
-_approx_pts (VcdList *aps_list, uint32_t packet_no)
+_approx_pts (CdioList *aps_list, uint32_t packet_no)
{
double retval = 0;
- VcdListNode *node;
+ CdioListNode *node;
struct aps_data *_laps = NULL;
double last_pts_ratio = 0;
- _VCD_LIST_FOREACH (node, aps_list)
+ _CDIO_LIST_FOREACH (node, aps_list)
{
- struct aps_data *_aps = _vcd_list_node_data (node);
+ struct aps_data *_aps = _cdio_list_node_data (node);
if (_laps)
{
@@ -322,14 +322,14 @@ _set_scan_msf (msf_t *_msf, long lsn)
static void
_fix_scan_info (struct vcd_mpeg_scan_data_t *scan_data_ptr,
- unsigned packet_no, double pts, VcdList *aps_list)
+ unsigned packet_no, double pts, CdioList *aps_list)
{
- VcdListNode *node;
+ CdioListNode *node;
long _next = -1, _prev = -1, _forw = -1, _back = -1;
- _VCD_LIST_FOREACH (node, aps_list)
+ _CDIO_LIST_FOREACH (node, aps_list)
{
- struct aps_data *_aps = _vcd_list_node_data (node);
+ struct aps_data *_aps = _cdio_list_node_data (node);
if (_aps->packet_no == packet_no)
continue;
diff --git a/src/input/vcd/libvcd/obj.h b/src/input/vcd/libvcd/obj.h
index 55ed51462..d6849a3ab 100644
--- a/src/input/vcd/libvcd/obj.h
+++ b/src/input/vcd/libvcd/obj.h
@@ -1,5 +1,5 @@
/*
- $Id: obj.h,v 1.2 2004/04/11 12:20:32 miguelfreitas Exp $
+ $Id: obj.h,v 1.3 2005/01/01 02:43:59 rockyb Exp $
Copyright (C) 2000 Herbert Valerio Riedel <hvr@gnu.org>
@@ -48,10 +48,10 @@ typedef struct {
char *id;
const struct vcd_mpeg_stream_info *info;
- VcdList *pause_list; /* pause_t */
+ CdioList *pause_list; /* pause_t */
char *default_entry_id;
- VcdList *entry_list; /* entry_t */
+ CdioList *entry_list; /* entry_t */
/* pbc ref check */
bool referenced;
@@ -69,7 +69,7 @@ typedef struct {
char *id;
const struct vcd_mpeg_stream_info *info;
- VcdList *pause_list; /* pause_t */
+ CdioList *pause_list; /* pause_t */
/* pbc ref check */
bool referenced;
@@ -128,25 +128,25 @@ struct _VcdObj {
/* input */
unsigned mpeg_segment_start_extent;
- VcdList *mpeg_segment_list; /* mpeg_segment_t */
+ CdioList *mpeg_segment_list; /* mpeg_segment_t */
- VcdList *mpeg_sequence_list; /* mpeg_sequence_t */
+ CdioList *mpeg_sequence_list; /* mpeg_sequence_t */
unsigned relative_end_extent; /* last mpeg sequence track end extent */
/* PBC */
- VcdList *pbc_list; /* pbc_t */
+ CdioList *pbc_list; /* pbc_t */
unsigned psd_size;
unsigned psdx_size;
/* custom files */
unsigned ext_file_start_extent;
unsigned custom_file_start_extent;
- VcdList *custom_file_list; /* custom_file_t */
- VcdList *custom_dir_list; /* char */
+ CdioList *custom_file_list; /* custom_file_t */
+ CdioList *custom_dir_list; /* char */
/* dictionary */
- VcdList *buffer_dict_list;
+ CdioList *buffer_dict_list;
/* aggregates */
VcdSalloc *iso_bitmap;
diff --git a/src/input/vcd/libvcd/pbc.c b/src/input/vcd/libvcd/pbc.c
index b9172b41b..1b4f1a6c1 100644
--- a/src/input/vcd/libvcd/pbc.c
+++ b/src/input/vcd/libvcd/pbc.c
@@ -1,7 +1,7 @@
/*
- $Id: pbc.c,v 1.2 2004/04/11 12:20:32 miguelfreitas Exp $
+ $Id: pbc.c,v 1.3 2005/01/01 02:43:59 rockyb Exp $
- Copyright (C) 2000 Herbert Valerio Riedel <hvr@gnu.org>
+ Copyright (C) 2000, 2004 Herbert Valerio Riedel <hvr@gnu.org>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -27,23 +27,24 @@
#include <math.h>
#include <cdio/cdio.h>
+#include <cdio/bytesex.h>
/* Public headers */
#include <libvcd/logging.h>
#include <libvcd/files.h>
#include <libvcd/types.h>
+#include <libvcd/info.h>
/* FIXME! Make this really private. */
#include <libvcd/files_private.h>
/* Private headers */
#include "vcd_assert.h"
-#include "bytesex.h"
#include "obj.h"
#include "pbc.h"
#include "util.h"
-static const char _rcsid[] = "$Id: pbc.c,v 1.2 2004/04/11 12:20:32 miguelfreitas Exp $";
+static const char _rcsid[] = "$Id: pbc.c,v 1.3 2005/01/01 02:43:59 rockyb Exp $";
static uint8_t
_wtime (int seconds)
@@ -74,11 +75,11 @@ _wtime (int seconds)
static pbc_t *
_vcd_pbc_byid(const VcdObj *obj, const char item_id[])
{
- VcdListNode *node;
+ CdioListNode *node;
- _VCD_LIST_FOREACH (node, obj->pbc_list)
+ _CDIO_LIST_FOREACH (node, obj->pbc_list)
{
- pbc_t *_pbc = _vcd_list_node_data (node);
+ pbc_t *_pbc = _cdio_list_node_data (node);
if (_pbc->id && !strcmp (item_id, _pbc->id))
return _pbc;
@@ -91,12 +92,12 @@ _vcd_pbc_byid(const VcdObj *obj, const char item_id[])
unsigned
_vcd_pbc_lid_lookup (const VcdObj *obj, const char item_id[])
{
- VcdListNode *node;
+ CdioListNode *node;
unsigned n = 1;
- _VCD_LIST_FOREACH (node, obj->pbc_list)
+ _CDIO_LIST_FOREACH (node, obj->pbc_list)
{
- pbc_t *_pbc = _vcd_list_node_data (node);
+ pbc_t *_pbc = _cdio_list_node_data (node);
vcd_assert (n < 0x8000);
@@ -143,11 +144,11 @@ _vcd_pbc_lookup (const VcdObj *obj, const char item_id[])
{
if (id < 2)
return ITEM_TYPE_NOTFOUND;
- else if (id < 100)
+ else if (id < MIN_ENCODED_TRACK_NUM)
return ITEM_TYPE_TRACK;
else if (id < 600)
return ITEM_TYPE_ENTRY;
- else if (id < 2980)
+ else if (id <= MAX_ENCODED_SEGMENT_NUM)
return ITEM_TYPE_SEGMENT;
else
vcd_assert_not_reached ();
@@ -162,7 +163,7 @@ uint16_t
_vcd_pbc_pin_lookup (const VcdObj *obj, const char item_id[])
{
int n;
- VcdListNode *node;
+ CdioListNode *node;
if (!item_id)
return 0;
@@ -170,9 +171,9 @@ _vcd_pbc_pin_lookup (const VcdObj *obj, const char item_id[])
/* check sequence items */
n = 0;
- _VCD_LIST_FOREACH (node, obj->mpeg_sequence_list)
+ _CDIO_LIST_FOREACH (node, obj->mpeg_sequence_list)
{
- mpeg_sequence_t *_sequence = _vcd_list_node_data (node);
+ mpeg_sequence_t *_sequence = _cdio_list_node_data (node);
vcd_assert (n < 98);
@@ -185,10 +186,10 @@ _vcd_pbc_pin_lookup (const VcdObj *obj, const char item_id[])
/* check entry points */
n = 0;
- _VCD_LIST_FOREACH (node, obj->mpeg_sequence_list)
+ _CDIO_LIST_FOREACH (node, obj->mpeg_sequence_list)
{
- mpeg_sequence_t *_sequence = _vcd_list_node_data (node);
- VcdListNode *node2;
+ mpeg_sequence_t *_sequence = _cdio_list_node_data (node);
+ CdioListNode *node2;
/* default entry point */
@@ -199,9 +200,9 @@ _vcd_pbc_pin_lookup (const VcdObj *obj, const char item_id[])
/* additional entry points */
- _VCD_LIST_FOREACH (node2, _sequence->entry_list)
+ _CDIO_LIST_FOREACH (node2, _sequence->entry_list)
{
- entry_t *_entry = _vcd_list_node_data (node2);
+ entry_t *_entry = _cdio_list_node_data (node2);
vcd_assert (n < 500);
@@ -215,14 +216,14 @@ _vcd_pbc_pin_lookup (const VcdObj *obj, const char item_id[])
/* check sequence items */
n = 0;
- _VCD_LIST_FOREACH (node, obj->mpeg_segment_list)
+ _CDIO_LIST_FOREACH (node, obj->mpeg_segment_list)
{
- mpeg_segment_t *_segment = _vcd_list_node_data (node);
+ mpeg_segment_t *_segment = _cdio_list_node_data (node);
vcd_assert (n < 1980);
if (_segment->id && !strcmp (item_id, _segment->id))
- return n + 1000;
+ return n + MIN_ENCODED_SEGMENT_NUM;
n += _segment->segment_count;
}
@@ -236,7 +237,7 @@ _vcd_pbc_available (const VcdObj *obj)
vcd_assert (obj != NULL);
vcd_assert (obj->pbc_list != NULL);
- if (!_vcd_list_length (obj->pbc_list))
+ if (!_cdio_list_length (obj->pbc_list))
return false;
if (!_vcd_obj_has_cap_p (obj, _CAP_PBC))
@@ -254,7 +255,7 @@ _vcd_pbc_max_lid (const VcdObj *obj)
uint16_t retval = 0;
if (_vcd_pbc_available (obj))
- retval = _vcd_list_length (obj->pbc_list);
+ retval = _cdio_list_length (obj->pbc_list);
return retval;
}
@@ -272,14 +273,14 @@ _vcd_pbc_node_length (const VcdObj *obj, const pbc_t *_pbc, bool extended)
int n;
case PBC_PLAYLIST:
- n = _vcd_list_length (_pbc->item_id_list);
+ n = _cdio_list_length (_pbc->item_id_list);
retval = __cd_offsetof (_PsdPlayListDescriptor, itemid[n]);
break;
case PBC_SELECTION:
- n = _vcd_list_length (_pbc->select_id_list);
+ n = _cdio_list_length (_pbc->select_id_list);
- retval = __cd_offsetof (PsdSelectionListDescriptor, ofs[n]);
+ retval = __cd_offsetof (PsdSelectionListDescriptor_t, ofs[n]);
if (extended || _vcd_obj_has_cap_p (obj, _CAP_4C_SVCD))
retval += __cd_offsetof (PsdSelectionListDescriptorExtended, area[n]);
@@ -300,7 +301,7 @@ _vcd_pbc_node_length (const VcdObj *obj, const pbc_t *_pbc, bool extended)
static uint16_t
_lookup_psd_offset (const VcdObj *obj, const char item_id[], bool extended)
{
- VcdListNode *node;
+ CdioListNode *node;
if (extended)
vcd_assert (_vcd_obj_has_cap_p (obj, _CAP_PBC_X));
@@ -309,9 +310,9 @@ _lookup_psd_offset (const VcdObj *obj, const char item_id[], bool extended)
if (!item_id)
return PSD_OFS_DISABLED;
- _VCD_LIST_FOREACH (node, obj->pbc_list)
+ _CDIO_LIST_FOREACH (node, obj->pbc_list)
{
- pbc_t *_pbc = _vcd_list_node_data (node);
+ pbc_t *_pbc = _cdio_list_node_data (node);
if (!_pbc->id || strcmp (item_id, _pbc->id))
continue;
@@ -367,15 +368,15 @@ _vcd_pbc_mark_id (const VcdObj *obj, const char _id[])
{
case PBC_PLAYLIST:
{
- VcdListNode *node;
+ CdioListNode *node;
_vcd_pbc_mark_id (obj, _pbc->prev_id);
_vcd_pbc_mark_id (obj, _pbc->next_id);
_vcd_pbc_mark_id (obj, _pbc->retn_id);
- _VCD_LIST_FOREACH (node, _pbc->item_id_list)
+ _CDIO_LIST_FOREACH (node, _pbc->item_id_list)
{
- const char *_id = _vcd_list_node_data (node);
+ const char *_id = _cdio_list_node_data (node);
_vcd_pin_mark_id (obj, _id);
}
@@ -384,7 +385,7 @@ _vcd_pbc_mark_id (const VcdObj *obj, const char _id[])
case PBC_SELECTION:
{
- VcdListNode *node;
+ CdioListNode *node;
_vcd_pbc_mark_id (obj, _pbc->prev_id);
_vcd_pbc_mark_id (obj, _pbc->next_id);
@@ -397,9 +398,9 @@ _vcd_pbc_mark_id (const VcdObj *obj, const char _id[])
_vcd_pin_mark_id (obj, _pbc->item_id);
- _VCD_LIST_FOREACH (node, _pbc->select_id_list)
+ _CDIO_LIST_FOREACH (node, _pbc->select_id_list)
{
- const char *_id = _vcd_list_node_data (node);
+ const char *_id = _cdio_list_node_data (node);
_vcd_pbc_mark_id (obj, _id);
}
@@ -419,36 +420,36 @@ _vcd_pbc_mark_id (const VcdObj *obj, const char _id[])
void
_vcd_pbc_check_unreferenced (const VcdObj *obj)
{
- VcdListNode *node;
+ CdioListNode *node;
/* clear all flags */
- _VCD_LIST_FOREACH (node, obj->pbc_list)
+ _CDIO_LIST_FOREACH (node, obj->pbc_list)
{
- pbc_t *_pbc = _vcd_list_node_data (node);
+ pbc_t *_pbc = _cdio_list_node_data (node);
_pbc->referenced = false;
}
- _VCD_LIST_FOREACH (node, obj->mpeg_sequence_list)
+ _CDIO_LIST_FOREACH (node, obj->mpeg_sequence_list)
{
- mpeg_sequence_t *_sequence = _vcd_list_node_data (node);
+ mpeg_sequence_t *_sequence = _cdio_list_node_data (node);
_sequence->referenced = false;
}
- _VCD_LIST_FOREACH (node, obj->mpeg_segment_list)
+ _CDIO_LIST_FOREACH (node, obj->mpeg_segment_list)
{
- mpeg_segment_t *_segment = _vcd_list_node_data (node);
+ mpeg_segment_t *_segment = _cdio_list_node_data (node);
_segment->referenced = false;
}
/* start from non-rejected lists */
- _VCD_LIST_FOREACH (node, obj->pbc_list)
+ _CDIO_LIST_FOREACH (node, obj->pbc_list)
{
- pbc_t *_pbc = _vcd_list_node_data (node);
+ pbc_t *_pbc = _cdio_list_node_data (node);
vcd_assert (_pbc->id != NULL);
@@ -460,25 +461,25 @@ _vcd_pbc_check_unreferenced (const VcdObj *obj)
/* collect flags */
- _VCD_LIST_FOREACH (node, obj->pbc_list)
+ _CDIO_LIST_FOREACH (node, obj->pbc_list)
{
- pbc_t *_pbc = _vcd_list_node_data (node);
+ pbc_t *_pbc = _cdio_list_node_data (node);
if (!_pbc->referenced)
vcd_warn ("PSD item '%s' is unreachable", _pbc->id);
}
- _VCD_LIST_FOREACH (node, obj->mpeg_sequence_list)
+ _CDIO_LIST_FOREACH (node, obj->mpeg_sequence_list)
{
- mpeg_sequence_t *_sequence = _vcd_list_node_data (node);
+ mpeg_sequence_t *_sequence = _cdio_list_node_data (node);
if (!_sequence->referenced)
vcd_warn ("sequence '%s' is not reachable by PBC", _sequence->id);
}
- _VCD_LIST_FOREACH (node, obj->mpeg_segment_list)
+ _CDIO_LIST_FOREACH (node, obj->mpeg_segment_list)
{
- mpeg_segment_t *_segment = _vcd_list_node_data (node);
+ mpeg_segment_t *_segment = _cdio_list_node_data (node);
if (!_segment->referenced)
vcd_warn ("segment item '%s' is unreachable", _segment->id);
@@ -502,11 +503,11 @@ _vcd_pbc_node_write (const VcdObj *obj, const pbc_t *_pbc, void *buf,
case PBC_PLAYLIST:
{
_PsdPlayListDescriptor *_md = buf;
- VcdListNode *node;
+ CdioListNode *node;
int n;
_md->type = PSD_TYPE_PLAY_LIST;
- _md->noi = _vcd_list_length (_pbc->item_id_list);
+ _md->noi = _cdio_list_length (_pbc->item_id_list);
vcd_assert (_pbc->lid < 0x8000);
_md->lid = uint16_to_be (_pbc->lid | (_pbc->rejected ? 0x8000 : 0));
@@ -522,9 +523,9 @@ _vcd_pbc_node_write (const VcdObj *obj, const pbc_t *_pbc, void *buf,
_md->atime = _wtime (_pbc->auto_pause_time);
n = 0;
- _VCD_LIST_FOREACH (node, _pbc->item_id_list)
+ _CDIO_LIST_FOREACH (node, _pbc->item_id_list)
{
- const char *_id = _vcd_list_node_data (node);
+ const char *_id = _cdio_list_node_data (node);
uint16_t _pin;
if (_id)
@@ -546,22 +547,22 @@ _vcd_pbc_node_write (const VcdObj *obj, const pbc_t *_pbc, void *buf,
case PBC_SELECTION:
{
- PsdSelectionListDescriptor *_md = buf;
+ PsdSelectionListDescriptor_t *_md = buf;
- const unsigned _nos = _vcd_list_length (_pbc->select_id_list);
+ const unsigned int _nos = _cdio_list_length (_pbc->select_id_list);
if (extended)
_md->type = PSD_TYPE_EXT_SELECTION_LIST;
else
_md->type = PSD_TYPE_SELECTION_LIST;
- if (!IN (_pbc->bsn, 1, 99))
- vcd_error ("selection '%s': BSN (%d) not in range [1..99]",
- _pbc->id, _pbc->bsn);
+ if (!IN (_pbc->bsn, 1, MAX_PBC_SELECTIONS))
+ vcd_error ("selection '%s': BSN (%d) not in range [1..%d]",
+ _pbc->id, _pbc->bsn, MAX_PBC_SELECTIONS);
- if (!IN (_nos, 0, 99))
- vcd_error ("selection '%s': too many selections (%d > 99)",
- _pbc->id, _nos);
+ if (!IN (_nos, 0, MAX_PBC_SELECTIONS))
+ vcd_error ("selection '%s': too many selections (%d > %d)",
+ _pbc->id, _nos, MAX_PBC_SELECTIONS);
if (_nos + _pbc->bsn > 100)
vcd_error ("selection '%s': BSN + NOS (%d + %d) > 100",
@@ -676,7 +677,8 @@ _vcd_pbc_node_write (const VcdObj *obj, const pbc_t *_pbc, void *buf,
if ((_seq = _vcd_obj_get_sequence_by_id ((VcdObj *) obj, _pbc->item_id))
|| (_seq = _vcd_obj_get_sequence_by_entry_id ((VcdObj *) obj, _pbc->item_id)))
{
- const unsigned _entries = _vcd_list_length (_seq->entry_list) + 1;
+ const unsigned _entries =
+ _cdio_list_length (_seq->entry_list) + 1;
if (_nos != _entries)
vcd_error ("selection '%s': number of entrypoints"
@@ -699,13 +701,13 @@ _vcd_pbc_node_write (const VcdObj *obj, const pbc_t *_pbc, void *buf,
/* fill selection array */
{
- VcdListNode *node = NULL;
+ CdioListNode *node = NULL;
int idx = 0;
idx = 0;
- _VCD_LIST_FOREACH (node, _pbc->select_id_list)
+ _CDIO_LIST_FOREACH (node, _pbc->select_id_list)
{
- const char *_id = _vcd_list_node_data (node);
+ const char *_id = _cdio_list_node_data (node);
_md->ofs[idx] =
uint16_to_be (_lookup_psd_offset (obj, _id, extended));
@@ -717,7 +719,7 @@ _vcd_pbc_node_write (const VcdObj *obj, const pbc_t *_pbc, void *buf,
if (extended || _vcd_obj_has_cap_p (obj, _CAP_4C_SVCD))
{
PsdSelectionListDescriptorExtended *_md2;
- VcdListNode *node;
+ CdioListNode *node;
int n;
/* append extended selection areas */
@@ -732,9 +734,9 @@ _vcd_pbc_node_write (const VcdObj *obj, const pbc_t *_pbc, void *buf,
n = 0;
if (_pbc->select_area_list)
- _VCD_LIST_FOREACH (node, _pbc->select_area_list)
+ _CDIO_LIST_FOREACH (node, _pbc->select_area_list)
{
- const pbc_area_t *_area = _vcd_list_node_data (node);
+ const pbc_area_t *_area = _cdio_list_node_data (node);
_set_area_helper (&_md2->area[n], _area, _pbc->id);
@@ -809,12 +811,12 @@ vcd_pbc_new (enum pbc_type_t type)
switch (type)
{
case PBC_PLAYLIST:
- _pbc->item_id_list = _vcd_list_new ();
+ _pbc->item_id_list = _cdio_list_new ();
break;
case PBC_SELECTION:
- _pbc->select_id_list = _vcd_list_new ();
- _pbc->select_area_list = _vcd_list_new ();
+ _pbc->select_id_list = _cdio_list_new ();
+ _pbc->select_area_list = _cdio_list_new ();
break;
case PBC_END:
@@ -834,14 +836,14 @@ vcd_pbc_new (enum pbc_type_t type)
bool
_vcd_pbc_finalize (VcdObj *obj)
{
- VcdListNode *node;
+ CdioListNode *node;
unsigned offset = 0, offset_ext = 0;
unsigned lid;
lid = 1;
- _VCD_LIST_FOREACH (node, obj->pbc_list)
+ _CDIO_LIST_FOREACH (node, obj->pbc_list)
{
- pbc_t *_pbc = _vcd_list_node_data (node);
+ pbc_t *_pbc = _cdio_list_node_data (node);
unsigned length, length_ext = 0;
length = _vcd_pbc_node_length (obj, _pbc, false);
diff --git a/src/input/vcd/libvcd/pbc.h b/src/input/vcd/libvcd/pbc.h
index c58ea2091..9972c3143 100644
--- a/src/input/vcd/libvcd/pbc.h
+++ b/src/input/vcd/libvcd/pbc.h
@@ -1,5 +1,5 @@
/*
- $Id: pbc.h,v 1.2 2004/04/11 12:20:32 miguelfreitas Exp $
+ $Id: pbc.h,v 1.3 2005/01/01 02:43:59 rockyb Exp $
Copyright (C) 2000 Herbert Valerio Riedel <hvr@gnu.org>
@@ -72,7 +72,7 @@ struct _pbc_t {
double playing_time;
int wait_time;
int auto_pause_time;
- VcdList *item_id_list; /* char */
+ CdioList *item_id_list; /* char */
/* used for selection lists */
enum selection_type_t {
@@ -85,7 +85,7 @@ struct _pbc_t {
pbc_area_t *next_area;
pbc_area_t *return_area;
pbc_area_t *default_area; /* depends on selection_type */
- VcdList *select_area_list; /* pbc_area_t */
+ CdioList *select_area_list; /* pbc_area_t */
unsigned bsn;
char *default_id;
@@ -94,7 +94,7 @@ struct _pbc_t {
unsigned loop_count;
bool jump_delayed;
char *item_id;
- VcdList *select_id_list; /* char */
+ CdioList *select_id_list; /* char */
/* used for end lists */
char *image_id;
diff --git a/src/input/vcd/libvcd/vcd.c b/src/input/vcd/libvcd/vcd.c
index baca9da91..e9618a7d7 100644
--- a/src/input/vcd/libvcd/vcd.c
+++ b/src/input/vcd/libvcd/vcd.c
@@ -1,7 +1,7 @@
/*
- $Id: vcd.c,v 1.2 2004/04/11 12:20:32 miguelfreitas Exp $
+ $Id: vcd.c,v 1.3 2005/01/01 02:43:59 rockyb Exp $
- Copyright (C) 2000 Herbert Valerio Riedel <hvr@gnu.org>
+ Copyright (C) 2000, 2004 Herbert Valerio Riedel <hvr@gnu.org>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -49,7 +49,7 @@
#include "util.h"
#include "vcd.h"
-static const char _rcsid[] = "$Id: vcd.c,v 1.2 2004/04/11 12:20:32 miguelfreitas Exp $";
+static const char _rcsid[] = "$Id: vcd.c,v 1.3 2005/01/01 02:43:59 rockyb Exp $";
static const char zero[CDIO_CD_FRAMESIZE_RAW] = { 0, };
@@ -61,14 +61,14 @@ static const char zero[CDIO_CD_FRAMESIZE_RAW] = { 0, };
mpeg_sequence_t *
_vcd_obj_get_sequence_by_id (VcdObj *obj, const char sequence_id[])
{
- VcdListNode *node;
+ CdioListNode *node;
vcd_assert (sequence_id != NULL);
vcd_assert (obj != NULL);
- _VCD_LIST_FOREACH (node, obj->mpeg_sequence_list)
+ _CDIO_LIST_FOREACH (node, obj->mpeg_sequence_list)
{
- mpeg_sequence_t *_sequence = _vcd_list_node_data (node);
+ mpeg_sequence_t *_sequence = _cdio_list_node_data (node);
if (_sequence->id && !strcmp (sequence_id, _sequence->id))
return _sequence;
@@ -80,15 +80,15 @@ _vcd_obj_get_sequence_by_id (VcdObj *obj, const char sequence_id[])
mpeg_sequence_t *
_vcd_obj_get_sequence_by_entry_id (VcdObj *obj, const char entry_id[])
{
- VcdListNode *node;
+ CdioListNode *node;
vcd_assert (entry_id != NULL);
vcd_assert (obj != NULL);
- _VCD_LIST_FOREACH (node, obj->mpeg_sequence_list)
+ _CDIO_LIST_FOREACH (node, obj->mpeg_sequence_list)
{
- mpeg_sequence_t *_sequence = _vcd_list_node_data (node);
- VcdListNode *node2;
+ mpeg_sequence_t *_sequence = _cdio_list_node_data (node);
+ CdioListNode *node2;
/* default entry point */
if (_sequence->default_entry_id
@@ -96,9 +96,9 @@ _vcd_obj_get_sequence_by_entry_id (VcdObj *obj, const char entry_id[])
return _sequence;
/* additional entry points */
- _VCD_LIST_FOREACH (node2, _sequence->entry_list)
+ _CDIO_LIST_FOREACH (node2, _sequence->entry_list)
{
- entry_t *_entry = _vcd_list_node_data (node2);
+ entry_t *_entry = _cdio_list_node_data (node2);
if (_entry->id
&& !strcmp (entry_id, _entry->id))
@@ -114,14 +114,14 @@ _vcd_obj_get_sequence_by_entry_id (VcdObj *obj, const char entry_id[])
mpeg_segment_t *
_vcd_obj_get_segment_by_id (VcdObj *obj, const char segment_id[])
{
- VcdListNode *node;
+ CdioListNode *node;
vcd_assert (segment_id != NULL);
vcd_assert (obj != NULL);
- _VCD_LIST_FOREACH (node, obj->mpeg_segment_list)
+ _CDIO_LIST_FOREACH (node, obj->mpeg_segment_list)
{
- mpeg_segment_t *_segment = _vcd_list_node_data (node);
+ mpeg_segment_t *_segment = _cdio_list_node_data (node);
if (_segment->id && !strcmp (segment_id, _segment->id))
return _segment;
@@ -283,15 +283,15 @@ vcd_obj_new (vcd_type_t vcd_type)
new_obj->info_volume_count = 1;
new_obj->info_volume_number = 1;
- new_obj->custom_file_list = _vcd_list_new ();
- new_obj->custom_dir_list = _vcd_list_new ();
+ new_obj->custom_file_list = _cdio_list_new ();
+ new_obj->custom_dir_list = _cdio_list_new ();
- new_obj->mpeg_sequence_list = _vcd_list_new ();
+ new_obj->mpeg_sequence_list = _cdio_list_new ();
- new_obj->mpeg_segment_list = _vcd_list_new ();
+ new_obj->mpeg_segment_list = _cdio_list_new ();
- new_obj->pbc_list = _vcd_list_new ();
+ new_obj->pbc_list = _cdio_list_new ();
/* gap's defined by IEC-10149 / ECMA-130 */
@@ -327,7 +327,7 @@ _vcd_obj_remove_mpeg_track (VcdObj *obj, int track_id)
{
int length;
mpeg_sequence_t *track = NULL;
- VcdListNode *node = NULL;
+ CdioListNode *node = NULL;
vcd_assert (track_id >= 0);
@@ -335,7 +335,7 @@ _vcd_obj_remove_mpeg_track (VcdObj *obj, int track_id)
vcd_assert (node != NULL);
- track = (mpeg_sequence_t *) _vcd_list_node_data (node);
+ track = (mpeg_sequence_t *) _cdio_list_node_data (node);
vcd_mpeg_source_destroy (track->source, true);
@@ -344,15 +344,15 @@ _vcd_obj_remove_mpeg_track (VcdObj *obj, int track_id)
/* fixup offsets */
{
- VcdListNode *node2 = node;
- while ((node2 = _vcd_list_node_next (node2)) != NULL)
- ((mpeg_sequence_t *) _vcd_list_node_data (node))->relative_start_extent -= length;
+ CdioListNode *node2 = node;
+ while ((node2 = _cdio_list_node_next (node2)) != NULL)
+ ((mpeg_sequence_t *) _cdio_list_node_data (node))->relative_start_extent -= length;
}
obj->relative_end_extent -= length;
/* shift up */
- _vcd_list_node_free (node, true);
+ _cdio_list_node_free (node, true);
}
int
@@ -383,7 +383,7 @@ vcd_obj_append_segment_play_item (VcdObj *obj, VcdMpegSource *mpeg_source,
}
vcd_info ("scanning mpeg segment item #%d for scanpoints...",
- _vcd_list_length (obj->mpeg_segment_list));
+ _cdio_list_length (obj->mpeg_segment_list));
vcd_mpeg_source_scan (mpeg_source, !obj->relaxed_aps,
obj->update_scan_offsets, NULL, NULL);
@@ -405,13 +405,13 @@ vcd_obj_append_segment_play_item (VcdObj *obj, VcdMpegSource *mpeg_source,
segment->info = vcd_mpeg_source_get_info (mpeg_source);
segment->segment_count = _vcd_len2blocks (segment->info->packets, 150);
- segment->pause_list = _vcd_list_new ();
+ segment->pause_list = _cdio_list_new ();
vcd_debug ("SPI length is %d sector(s), allocated %d segment(s)",
segment->info->packets,
segment->segment_count);
- _vcd_list_append (obj->mpeg_segment_list, segment);
+ _cdio_list_append (obj->mpeg_segment_list, segment);
return 0;
}
@@ -423,7 +423,7 @@ vcd_obj_append_sequence_play_item (VcdObj *obj, VcdMpegSource *mpeg_source,
{
unsigned length;
mpeg_sequence_t *sequence = NULL;
- int track_no = _vcd_list_length (obj->mpeg_sequence_list);
+ int track_no = _cdio_list_length (obj->mpeg_sequence_list);
vcd_assert (obj != NULL);
vcd_assert (mpeg_source != NULL);
@@ -463,8 +463,8 @@ vcd_obj_append_sequence_play_item (VcdObj *obj, VcdMpegSource *mpeg_source,
sequence->info = vcd_mpeg_source_get_info (mpeg_source);
length = sequence->info->packets;
- sequence->entry_list = _vcd_list_new ();
- sequence->pause_list = _vcd_list_new ();
+ sequence->entry_list = _cdio_list_new ();
+ sequence->pause_list = _cdio_list_new ();
obj->relative_end_extent += obj->track_pregap;
sequence->relative_start_extent = obj->relative_end_extent;
@@ -526,7 +526,7 @@ vcd_obj_append_sequence_play_item (VcdObj *obj, VcdMpegSource *mpeg_source,
/* vcd_debug ("track# %d's detected playing time: %.2f seconds", */
/* track_no, sequence->info->playing_time); */
- _vcd_list_append (obj->mpeg_sequence_list, sequence);
+ _cdio_list_append (obj->mpeg_sequence_list, sequence);
return track_no;
}
@@ -554,7 +554,8 @@ vcd_obj_add_sequence_pause (VcdObj *obj, const char sequence_id[],
if (sequence_id)
_sequence = _vcd_obj_get_sequence_by_id (obj, sequence_id);
else
- _sequence = _vcd_list_node_data (_vcd_list_end (obj->mpeg_sequence_list));
+ _sequence =
+ _cdio_list_node_data (_cdio_list_end (obj->mpeg_sequence_list));
if (!_sequence)
{
@@ -572,11 +573,11 @@ vcd_obj_add_sequence_pause (VcdObj *obj, const char sequence_id[],
_pause->id = strdup (pause_id);
_pause->time = pause_time;
- _vcd_list_append (_sequence->pause_list, _pause);
+ _cdio_list_append (_sequence->pause_list, _pause);
}
_vcd_list_sort (_sequence->pause_list,
- (_vcd_list_cmp_func) _pause_cmp);
+ (_cdio_list_cmp_func) _pause_cmp);
vcd_debug ("added autopause point at %f", pause_time);
@@ -594,7 +595,7 @@ vcd_obj_add_segment_pause (VcdObj *obj, const char segment_id[],
if (segment_id)
_segment = _vcd_obj_get_segment_by_id (obj, segment_id);
else
- _segment = _vcd_list_node_data (_vcd_list_end (obj->mpeg_segment_list));
+ _segment = _cdio_list_node_data (_cdio_list_end (obj->mpeg_segment_list));
if (!_segment)
{
@@ -612,11 +613,11 @@ vcd_obj_add_segment_pause (VcdObj *obj, const char segment_id[],
_pause->id = strdup (pause_id);
_pause->time = pause_time;
- _vcd_list_append (_segment->pause_list, _pause);
+ _cdio_list_append (_segment->pause_list, _pause);
}
_vcd_list_sort (_segment->pause_list,
- (_vcd_list_cmp_func) _pause_cmp);
+ (_cdio_list_cmp_func) _pause_cmp);
vcd_debug ("added autopause point at %f", pause_time);
@@ -646,7 +647,8 @@ vcd_obj_add_sequence_entry (VcdObj *obj, const char sequence_id[],
if (sequence_id)
_sequence = _vcd_obj_get_sequence_by_id (obj, sequence_id);
else
- _sequence = _vcd_list_node_data (_vcd_list_end (obj->mpeg_sequence_list));
+ _sequence =
+ _cdio_list_node_data (_cdio_list_end (obj->mpeg_sequence_list));
if (!_sequence)
{
@@ -654,7 +656,7 @@ vcd_obj_add_sequence_entry (VcdObj *obj, const char sequence_id[],
return -1;
}
- if (_vcd_list_length (_sequence->entry_list) >= MAX_SEQ_ENTRIES)
+ if (_cdio_list_length (_sequence->entry_list) >= MAX_SEQ_ENTRIES)
{
vcd_error ("only %d entries per sequence allowed!", MAX_SEQ_ENTRIES);
return -1;
@@ -673,11 +675,11 @@ vcd_obj_add_sequence_entry (VcdObj *obj, const char sequence_id[],
_entry->id = strdup (entry_id);
_entry->time = entry_time;
- _vcd_list_append (_sequence->entry_list, _entry);
+ _cdio_list_append (_sequence->entry_list, _entry);
}
_vcd_list_sort (_sequence->entry_list,
- (_vcd_list_cmp_func) _entry_cmp);
+ (_cdio_list_cmp_func) _entry_cmp);
return 0;
}
@@ -685,7 +687,7 @@ vcd_obj_add_sequence_entry (VcdObj *obj, const char sequence_id[],
void
vcd_obj_destroy (VcdObj *obj)
{
- VcdListNode *node;
+ CdioListNode *node;
vcd_assert (obj != NULL);
vcd_assert (!obj->in_output);
@@ -693,20 +695,20 @@ vcd_obj_destroy (VcdObj *obj)
free (obj->iso_volume_label);
free (obj->iso_application_id);
- _VCD_LIST_FOREACH (node, obj->custom_file_list)
+ _CDIO_LIST_FOREACH (node, obj->custom_file_list)
{
- custom_file_t *p = _vcd_list_node_data (node);
+ custom_file_t *p = _cdio_list_node_data (node);
free (p->iso_pathname);
}
- _vcd_list_free (obj->custom_file_list, true);
+ _cdio_list_free (obj->custom_file_list, true);
- _vcd_list_free (obj->custom_dir_list, true);
+ _cdio_list_free (obj->custom_dir_list, true);
- while (_vcd_list_length (obj->mpeg_sequence_list))
+ while (_cdio_list_length (obj->mpeg_sequence_list))
_vcd_obj_remove_mpeg_track (obj, 0);
- _vcd_list_free (obj->mpeg_sequence_list, true);
+ _cdio_list_free (obj->mpeg_sequence_list, true);
free (obj);
}
@@ -983,10 +985,10 @@ vcd_obj_add_dir (VcdObj *obj, const char iso_pathname[])
return 1;
}
- _vcd_list_append (obj->custom_dir_list, _iso_pathname);
+ _cdio_list_append (obj->custom_dir_list, _iso_pathname);
_vcd_list_sort (obj->custom_dir_list,
- (_vcd_list_cmp_func) strcmp);
+ (_cdio_list_cmp_func) strcmp);
return 0;
}
@@ -1050,7 +1052,7 @@ vcd_obj_add_file (VcdObj *obj, const char iso_pathname[],
p->start_extent = 0;
p->sectors = sectors;
- _vcd_list_append (obj->custom_file_list, p);
+ _cdio_list_append (obj->custom_file_list, p);
}
return 0;
@@ -1060,7 +1062,7 @@ static void
_finalize_vcd_iso_track_allocation (VcdObj *obj)
{
int n;
- VcdListNode *node;
+ CdioListNode *node;
uint32_t dir_secs = SECTOR_NIL;
@@ -1119,9 +1121,9 @@ _finalize_vcd_iso_track_allocation (VcdObj *obj)
/* insert segments */
- _VCD_LIST_FOREACH (node, obj->mpeg_segment_list)
+ _CDIO_LIST_FOREACH (node, obj->mpeg_segment_list)
{
- mpeg_segment_t *_segment = _vcd_list_node_data (node);
+ mpeg_segment_t *_segment = _cdio_list_node_data (node);
_segment->start_extent =
_vcd_salloc (obj->iso_bitmap, SECTOR_NIL,
@@ -1163,9 +1165,9 @@ _finalize_vcd_iso_track_allocation (VcdObj *obj)
/* now for the custom files */
- _VCD_LIST_FOREACH (node, obj->custom_file_list)
+ _CDIO_LIST_FOREACH (node, obj->custom_file_list)
{
- custom_file_t *p = _vcd_list_node_data (node);
+ custom_file_t *p = _cdio_list_node_data (node);
if (p->sectors)
{
@@ -1194,7 +1196,7 @@ static void
_finalize_vcd_iso_track_filesystem (VcdObj *obj)
{
int n;
- VcdListNode *node;
+ CdioListNode *node;
/* create filesystem entries */
@@ -1211,7 +1213,7 @@ _finalize_vcd_iso_track_filesystem (VcdObj *obj)
_vcd_directory_mkdir (obj->dir, "VCD");
/* add segment dir only when there are actually segment play items */
- if (_vcd_list_length (obj->mpeg_segment_list))
+ if (_cdio_list_length (obj->mpeg_segment_list))
_vcd_directory_mkdir (obj->dir, "SEGMENT");
_vcd_directory_mkfile (obj->dir, "VCD/ENTRIES.VCD",
@@ -1246,7 +1248,7 @@ _finalize_vcd_iso_track_filesystem (VcdObj *obj)
}
/* add segment dir only when there are actually segment play items */
- if (_vcd_list_length (obj->mpeg_segment_list))
+ if (_cdio_list_length (obj->mpeg_segment_list))
_vcd_directory_mkdir (obj->dir, "SEGMENT");
_vcd_directory_mkdir (obj->dir, "SVCD");
@@ -1284,9 +1286,9 @@ _finalize_vcd_iso_track_filesystem (VcdObj *obj)
/* SEGMENTS */
n = 1;
- _VCD_LIST_FOREACH (node, obj->mpeg_segment_list)
+ _CDIO_LIST_FOREACH (node, obj->mpeg_segment_list)
{
- mpeg_segment_t *segment = _vcd_list_node_data (node);
+ mpeg_segment_t *segment = _cdio_list_node_data (node);
char segment_pathname[128] = { 0, };
const char *fmt = NULL;
uint8_t fnum = 0;
@@ -1344,15 +1346,15 @@ _finalize_vcd_iso_track_filesystem (VcdObj *obj)
}
/* custom files/dirs */
- _VCD_LIST_FOREACH (node, obj->custom_dir_list)
+ _CDIO_LIST_FOREACH (node, obj->custom_dir_list)
{
- char *p = _vcd_list_node_data (node);
+ char *p = _cdio_list_node_data (node);
_vcd_directory_mkdir (obj->dir, p);
}
- _VCD_LIST_FOREACH (node, obj->custom_file_list)
+ _CDIO_LIST_FOREACH (node, obj->custom_file_list)
{
- custom_file_t *p = _vcd_list_node_data (node);
+ custom_file_t *p = _cdio_list_node_data (node);
_vcd_directory_mkfile (obj->dir, p->iso_pathname, p->start_extent,
(p->raw_flag
@@ -1363,11 +1365,11 @@ _finalize_vcd_iso_track_filesystem (VcdObj *obj)
n = 0;
- _VCD_LIST_FOREACH (node, obj->mpeg_sequence_list)
+ _CDIO_LIST_FOREACH (node, obj->mpeg_sequence_list)
{
char avseq_pathname[128] = { 0, };
const char *fmt = NULL;
- mpeg_sequence_t *_sequence = _vcd_list_node_data (node);
+ mpeg_sequence_t *_sequence = _cdio_list_node_data (node);
uint32_t extent = _sequence->relative_start_extent;
uint8_t file_num = 0;
@@ -1478,7 +1480,7 @@ _callback_wrapper (VcdObj *obj, int force)
_pi.sectors_written = obj->sectors_written;
_pi.total_sectors = obj->relative_end_extent + obj->iso_size;
_pi.in_track = obj->in_track;
- _pi.total_tracks = _vcd_list_length (obj->mpeg_sequence_list) + 1;
+ _pi.total_tracks = _cdio_list_length (obj->mpeg_sequence_list) + 1;
return obj->progress_callback (&_pi, obj->callback_user_data);
}
@@ -1580,8 +1582,8 @@ static int
_write_sequence (VcdObj *obj, int track_idx)
{
mpeg_sequence_t *track =
- _vcd_list_node_data (_vcd_list_at (obj->mpeg_sequence_list, track_idx));
- VcdListNode *pause_node;
+ _cdio_list_node_data (_vcd_list_at (obj->mpeg_sequence_list, track_idx));
+ CdioListNode *pause_node;
int n, lastsect = obj->sectors_written;
char buf[2324];
struct {
@@ -1680,7 +1682,7 @@ _write_sequence (VcdObj *obj, int track_idx)
_write_m2_image_sector (obj, zero, lastsect++, track_idx + 1,
0, SM_FORM2|SM_REALT, 0);
- pause_node = _vcd_list_begin (track->pause_list);
+ pause_node = _cdio_list_begin (track->pause_list);
for (n = 0; n < track->info->packets; n++) {
int ci = 0, sm = 0, cnum = 0, fnum = 0;
@@ -1692,7 +1694,7 @@ _write_sequence (VcdObj *obj, int track_idx)
while (pause_node)
{
- pause_t *_pause = _vcd_list_node_data (pause_node);
+ pause_t *_pause = _cdio_list_node_data (pause_node);
if (!pkt_flags.has_pts)
break; /* no pts */
@@ -1706,7 +1708,7 @@ _write_sequence (VcdObj *obj, int track_idx)
vcd_debug ("setting auto pause trigger for time %f (pts %f) @%d",
_pause->time, pkt_flags.pts, n);
- pause_node = _vcd_list_node_next (pause_node);
+ pause_node = _cdio_list_node_next (pause_node);
}
switch (vcd_mpeg_packet_get_type (&pkt_flags))
@@ -1807,13 +1809,13 @@ _write_sequence (VcdObj *obj, int track_idx)
static int
_write_segment (VcdObj *obj, mpeg_segment_t *_segment)
{
- VcdListNode *pause_node;
+ CdioListNode *pause_node;
unsigned packet_no;
int n = obj->sectors_written;
vcd_assert (_segment->start_extent == n);
- pause_node = _vcd_list_begin (_segment->pause_list);
+ pause_node = _cdio_list_begin (_segment->pause_list);
for (packet_no = 0;
packet_no < (_segment->segment_count * VCDINFO_SEGMENT_SECTOR_SIZE);
@@ -1838,7 +1840,7 @@ _write_segment (VcdObj *obj, mpeg_segment_t *_segment)
while (pause_node)
{
- pause_t *_pause = _vcd_list_node_data (pause_node);
+ pause_t *_pause = _cdio_list_node_data (pause_node);
if (!pkt_flags.has_pts)
break; /* no pts */
@@ -1852,7 +1854,7 @@ _write_segment (VcdObj *obj, mpeg_segment_t *_segment)
vcd_debug ("setting auto pause trigger for time %f (pts %f) @%d",
_pause->time, pkt_flags.pts, n);
- pause_node = _vcd_list_node_next (pause_node);
+ pause_node = _cdio_list_node_next (pause_node);
}
switch (vcd_mpeg_packet_get_type (&pkt_flags))
@@ -1950,16 +1952,16 @@ static uint32_t
_get_closest_aps (const struct vcd_mpeg_stream_info *_mpeg_info, double t,
struct aps_data *_best_aps)
{
- VcdListNode *node;
+ CdioListNode *node;
struct aps_data best_aps;
bool first = true;
vcd_assert (_mpeg_info != NULL);
vcd_assert (_mpeg_info->shdr[0].aps_list != NULL);
- _VCD_LIST_FOREACH (node, _mpeg_info->shdr[0].aps_list)
+ _CDIO_LIST_FOREACH (node, _mpeg_info->shdr[0].aps_list)
{
- struct aps_data *_aps = _vcd_list_node_data (node);
+ struct aps_data *_aps = _cdio_list_node_data (node);
if (first)
{
@@ -1981,17 +1983,17 @@ _get_closest_aps (const struct vcd_mpeg_stream_info *_mpeg_info, double t,
static void
_update_entry_points (VcdObj *obj)
{
- VcdListNode *sequence_node;
+ CdioListNode *sequence_node;
- _VCD_LIST_FOREACH (sequence_node, obj->mpeg_sequence_list)
+ _CDIO_LIST_FOREACH (sequence_node, obj->mpeg_sequence_list)
{
- mpeg_sequence_t *_sequence = _vcd_list_node_data (sequence_node);
- VcdListNode *entry_node;
+ mpeg_sequence_t *_sequence = _cdio_list_node_data (sequence_node);
+ CdioListNode *entry_node;
unsigned last_packet_no = 0;
- _VCD_LIST_FOREACH (entry_node, _sequence->entry_list)
+ _CDIO_LIST_FOREACH (entry_node, _sequence->entry_list)
{
- entry_t *_entry = _vcd_list_node_data (entry_node);
+ entry_t *_entry = _cdio_list_node_data (entry_node);
_get_closest_aps (_sequence->info, _entry->time, &_entry->aps);
@@ -2014,7 +2016,7 @@ _update_entry_points (VcdObj *obj)
static int
_write_vcd_iso_track (VcdObj *obj, const time_t *create_time)
{
- VcdListNode *node;
+ CdioListNode *node;
int n;
/* generate dir sectors */
@@ -2092,9 +2094,9 @@ _write_vcd_iso_track (VcdObj *obj, const time_t *create_time)
vcd_assert (n == obj->mpeg_segment_start_extent);
- _VCD_LIST_FOREACH (node, obj->mpeg_segment_list)
+ _CDIO_LIST_FOREACH (node, obj->mpeg_segment_list)
{
- mpeg_segment_t *_segment = _vcd_list_node_data (node);
+ mpeg_segment_t *_segment = _cdio_list_node_data (node);
_write_segment (obj, _segment);
}
@@ -2127,12 +2129,12 @@ _write_vcd_iso_track (VcdObj *obj, const time_t *create_time)
vcd_assert (n == obj->custom_file_start_extent);
- _VCD_LIST_FOREACH (node, obj->custom_file_list)
+ _CDIO_LIST_FOREACH (node, obj->custom_file_list)
{
- custom_file_t *p = _vcd_list_node_data (node);
+ custom_file_t *p = _cdio_list_node_data (node);
- vcd_info ("writing file `%s' (%d bytes%s)",
- p->iso_pathname, p->size,
+ vcd_info ("writing file `%s' (%lu bytes%s)",
+ p->iso_pathname, (unsigned long) p->size,
p->raw_flag ? ", raw sectors file": "");
if (p->raw_flag)
_write_source_mode2_raw (obj, p->file, p->start_extent);
@@ -2155,7 +2157,7 @@ vcd_obj_get_image_size (VcdObj *obj)
vcd_assert (!obj->in_output);
- if (_vcd_list_length (obj->mpeg_sequence_list) > 0)
+ if (_cdio_list_length (obj->mpeg_sequence_list) > 0)
{
/* fixme -- make this efficient */
size_sectors = vcd_obj_begin_output (obj);
@@ -2171,7 +2173,7 @@ vcd_obj_begin_output (VcdObj *obj)
uint32_t image_size;
vcd_assert (obj != NULL);
- vcd_assert (_vcd_list_length (obj->mpeg_sequence_list) > 0);
+ vcd_assert (_cdio_list_length (obj->mpeg_sequence_list) > 0);
vcd_assert (!obj->in_output);
obj->in_output = true;
@@ -2183,7 +2185,7 @@ vcd_obj_begin_output (VcdObj *obj)
obj->dir = _vcd_directory_new ();
- obj->buffer_dict_list = _vcd_list_new ();
+ obj->buffer_dict_list = _cdio_list_new ();
_finalize_vcd_iso_track (obj);
@@ -2224,7 +2226,7 @@ vcd_obj_end_output (VcdObj *obj)
_vcd_salloc_destroy (obj->iso_bitmap);
_dict_clean (obj);
- _vcd_list_free (obj->buffer_dict_list, true);
+ _cdio_list_free (obj->buffer_dict_list, true);
}
int
@@ -2245,7 +2247,7 @@ vcd_obj_append_pbc_node (VcdObj *obj, struct _pbc_t *_pbc)
return -1;
}
- _vcd_list_append (obj->pbc_list, _pbc);
+ _cdio_list_append (obj->pbc_list, _pbc);
return 0;
}
@@ -2255,7 +2257,7 @@ vcd_obj_write_image (VcdObj *obj, VcdImageSink *image_sink,
progress_callback_t callback, void *user_data,
const time_t *create_time)
{
- VcdListNode *node;
+ CdioListNode *node;
vcd_assert (obj != NULL);
vcd_assert (obj->in_output);
@@ -2266,37 +2268,40 @@ vcd_obj_write_image (VcdObj *obj, VcdImageSink *image_sink,
/* start with meta info */
{
- VcdList *cue_list;
+ CdioList *cue_list;
vcd_cue_t *_cue;
- cue_list = _vcd_list_new ();
+ cue_list = _cdio_list_new ();
- _vcd_list_append (cue_list, (_cue = _vcd_malloc (sizeof (vcd_cue_t))));
+ _cdio_list_append (cue_list, (_cue = _vcd_malloc (sizeof (vcd_cue_t))));
_cue->lsn = 0;
_cue->type = VCD_CUE_TRACK_START;
- _VCD_LIST_FOREACH (node, obj->mpeg_sequence_list)
+ _CDIO_LIST_FOREACH (node, obj->mpeg_sequence_list)
{
- mpeg_sequence_t *track = _vcd_list_node_data (node);
- VcdListNode *entry_node;
+ mpeg_sequence_t *track = _cdio_list_node_data (node);
+ CdioListNode *entry_node;
- _vcd_list_append (cue_list, (_cue = _vcd_malloc (sizeof (vcd_cue_t))));
+ _cdio_list_append (cue_list,
+ (_cue = _vcd_malloc (sizeof (vcd_cue_t))));
_cue->lsn = track->relative_start_extent + obj->iso_size;
_cue->lsn -= obj->track_pregap;
_cue->type = VCD_CUE_PREGAP_START;
- _vcd_list_append (cue_list, (_cue = _vcd_malloc (sizeof (vcd_cue_t))));
+ _cdio_list_append (cue_list,
+ (_cue = _vcd_malloc (sizeof (vcd_cue_t))));
_cue->lsn = track->relative_start_extent + obj->iso_size;
_cue->type = VCD_CUE_TRACK_START;
- _VCD_LIST_FOREACH (entry_node, track->entry_list)
+ _CDIO_LIST_FOREACH (entry_node, track->entry_list)
{
- entry_t *_entry = _vcd_list_node_data (entry_node);
+ entry_t *_entry = _cdio_list_node_data (entry_node);
- _vcd_list_append (cue_list, (_cue = _vcd_malloc (sizeof (vcd_cue_t))));
+ _cdio_list_append (cue_list,
+ (_cue = _vcd_malloc (sizeof (vcd_cue_t))));
_cue->lsn = obj->iso_size;
_cue->lsn += track->relative_start_extent;
@@ -2309,7 +2314,7 @@ vcd_obj_write_image (VcdObj *obj, VcdImageSink *image_sink,
/* add last one... */
- _vcd_list_append (cue_list, (_cue = _vcd_malloc (sizeof (vcd_cue_t))));
+ _cdio_list_append (cue_list, (_cue = _vcd_malloc (sizeof (vcd_cue_t))));
_cue->lsn = obj->relative_end_extent + obj->iso_size;
@@ -2321,7 +2326,7 @@ vcd_obj_write_image (VcdObj *obj, VcdImageSink *image_sink,
vcd_image_sink_set_cuesheet (image_sink, cue_list);
- _vcd_list_free (cue_list, true);
+ _cdio_list_free (cue_list, true);
}
/* and now for the pay load */
@@ -2347,7 +2352,7 @@ vcd_obj_write_image (VcdObj *obj, VcdImageSink *image_sink,
if (obj->update_scan_offsets)
vcd_info ("'update scan offsets' option enabled for the following tracks!");
- for (track = 0;track < _vcd_list_length (obj->mpeg_sequence_list);track++)
+ for (track = 0;track < _cdio_list_length (obj->mpeg_sequence_list);track++)
{
obj->in_track++;
diff --git a/src/input/vcd/libvcd/vcd_read.c b/src/input/vcd/libvcd/vcd_read.c
index b598ffe31..dd9d30cfa 100644
--- a/src/input/vcd/libvcd/vcd_read.c
+++ b/src/input/vcd/libvcd/vcd_read.c
@@ -1,5 +1,5 @@
/*
- $Id: vcd_read.c,v 1.3 2004/04/11 14:59:23 mroi Exp $
+ $Id: vcd_read.c,v 1.4 2005/01/01 02:43:59 rockyb Exp $
Copyright (C) 2001,2003 Herbert Valerio Riedel <hvr@gnu.org>
Copyright (C) 2003 Rocky Bernstein <rocky@gnu.org>
@@ -19,7 +19,7 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-
+
#include "vcd_read.h"
#include "vcd_assert.h"
#include <libvcd/inf.h>
@@ -53,7 +53,7 @@ read_pvd(CdIo *cdio, iso9660_pvd_t *pvd)
}
bool
-read_entries(CdIo *cdio, EntriesVcd *entries)
+read_entries(CdIo *cdio, EntriesVcd_t *entries)
{
if (cdio_read_mode2_sector (cdio, entries, ENTRIES_VCD_SECTOR, false)) {
vcd_error ("error reading Entries sector (%d)", ENTRIES_VCD_SECTOR);
@@ -74,7 +74,7 @@ read_entries(CdIo *cdio, EntriesVcd *entries)
}
bool
-read_info(CdIo *cdio, InfoVcd *info, vcd_type_t *vcd_type)
+read_info(CdIo *cdio, InfoVcd_t *info, vcd_type_t *vcd_type)
{
if (cdio_read_mode2_sector (cdio, info, INFO_VCD_SECTOR, false)) {
vcd_error ("error reading Info sector (%d)", INFO_VCD_SECTOR);
diff --git a/src/input/vcd/libvcd/vcd_read.h b/src/input/vcd/libvcd/vcd_read.h
index 9dde195f4..fb9e1509b 100644
--- a/src/input/vcd/libvcd/vcd_read.h
+++ b/src/input/vcd/libvcd/vcd_read.h
@@ -1,5 +1,5 @@
/*
- $Id: vcd_read.h,v 1.2 2004/04/11 12:20:32 miguelfreitas Exp $
+ $Id: vcd_read.h,v 1.3 2005/01/01 02:43:59 rockyb Exp $
Copyright (C) 2003 Rocky Bernstein <rocky@gnu.org>
@@ -29,8 +29,8 @@
#include <libvcd/files_private.h>
bool read_pvd(CdIo *cdio, iso9660_pvd_t *pvd);
-bool read_entries(CdIo *cdio, EntriesVcd *entries);
-bool read_info(CdIo *cdio, InfoVcd *info, vcd_type_t *vcd_type);
+bool read_entries(CdIo *cdio, EntriesVcd_t *entries);
+bool read_info(CdIo *cdio, InfoVcd_t *info, vcd_type_t *vcd_type);
diff --git a/src/input/vcd/libvcd/version.h b/src/input/vcd/libvcd/version.h
new file mode 100644
index 000000000..d1f658c23
--- /dev/null
+++ b/src/input/vcd/libvcd/version.h
@@ -0,0 +1,11 @@
+/* $Id: version.h,v 1.1 2005/01/01 02:43:59 rockyb Exp $ */
+/** \file version.h
+ * \brief A file simply containing the library version number.
+ */
+
+/*! LIBVCD_VERSION can as a string in programs to show what version is used. */
+#define LIBVCD_VERSION "0.7.21-"
+
+/*! LIBCDIO_VERSION_NUM can be used for testing in the C preprocessor */
+#define LIBVCD_VERSION_NUM 21
+