90aa524662
from Brad, ok sthen@
91 lines
2.1 KiB
Plaintext
91 lines
2.1 KiB
Plaintext
$OpenBSD: patch-dvdcpy_c,v 1.1 2012/05/03 06:51:24 ajacoutot Exp $
|
|
|
|
Needed for libdvdread 4.2.0.
|
|
|
|
--- dvdcpy.c.orig Fri Dec 16 04:47:07 2011
|
|
+++ dvdcpy.c Fri Dec 16 04:48:13 2011
|
|
@@ -48,83 +48,6 @@
|
|
|
|
static ssize_t current_size, total_size;
|
|
|
|
-#if DVDREAD_VERSION < 905
|
|
-uint32_t UDFFindFile (dvd_reader_t *, const char *, uint32_t *);
|
|
-
|
|
-typedef struct
|
|
-{
|
|
- off_t size;
|
|
- int nr_parts;
|
|
- off_t parts_size[9];
|
|
-} dvd_stat_t;
|
|
-
|
|
-int
|
|
-DVDFileStat (dvd_reader_t *reader, int vts, dvd_read_domain_t domain, dvd_stat_t *statbuf)
|
|
-{
|
|
- char filename[FILENAME_MAX];
|
|
- uint32_t bytes;
|
|
-
|
|
- if (!reader)
|
|
- return -1;
|
|
-
|
|
- if (domain == DVD_READ_TITLE_VOBS && vts == 0)
|
|
- return -1;
|
|
-
|
|
- memset (statbuf, 0, sizeof (dvd_stat_t));
|
|
-
|
|
- if (domain == DVD_READ_TITLE_VOBS)
|
|
- {
|
|
- unsigned int vob;
|
|
-
|
|
- vob = 1;
|
|
- while (1)
|
|
- {
|
|
- snprintf (filename, FILENAME_MAX, "/VIDEO_TS/VTS_%02u_%u.VOB", vts, vob++);
|
|
- if (!UDFFindFile (reader, filename, &bytes))
|
|
- break;
|
|
- statbuf->size += (off_t) bytes;
|
|
- statbuf->parts_size[statbuf->nr_parts++] = (off_t) bytes;
|
|
- }
|
|
-
|
|
- if (vob == 1)
|
|
- return -1;
|
|
-
|
|
- return 0;
|
|
- }
|
|
-
|
|
- switch (domain)
|
|
- {
|
|
- case DVD_READ_INFO_FILE:
|
|
- if (vts == 0)
|
|
- strncpy (filename, "/VIDEO_TS/VIDEO_TS.IFO", FILENAME_MAX);
|
|
- else
|
|
- snprintf (filename, FILENAME_MAX, "/VIDEO_TS/VTS_%02u_0.IFO", vts);
|
|
- break;
|
|
- case DVD_READ_INFO_BACKUP_FILE:
|
|
- if (vts == 0)
|
|
- strncpy (filename, "/VIDEO_TS/VIDEO_TS.BUP", FILENAME_MAX);
|
|
- else
|
|
- snprintf (filename, FILENAME_MAX, "/VIDEO_TS/VTS_%02u_0.BUP", vts);
|
|
- break;
|
|
- case DVD_READ_MENU_VOBS:
|
|
- if (vts == 0)
|
|
- strncpy (filename, "/VIDEO_TS/VIDEO_TS.VOB", FILENAME_MAX);
|
|
- else
|
|
- snprintf (filename, FILENAME_MAX, "/VIDEO_TS/VTS_%02u_0.VOB", vts);
|
|
- break;
|
|
- case DVD_READ_TITLE_VOBS:
|
|
- break;
|
|
- }
|
|
-
|
|
- if (!UDFFindFile (reader, filename, &bytes))
|
|
- return -1;
|
|
-
|
|
- statbuf->size = (off_t) bytes;
|
|
-
|
|
- return 0;
|
|
-}
|
|
-#endif /* DVDREAD_VERSION */
|
|
-
|
|
static ssize_t
|
|
dvd_file_size (dvd_reader_t *reader, unsigned int vts, dvd_read_domain_t domain)
|
|
{
|