gecko/media/liboggz/wince.patch

76 lines
1.9 KiB
Diff

diff --git a/media/liboggz/include/oggz/oggz_off_t.h b/media/liboggz/include/oggz/oggz_off_t.h
--- a/media/liboggz/include/oggz/oggz_off_t.h
+++ b/media/liboggz/include/oggz/oggz_off_t.h
@@ -34,16 +34,20 @@
#define __OGGZ_OFF_T_H__
/** \file
* Architecture-dependent type and printf format for file position.
* Allows Large File Sizes on systems supporting 64-bit off_t types.
*/
#ifdef _WIN32
+#ifdef WINCE
+ typedef long off_t;
+#endif
+
/* MSVC/Borland & Cygwin */
typedef off_t oggz_off_t;
#define PRI_OGGZ_OFF_T "l"
#else
#include <oggz/oggz_off_t_generated.h>
#endif
diff --git a/media/liboggz/src/liboggz/oggz_seek.c b/media/liboggz/src/liboggz/oggz_seek.c
--- a/media/liboggz/src/liboggz/oggz_seek.c
+++ b/media/liboggz/src/liboggz/oggz_seek.c
@@ -556,21 +556,24 @@ oggz_seek_guess (ogg_int64_t unit_at, og
#endif
return offset_guess;
}
static oggz_off_t
oggz_offset_end (OGGZ * oggz)
{
+#ifndef WINCE
int fd;
struct stat statbuf;
+#endif
oggz_off_t offset_end = -1;
if (oggz->file != NULL) {
+#ifndef WINCE
if ((fd = fileno (oggz->file)) == -1) {
/*oggz_set_error (oggz, OGGZ_ERR_SYSTEM);*/
return -1;
}
if (fstat (fd, &statbuf) == -1) {
/*oggz_set_error (oggz, OGGZ_ERR_SYSTEM);*/
return -1;
@@ -582,16 +585,22 @@ oggz_offset_end (OGGZ * oggz)
printf ("oggz_offset_end: stat size %" PRI_OGGZ_OFF_T "d\n", offset_end);
#endif
} else {
/*oggz_set_error (oggz, OGGZ_ERR_NOSEEK);*/
/* XXX: should be able to just carry on and guess, as per io */
/*return -1;*/
}
+#else
+ int current = ftell(oggz->file);
+ fseek (oggz->file, 0, SEEK_END);
+ offset_end = ftell (oggz->file);
+ fseek (oggz->file, current, SEEK_SET);
+#endif
} else {
oggz_off_t offset_save;
if (oggz->io == NULL || oggz->io->seek == NULL) {
/* No file, and no io seek method */
return -1;
}