From tijl@kalimero.kotnet.org  Fri Oct  3 23:58:24 2008
Return-Path: <tijl@kalimero.kotnet.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 926771065699
	for <FreeBSD-gnats-submit@freebsd.org>; Fri,  3 Oct 2008 23:58:24 +0000 (UTC)
	(envelope-from tijl@kalimero.kotnet.org)
Received: from mailrelay011.isp.belgacom.be (mailrelay011.isp.belgacom.be [195.238.6.178])
	by mx1.freebsd.org (Postfix) with ESMTP id 7B10F8FC16
	for <FreeBSD-gnats-submit@freebsd.org>; Fri,  3 Oct 2008 23:58:22 +0000 (UTC)
	(envelope-from tijl@kalimero.kotnet.org)
Received: from 77.113-64-87.adsl-dyn.isp.belgacom.be (HELO kalimero.kotnet.org) ([87.64.113.77])
  by relay.skynet.be with ESMTP; 04 Oct 2008 01:28:44 +0200
Received: from kalimero.kotnet.org (kalimero.kotnet.org [127.0.0.1])
	by kalimero.kotnet.org (8.14.3/8.14.3) with ESMTP id m93NSY8L034316;
	Sat, 4 Oct 2008 01:28:34 +0200 (CEST)
	(envelope-from tijl@kalimero.kotnet.org)
Received: (from tijl@localhost)
	by kalimero.kotnet.org (8.14.3/8.14.3/Submit) id m93NSXjP034315;
	Sat, 4 Oct 2008 01:28:33 +0200 (CEST)
	(envelope-from tijl)
Message-Id: <200810032328.m93NSXjP034315@kalimero.kotnet.org>
Date: Sat, 4 Oct 2008 01:28:33 +0200 (CEST)
From: Tijl Coosemans <tijl@ulyssis.org>
Reply-To: Tijl Coosemans <tijl@ulyssis.org>
To: FreeBSD-gnats-submit@freebsd.org
Cc: jamie@bishopston.net
Subject: [update] www/linux-flashplugin9: new libflashsupport
X-Send-Pr-Version: 3.113
X-GNATS-Notify: jamie@bishopston.net

>Number:         127839
>Category:       ports
>Synopsis:       [update] www/linux-flashplugin9: new libflashsupport
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    bsam
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          update
>Submitter-Id:   current-users
>Arrival-Date:   Sat Oct 04 00:00:13 UTC 2008
>Closed-Date:    Sun Oct 19 17:38:20 UTC 2008
>Last-Modified:  Sun Oct 19 17:40:01 UTC 2008
>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:
State-Changed-From-To: open->feedback 
State-Changed-By: edwin 
State-Changed-When: Sat Oct 4 00:00:23 UTC 2008 
State-Changed-Why:  
Awaiting maintainers feedback (via the GNATS Auto Assign Tool) 

http://www.freebsd.org/cgi/query-pr.cgi?pr=127839 

From: Edwin Groothuis <edwin@FreeBSD.org>
To: jamie@bishopston.net
Cc: bug-followup@FreeBSD.org
Subject: Re: ports/127839: [update] www/linux-flashplugin9: new libflashsupport
Date: Sat, 4 Oct 2008 00:00:22 UT

 Maintainer of www/linux-flashplugin9,
 
 Please note that PR ports/127839 has just been submitted.
 
 If it contains a patch for an upgrade, an enhancement or a bug fix
 you agree on, reply to this email stating that you approve the patch
 and a committer will take care of it.
 
 The full text of the PR can be found at:
     http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/127839
 
 -- 
 Edwin Groothuis via the GNATS Auto Assign Tool
 edwin@FreeBSD.org
Responsible-Changed-From-To: freebsd-ports-bugs->bsam 
Responsible-Changed-By: bsam 
Responsible-Changed-When: Sat Oct 4 16:34:59 UTC 2008 
Responsible-Changed-Why:  
Take. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=127839 

From: Jamie Jones <jamie@bishopston.net>
To: jamie@bishopston.net, bug-followup@FreeBSD.ORG
Cc: bug-followup@FreeBSD.ORG
Subject: Re: ports/127839: [update] www/linux-flashplugin9: new
 libflashsupport
Date: Sun, 19 Oct 2008 16:09:44 +0100

 patch approved. Thanks, and apology for the delay, I've not been around for a while
 
 cheers,
 jamie
State-Changed-From-To: feedback->open 
State-Changed-By: bsam 
State-Changed-When: Sun Oct 19 16:56:39 UTC 2008 
State-Changed-Why:  
A feedback is recieved. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=127839 
State-Changed-From-To: open->closed 
State-Changed-By: bsam 
State-Changed-When: Sun Oct 19 17:38:07 UTC 2008 
State-Changed-Why:  
Committed, thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=127839 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/127839: commit references a PR
Date: Sun, 19 Oct 2008 17:37:39 +0000 (UTC)

 bsam        2008-10-19 17:37:28 UTC
 
   FreeBSD ports repository
 
   Modified files:
     www/linux-flashplugin9 Makefile distinfo 
   Log:
   . upgrade to an updated version (a patch for sources is available at the PR);  [1]
   . remove IGNORE;  [1]
   . bump PORTREVISION.
   
   PR:             127839  [1]
   Submitted by:   Tijl Coosemans <tijl at ulyssis.org>  [1]
   Approved by:    Jamie Jones <jamie at bishopston.net> (maintainer)  [1]
   
   Revision  Changes    Path
   1.29      +2 -3      ports/www/linux-flashplugin9/Makefile
   1.18      +3 -3      ports/www/linux-flashplugin9/distinfo
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 
>Unformatted:
