From 2c0b408072017847e9cce1dd3c80d4866fe8e843 Mon Sep 17 00:00:00 2001 From: Brad Smith Date: Tue, 17 Feb 2009 02:22:28 +0000 Subject: Add OpenBSD support to the CDDA, DVD & VCD input code. --- src/input/input_cdda.c | 16 +++++++++------- src/input/input_dvd.c | 3 +++ src/input/input_vcd.c | 18 +++++++++++------- 3 files changed, 23 insertions(+), 14 deletions(-) (limited to 'src') diff --git a/src/input/input_cdda.c b/src/input/input_cdda.c index e702238c2..d982909eb 100644 --- a/src/input/input_cdda.c +++ b/src/input/input_cdda.c @@ -71,6 +71,8 @@ #define DEFAULT_CDDA_DEVICE "/vol/dev/aliases/cdrom0" #elif defined(WIN32) #define DEFAULT_CDDA_DEVICE "d:\\" +#elif defined(__OpenBSD__) +#define DEFAULT_CDDA_DEVICE "/dev/rcd0c" #else #define DEFAULT_CDDA_DEVICE "/dev/cdrom" #endif @@ -611,7 +613,7 @@ static int read_cdrom_frames(cdda_input_plugin_t *this_gen, int frame, int num_f return 0; } -#elif defined(__FreeBSD_kernel__) || defined(__NetBSD__) +#elif defined(__FreeBSD_kernel__) || defined(__NetBSD__) || defined(__OpenBSD__) #include @@ -624,7 +626,7 @@ static int read_cdrom_toc(int fd, cdrom_toc *toc) { struct ioc_toc_header tochdr; #if defined(__FreeBSD_kernel__) struct ioc_read_toc_single_entry tocentry; -#elif defined(__NetBSD__) +#elif defined(__NetBSD__) || defined(__OpenBSD__) struct ioc_read_toc_entry tocentry; struct cd_toc_entry data; #endif @@ -659,7 +661,7 @@ static int read_cdrom_toc(int fd, cdrom_toc *toc) { perror("CDIOREADTOCENTRY"); return -1; } -#elif defined(__NetBSD__) +#elif defined(__NetBSD__) || defined(__OpenBSD__) memset(&data, 0, sizeof(data)); tocentry.data_len = sizeof(data); tocentry.data = &data; @@ -680,7 +682,7 @@ static int read_cdrom_toc(int fd, cdrom_toc *toc) { (tocentry.entry.addr.msf.minute * CD_SECONDS_PER_MINUTE * CD_FRAMES_PER_SECOND) + (tocentry.entry.addr.msf.second * CD_FRAMES_PER_SECOND) + tocentry.entry.addr.msf.frame; -#elif defined(__NetBSD__) +#elif defined(__NetBSD__) || defined(__OpenBSD__) toc->toc_entries[i-1].track_mode = (tocentry.data->control & 0x04) ? 1 : 0; toc->toc_entries[i-1].first_frame_minute = tocentry.data->addr.msf.minute; toc->toc_entries[i-1].first_frame_second = tocentry.data->addr.msf.second; @@ -702,7 +704,7 @@ static int read_cdrom_toc(int fd, cdrom_toc *toc) { perror("CDIOREADTOCENTRY"); return -1; } -#elif defined(__NetBSD__) +#elif defined(__NetBSD__) || defined(__OpenBSD__) memset(&data, 0, sizeof(data)); tocentry.data_len = sizeof(data); tocentry.data = &data; @@ -723,7 +725,7 @@ static int read_cdrom_toc(int fd, cdrom_toc *toc) { (tocentry.entry.addr.msf.minute * CD_SECONDS_PER_MINUTE * CD_FRAMES_PER_SECOND) + (tocentry.entry.addr.msf.second * CD_FRAMES_PER_SECOND) + tocentry.entry.addr.msf.frame; -#elif defined(__NetBSD__) +#elif defined(__NetBSD__) || defined(__OpenBSD__) toc->leadout_track.track_mode = (tocentry.data->control & 0x04) ? 1 : 0; toc->leadout_track.first_frame_minute = tocentry.data->addr.msf.minute; toc->leadout_track.first_frame_second = tocentry.data->addr.msf.second; @@ -761,7 +763,7 @@ static int read_cdrom_frames(cdda_input_plugin_t *this_gen, int frame, int num_f perror("CDIOCREADAUDIO"); return -1; } -#elif defined(__NetBSD__) +#elif defined(__NetBSD__) || defined(__OpenBSD__) scsireq_t req; int nblocks = 1; diff --git a/src/input/input_dvd.c b/src/input/input_dvd.c index ff3000e5d..279f3c64e 100644 --- a/src/input/input_dvd.c +++ b/src/input/input_dvd.c @@ -115,6 +115,9 @@ /* There really isn't a default on Windows! */ #define DVD_PATH "d:\\" #define RDVD_PATH "d:\\" +#elif defined(__OpenBSD__) +#define DVD_PATH "/dev/rcd0c" +#define RDVD_PATH "/dev/rcd0c" #else #define DVD_PATH "/dev/dvd" #define RDVD_PATH "/dev/rdvd" diff --git a/src/input/input_vcd.c b/src/input/input_vcd.c index 760910a01..c99f57f09 100644 --- a/src/input/input_vcd.c +++ b/src/input/input_vcd.c @@ -92,7 +92,7 @@ typedef struct { #if defined (__linux__) || defined(__sun) struct cdrom_tochdr tochdr; struct cdrom_tocentry tocent[100]; -#elif defined (__FreeBSD_kernel__) +#elif defined (__FreeBSD_kernel__) || defined (__OpenBSD__) struct ioc_toc_header tochdr; struct cd_toc_entry *tocent; off_t cur_sec; @@ -117,7 +117,7 @@ typedef struct { int cur_track; -#if defined (__linux__) || defined(__sun) || defined (__FreeBSD_kernel__) +#if defined (__linux__) || defined(__sun) || defined (__FreeBSD_kernel__) || defined (__OpenBSD__) uint8_t cur_min, cur_sec, cur_frame; #endif @@ -177,7 +177,7 @@ static int input_vcd_read_toc (vcd_input_class_t *this, int fd) { return 0; } -#elif defined (__FreeBSD_kernel__) +#elif defined (__FreeBSD_kernel__) || defined (__OpenBSD__) static int input_vcd_read_toc (vcd_input_class_t *this, int fd) { struct ioc_read_toc_entry te; @@ -393,7 +393,7 @@ static off_t vcd_plugin_read (input_plugin_t *this_gen, memcpy (buf, data.data, VCDSECTORSIZE); /* FIXME */ return VCDSECTORSIZE; } -#elif defined (__FreeBSD_kernel__) +#elif defined (__FreeBSD_kernel__) || defined (__OpenBSD__) static off_t vcd_plugin_read (input_plugin_t *this_gen, char *buf, off_t nlen) { vcd_input_plugin_t *this = (vcd_input_plugin_t *) this_gen; @@ -531,7 +531,7 @@ static buf_element_t *vcd_plugin_read_block (input_plugin_t *this_gen, memcpy (buf->mem, data.data, VCDSECTORSIZE); /* FIXME */ return buf; } -#elif defined (__FreeBSD_kernel__) +#elif defined (__FreeBSD_kernel__) || defined (__OpenBSD__) static buf_element_t *vcd_plugin_read_block (input_plugin_t *this_gen, fifo_buffer_t *fifo, off_t nlen) { @@ -690,7 +690,7 @@ static off_t vcd_plugin_seek (input_plugin_t *this_gen, return offset ; /* FIXME */ } -#elif defined (__FreeBSD_kernel__) +#elif defined (__FreeBSD_kernel__) || defined (__OpenBSD__) static off_t vcd_plugin_seek (input_plugin_t *this_gen, off_t offset, int origin) { @@ -764,7 +764,7 @@ static off_t vcd_plugin_get_length (input_plugin_t *this_gen) { return (off_t) 0; } -#elif defined (__FreeBSD_kernel__) +#elif defined (__FreeBSD_kernel__) || defined (__OpenBSD__) static off_t vcd_plugin_get_length (input_plugin_t *this_gen) { vcd_input_plugin_t *this = (vcd_input_plugin_t *) this_gen; off_t len ; @@ -859,6 +859,10 @@ static int vcd_plugin_open (input_plugin_t *this_gen) { this->cur_min = this->cls->tocent[this->cur_track].cdte_addr.msf.minute; this->cur_sec = this->cls->tocent[this->cur_track].cdte_addr.msf.second; this->cur_frame = this->cls->tocent[this->cur_track].cdte_addr.msf.frame; +#elif defined (__OpenBSD__) + this->cur_min = this->cls->tocent[this->cur_track + 1 - this->cls->tochdr.starting_track].addr.msf.minute; + this->cur_sec = this->cls->tocent[this->cur_track + 1 - this->cls->tochdr.starting_track].addr.msf.second; + this->cur_frame = this->cls->tocent[this->cur_track + 1 - this->cls->tochdr.starting_track].addr.msf.frame; #elif defined (__FreeBSD_kernel__) { int bsize = 2352; -- cgit v1.2.3 From e9f11ca09ddb98716caa635511662ba7585a26ba Mon Sep 17 00:00:00 2001 From: Brad Smith Date: Tue, 17 Feb 2009 02:26:30 +0000 Subject: Allow WINE PE image loader to work on OpenBSD. --- src/libw32dll/wine/pe_image.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/libw32dll/wine/pe_image.c b/src/libw32dll/wine/pe_image.c index c99bbaed0..1366cc396 100644 --- a/src/libw32dll/wine/pe_image.c +++ b/src/libw32dll/wine/pe_image.c @@ -900,7 +900,7 @@ void PE_UnloadLibrary(WINE_MODREF *wm) */ static void extend_stack_for_dll_alloca(void) { -#ifndef __FreeBSD__ +#if !defined(__FreeBSD__) && !defined(__OpenBSD__) void* mem=alloca(0x20000); *(int*)mem=0x1234; #endif -- cgit v1.2.3 From e920a4455f89a550d9106ac60529bf8bf1eab709 Mon Sep 17 00:00:00 2001 From: Brad Smith Date: Tue, 17 Feb 2009 02:29:54 +0000 Subject: Allow cpuid code to compile on OpenBSD/i386. --- src/xine-utils/cpu_accel.c | 4 ++++ src/xine-utils/mangle.h | 4 ++++ 2 files changed, 8 insertions(+) (limited to 'src') diff --git a/src/xine-utils/cpu_accel.c b/src/xine-utils/cpu_accel.c index c241dd7ef..d6c4bd9a8 100644 --- a/src/xine-utils/cpu_accel.c +++ b/src/xine-utils/cpu_accel.c @@ -40,6 +40,10 @@ #include "xineutils.h" +#if defined(PIC) && ! defined(__PIC__) +#define __PIC__ +#endif + #if defined(ARCH_X86) || defined(ARCH_X86_64) static jmp_buf sigill_return; diff --git a/src/xine-utils/mangle.h b/src/xine-utils/mangle.h index 7627ca2fc..746317fa5 100644 --- a/src/xine-utils/mangle.h +++ b/src/xine-utils/mangle.h @@ -29,6 +29,10 @@ #ifndef _XINE_MANGLE_H #define _XINE_MANGLE_H +#if defined(PIC) && ! defined(__PIC__) +#define __PIC__ +#endif + // Use rip-relative addressing if compiling PIC code on x86-64. #if defined(__MINGW32__) || defined(__CYGWIN__) || defined(__DJGPP__) || \ defined(__OS2__) || (defined (__OpenBSD__) && !defined(__ELF__)) -- cgit v1.2.3 From f7c02276ee4d2260d2b32a4fe5846bec93a7f4c6 Mon Sep 17 00:00:00 2001 From: Darren Salt Date: Wed, 18 Feb 2009 19:56:36 +0000 Subject: "No newline at end of file" fixes. --- src/post/goom/ppc_zoom_ultimate.h | 2 +- src/xine-utils/xine_mmx.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/post/goom/ppc_zoom_ultimate.h b/src/post/goom/ppc_zoom_ultimate.h index d6932e7e6..d070071c9 100644 --- a/src/post/goom/ppc_zoom_ultimate.h +++ b/src/post/goom/ppc_zoom_ultimate.h @@ -11,4 +11,4 @@ void ppc_zoom_generic (int sizeX, int sizeY, Pixel *src, Pixel *dest, int *brutS, int *brutD, int buffratio, int precalCoef[16][16]); /* G4 Specific PowerPC Code (Possible use of Altivec and Data Streams) */ -void ppc_zoom_G4 (int sizeX, int sizeY, Pixel *src, Pixel *dest, int *brutS, int *brutD, int buffratio, int precalCoef[16][16]); \ No newline at end of file +void ppc_zoom_G4 (int sizeX, int sizeY, Pixel *src, Pixel *dest, int *brutS, int *brutD, int buffratio, int precalCoef[16][16]); diff --git a/src/xine-utils/xine_mmx.h b/src/xine-utils/xine_mmx.h index 589e1b7fb..440d1efcc 100644 --- a/src/xine-utils/xine_mmx.h +++ b/src/xine-utils/xine_mmx.h @@ -487,4 +487,4 @@ typedef union { : "X" (mem)) #endif /*ARCH_X86 */ -#endif /*XINE_MMX_H*/ \ No newline at end of file +#endif /*XINE_MMX_H*/ -- cgit v1.2.3 From cd58353bf9683a70131d43ce9b249451fe872b2b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20E=2E=20=27Flameeyes=27=20Petten=C3=B2?= Date: Tue, 24 Feb 2009 14:09:26 +0100 Subject: Make _x_compute_interval static (never exported). --- src/xine-engine/demux.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/xine-engine/demux.c b/src/xine-engine/demux.c index 2ff64dfd3..698b44988 100644 --- a/src/xine-engine/demux.c +++ b/src/xine-engine/demux.c @@ -120,7 +120,7 @@ void _x_demux_flush_engine (xine_stream_t *stream) { } -struct timespec _x_compute_interval(unsigned int millisecs) { +static struct timespec _x_compute_interval(unsigned int millisecs) { struct timespec ts; clock_gettime(CLOCK_REALTIME, &ts); uint64_t ttimer = (uint64_t)ts.tv_sec*1000 + ts.tv_nsec/1000000 + millisecs; -- cgit v1.2.3 From 49f1a71f412b110b7a2bd9ead77bd7a69e0392ea Mon Sep 17 00:00:00 2001 From: Darren Salt Date: Thu, 26 Feb 2009 00:27:08 +0000 Subject: Fix install-debug (wrt mpeg2new). --- src/libmpeg2new/include/Makefile.am | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src') diff --git a/src/libmpeg2new/include/Makefile.am b/src/libmpeg2new/include/Makefile.am index 781e6d0b5..91d5575ee 100644 --- a/src/libmpeg2new/include/Makefile.am +++ b/src/libmpeg2new/include/Makefile.am @@ -1 +1,4 @@ +include $(top_builddir)/misc/Makefile.plugins +include $(top_srcdir)/misc/Makefile.common + EXTRA_DIST = video_out.h mmx.h alpha_asm.h vis.h attributes.h tendra.h mpeg2.h mpeg2convert.h -- cgit v1.2.3 From bc0969908f75c641469ab46e9866c3ee3026a435 Mon Sep 17 00:00:00 2001 From: Darren Salt Date: Tue, 3 Mar 2009 19:48:16 +0000 Subject: Fix libmpeg2new build failures on sparc & alpha. Untested. --- src/libmpeg2new/libmpeg2/Makefile.am | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') diff --git a/src/libmpeg2new/libmpeg2/Makefile.am b/src/libmpeg2new/libmpeg2/Makefile.am index 746d99f26..760505a51 100644 --- a/src/libmpeg2new/libmpeg2/Makefile.am +++ b/src/libmpeg2new/libmpeg2/Makefile.am @@ -5,6 +5,8 @@ noinst_LTLIBRARIES = libmpeg2.la libmpeg2arch.la libmpeg2_la_SOURCES = alloc.c header.c decode.c slice.c motion_comp.c idct.c libmpeg2_la_LIBADD = libmpeg2arch.la +AM_CPPFLAGS = -I$(srcdir)/../include + libmpeg2arch_la_SOURCES = motion_comp_mmx.c idct_mmx.c \ motion_comp_altivec.c idct_altivec.c \ motion_comp_alpha.c idct_alpha.c \ -- cgit v1.2.3