ports/127839: [update] www/linux-flashplugin9: new libflashsupport
Tijl Coosemans
tijl at ulyssis.org
Sat Oct 4 00:00:14 UTC 2008
>Number: 127839
>Category: ports
>Synopsis: [update] www/linux-flashplugin9: new libflashsupport
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-ports-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: update
>Submitter-Id: current-users
>Arrival-Date: Sat Oct 04 00:00:13 UTC 2008
>Closed-Date:
>Last-Modified:
>Originator: Tijl Coosemans
>Release: FreeBSD 7.1-PRERELEASE i386
>Organization:
>Environment:
>Description:
The Linux Flash 9 plugin allows anyone to implement support for additional
sound, video and crypto backends through libflashsupport.so.
The libflashsupport.so currently installed by www/linux-flashplugin9
is compiled from [1], but a newer version is available at [2].
In addition to that patch-flashsupport.c below improves OSS sound
support. You can compile your own version of libflashsupport on a Linux
system by dowloading [2] and patching it with patch-flashsupport.c.
Then run ./configure and make. Also, the lib has to be linked with the
same version of OpenSLL as currently in the linux-openssl port.
The patch-linux-flashplugin9 file updates the port to install the new
libflashsupport. I've uploaded a compiled version of the lib to my
website, but I would prefer if it could be hosted on LOCAL as it is now.
I've also removed the IGNORE flag because the plugin should soon
work [3].
[1] http://labs.adobe.com/wiki/index.php/Flash_Player:Additional_Interface_Support_for_Linux
[2] http://sourceforge.net/projects/flashsupport/
[3] http://lists.freebsd.org/pipermail/freebsd-emulation/2008-September/005311.html
(thread continues in October archives)
>How-To-Repeat:
>Fix:
--- patch-linux-flashplugin9 begins here ---
diff -u linux-flashplugin9.orig/Makefile linux-flashplugin9/Makefile
--- linux-flashplugin9/Makefile.orig 2008-10-04 00:24:53.000000000 +0200
+++ linux-flashplugin9/Makefile 2008-10-04 00:30:30.000000000 +0200
@@ -10,7 +10,7 @@
PORTREVISION= 1
CATEGORIES= www multimedia linux
MASTER_SITES= http://fpdownload.macromedia.com/get/flashplayer/current/:plugin \
- LOCAL/lofi:suplib
+ http://tijl.ulyssis.be/mirror/:suplib
PKGNAMEPREFIX= linux-
DISTFILES= install_flash_player_9_linux.tar.gz:plugin \
libflashsupport.so:suplib
@@ -25,7 +25,6 @@
ONLY_FOR_ARCHS= amd64 i386
USE_LINUX= yes
-IGNORE= Unstable, no sound, generally unusable state
RESTRICTED= Redistribution not allowed
NO_BUILD= yes
diff -u linux-flashplugin9.orig/distinfo linux-flashplugin9/distinfo
--- linux-flashplugin9/distinfo.orig 2008-10-04 00:24:53.000000000 +0200
+++ linux-flashplugin9/distinfo 2008-10-04 00:30:34.000000000 +0200
@@ -1,6 +1,6 @@
MD5 (flashplugin/9.0r124/install_flash_player_9_linux.tar.gz) = a311fd97aa6c214f63dc089a20cf7a39
SHA256 (flashplugin/9.0r124/install_flash_player_9_linux.tar.gz) = f4295c0e008d5658db601bdaf44e2594e823713b9899e9d00d04243f9c44e99a
SIZE (flashplugin/9.0r124/install_flash_player_9_linux.tar.gz) = 3044538
-MD5 (flashplugin/9.0r124/libflashsupport.so) = 20a61e9de44e7f58e9566b16ee6651d9
-SHA256 (flashplugin/9.0r124/libflashsupport.so) = 0ddd948214657e17866663cad5fb02ff2bfe8360969359db4aca6d65456d4cad
-SIZE (flashplugin/9.0r124/libflashsupport.so) = 7493
+MD5 (flashplugin/9.0r124/libflashsupport.so) = c034ff03c92f94b2938062b6bbc02669
+SHA256 (flashplugin/9.0r124/libflashsupport.so) = d5c943e5a59016dcfeab5016d701e1e5e08fb30e8780d239053fec175b89d1e1
+SIZE (flashplugin/9.0r124/libflashsupport.so) = 44752
--- patch-linux-flashplugin9 ends here ---
--- patch-flashsupport.c begins here ---
--- flashsupport.c.orig 2008-10-01 16:25:02.000000000 +0200
+++ flashsupport.c 2008-10-03 19:48:24.000000000 +0200
@@ -44,11 +44,11 @@
#endif // HAVE_ALSA_ASOUNDLIB_H
#ifdef HAVE_LINUX_SOUNDCARD_H
-//#define OSS
+#define OSS
#endif // HAVE_LINUX_SOUNDCARD_H
#ifdef HAVE_LINUX_VIDEODEV_H
-#define V4L1
+//#define V4L1
#endif // HAVE_LINUX_VIDEODEV_H
////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -735,31 +735,22 @@
struct SoundOutput_Instance {
int oss_fd;
pthread_t thread;
- int signal;
+ volatile int signal;
+ char * buf;
+ int bsize;
};
static void *oss_thread(void *ptr)
{
struct SoundOutput_Instance *instance = (struct SoundOutput_Instance *)ptr;
- char buffer[4096];
- int len = 0;
- int written = 0;
- for(;;) {
- FPI_SoundOutput_FillBuffer(ptr,buffer,4096);
- len = 4096;
- while ( len ) {
- written = write(instance->oss_fd, buffer, len);
- if ( written >= 0 ) {
- len -= written;
- }
- if ( instance->signal ) {
- pthread_exit(0);
- }
- if ( written < 0 ) {
- usleep(100);
- }
+ usleep(100);
+ while ( instance->signal == 0 ) {
+ FPI_SoundOutput_FillBuffer(ptr, instance->buf, instance->bsize);
+ if ( write(instance->oss_fd, instance->buf, instance->bsize) < 0 ) {
+ usleep(100);
}
}
+ return NULL;
}
static void *FPX_SoundOutput_Open()
@@ -784,12 +775,16 @@
if ( ioctl(instance->oss_fd, SNDCTL_DSP_SPEED, &speed) < 0 ) goto fail;
+ if ( ioctl(instance->oss_fd, SNDCTL_DSP_GETBLKSIZE, &instance->bsize) < 0 ) goto fail;
+
+ instance->buf = (char *)FPI_Mem_Alloc(instance->bsize);
+
if ( pthread_create(&instance->thread, 0, oss_thread, instance) < 0 ) goto fail;
return instance;
fail:
if ( instance ) {
- if ( FPI_Mem_Free ) FPI_Mem_Free(instance);
+ FPX_SoundOutput_Close(instance);
}
return 0;
}
@@ -803,18 +798,19 @@
instance->signal = 1;
- if ( instance->oss_fd ) {
- ioctl(instance->oss_fd, SNDCTL_DSP_RESET, 0);
- }
-
if ( instance->thread ) {
pthread_join(instance->thread,&retVal);
}
if ( instance->oss_fd ) {
+ ioctl(instance->oss_fd, SNDCTL_DSP_RESET, 0);
close(instance->oss_fd);
}
+ if ( instance->buf ) {
+ if ( FPI_Mem_Free ) FPI_Mem_Free(instance->buf);
+ }
+
if ( FPI_Mem_Free ) FPI_Mem_Free(instance);
return 0;
@@ -827,10 +823,10 @@
struct SoundOutput_Instance *instance = (struct SoundOutput_Instance *)ptr;
if ( instance->oss_fd ) {
int value = 0;
- if ( ( value = ioctl(instance->oss_fd,SNDCTL_DSP_GETODELAY,&value) ) == 0 ) {
- return value / 4;
+ if ( ioctl(instance->oss_fd,SNDCTL_DSP_GETODELAY,&value) == -1 ) {
+ return 0;
}
- return 0;
+ return value / 4;
}
return -1;
}
--- patch-flashsupport.c ends here ---
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-ports-bugs
mailing list