From dcp1990@fez.theamigan.net  Thu Jan 12 23:34:22 2006
Return-Path: <dcp1990@fez.theamigan.net>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 5DD9816A420
	for <FreeBSD-gnats-submit@freebsd.org>; Thu, 12 Jan 2006 23:34:22 +0000 (GMT)
	(envelope-from dcp1990@fez.theamigan.net)
Received: from eastrmmtao05.cox.net (eastrmmtao05.cox.net [68.230.240.34])
	by mx1.FreeBSD.org (Postfix) with ESMTP id D955743D5A
	for <FreeBSD-gnats-submit@freebsd.org>; Thu, 12 Jan 2006 23:34:05 +0000 (GMT)
	(envelope-from dcp1990@fez.theamigan.net)
Received: from styx.theamigan.net ([68.9.18.102]) by eastrmmtao05.cox.net
          (InterMail vM.6.01.05.02 201-2131-123-102-20050715) with ESMTP
          id <20060112233357.LGB14098.eastrmmtao05.cox.net@styx.theamigan.net>;
          Thu, 12 Jan 2006 18:33:57 -0500
Received: from fez.theamigan.net (fez.danponte.net [10.10.10.2])
	by styx.theamigan.net (8.13.4/8.13.4) with ESMTP id k0CNY4CX040107;
	Thu, 12 Jan 2006 18:34:04 -0500 (EST)
	(envelope-from dcp1990@fez.theamigan.net)
Received: from fez.theamigan.net (localhost.theamigan.net [127.0.0.1])
	by fez.theamigan.net (8.13.4/8.13.4) with ESMTP id k0CNXqbn078939;
	Thu, 12 Jan 2006 18:33:52 -0500 (EST)
	(envelope-from dcp1990@fez.theamigan.net)
Received: (from root@localhost)
	by fez.theamigan.net (8.13.4/8.13.4/Submit) id k0CNXqYm078938;
	Thu, 12 Jan 2006 18:33:52 -0500 (EST)
	(envelope-from dcp1990)
Message-Id: <200601122333.k0CNXqYm078938@fez.theamigan.net>
Date: Thu, 12 Jan 2006 18:33:52 -0500 (EST)
From: Dan Ponte <dcp1990@neptune.atopia.net>
Reply-To: Dan Ponte <dcp1990@neptune.atopia.net>
To: FreeBSD-gnats-submit@freebsd.org
Cc: dcp1990@neptune.atopia.net
Subject: [PATCH] libxine ioctl errors on amd64
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         91728
>Category:       ports
>Synopsis:       [PATCH] libxine ioctl errors on amd64
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    nobutaka
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Jan 12 23:40:03 GMT 2006
>Closed-Date:    Sun Feb 05 17:24:48 GMT 2006
>Last-Modified:  Sun Feb 05 17:24:48 GMT 2006
>Originator:     Dan Ponte
>Release:        FreeBSD 6.0-STABLE amd64
>Organization:
Unix Users Anonymous
>Environment:
System: FreeBSD fez.theamigan.net 6.0-STABLE FreeBSD 6.0-STABLE #0: Wed Jan 11 18:13:32 EST 2006 root@fez.theamigan.net:/usr/obj/usr/src/sys/FEZ amd64


>Description:
	When using xine/libxine and trying to change the volume, one will receive errors such as the following in their dmesg:
WARNING pid 56010 (xine): ioctl sign-extension ioctl ffffffffc0044d04
	This is because libxine uses int for the request argument to ioctl(2). This is not a problem on i386, since sizeof(int) == sizeof(long). However, on amd64, where long is larger than int, it is a problem.
>How-To-Repeat:
	Use xine and try to change the volume with its interface.
>Fix:
	Apply the following patch:

--- xinepatch.diff begins here ---
--- work/xine-lib-1.1.1/src/audio_out/audio_oss_out_old.c	Thu Jan 12 17:46:36 2006
+++ work/xine-lib-1.1.1/src/audio_out/audio_oss_out.c	Thu Jan 12 18:26:16 2006
@@ -155,7 +155,7 @@
 		       uint32_t bits, uint32_t rate, int mode) {
 
   oss_driver_t *this = (oss_driver_t *) this_gen;
-  int tmp;
+  long tmp;
 
   xprintf(this->xine, XINE_VERBOSITY_DEBUG,
 	  "audio_oss_out: ao_open rate=%d, mode=%d, dev=%s\n", rate, mode, this->audio_dev);
@@ -287,14 +287,14 @@
       if (bits==8) {
 	xprintf(this->xine, XINE_VERBOSITY_DEBUG, "audio_oss_out: SNDCTL_DSP_SETFMT failed for AFMT_U8.\n");
         if (tmp != AFMT_U8)
-          xprintf(this->xine, XINE_VERBOSITY_DEBUG, "audio_oss_out: ioctl succeeded but set format to 0x%x.\n",tmp);
+          xprintf(this->xine, XINE_VERBOSITY_DEBUG, "audio_oss_out: ioctl succeeded but set format to 0x%lx.\n",tmp);
         else
           xprintf(this->xine, XINE_VERBOSITY_DEBUG, "audio_oss_out: The AFMT_U8 ioctl failed.\n");
         return 0;
       } else {
 	xprintf(this->xine, XINE_VERBOSITY_DEBUG, "audio_oss_out: SNDCTL_DSP_SETFMT failed for AFMT_S16_NE.\n");
         if (tmp != AFMT_S16_NE)
-          xprintf(this->xine, XINE_VERBOSITY_DEBUG, "audio_oss_out: ioctl succeeded but set format to 0x%x.\n",tmp);
+          xprintf(this->xine, XINE_VERBOSITY_DEBUG, "audio_oss_out: ioctl succeeded but set format to 0x%lx.\n",tmp);
         else
           xprintf(this->xine, XINE_VERBOSITY_DEBUG, "audio_oss_out: The AFMT_S16_NE ioctl failed.\n");
         return 0;
@@ -313,7 +313,7 @@
     tmp = AFMT_AC3;
     if (ioctl(this->audio_fd, SNDCTL_DSP_SETFMT, &tmp) < 0 || tmp != AFMT_AC3) {
       xprintf(this->xine, XINE_VERBOSITY_DEBUG, 
-	      "audio_oss_out: AC3 SNDCTL_DSP_SETFMT failed. %d. Using alternative.\n",tmp);
+	      "audio_oss_out: AC3 SNDCTL_DSP_SETFMT failed. %ld. Using alternative.\n",tmp);
       tmp = AFMT_S16_LE;
       ioctl(this->audio_fd, SNDCTL_DSP_SETFMT, &tmp);
     }
@@ -369,7 +369,7 @@
 
   count_info    info;
   oss_driver_t *this = (oss_driver_t *) this_gen;
-  int           bytes_left;
+  long           bytes_left;
   int           frames;
   struct        timeval tv;
 
@@ -507,7 +507,7 @@
 static int ao_oss_get_property (ao_driver_t *this_gen, int property) {
 
   oss_driver_t *this = (oss_driver_t *) this_gen;
-  int           audio_devs;
+  long           audio_devs;
 
   switch(property) {
   case AO_PROP_PCM_VOL:
@@ -515,8 +515,8 @@
     if(!this->mixer.mute) {
       
       if(this->mixer.fd != -1) {
-	int cmd = 0;
-	int v;
+	long cmd = 0;
+	long v;
 	
 	ioctl(this->mixer.fd, SOUND_MIXER_READ_DEVMASK, &audio_devs);
 	
@@ -546,7 +546,7 @@
 static int ao_oss_set_property (ao_driver_t *this_gen, int property, int value) {
 
   oss_driver_t *this = (oss_driver_t *) this_gen;
-  int           audio_devs;
+  long           audio_devs;
 
   switch(property) {
   case AO_PROP_PCM_VOL:
@@ -554,8 +554,8 @@
     if(!this->mixer.mute) {
       
       if(this->mixer.fd != -1) {
-	int cmd = 0;
-	int v;
+	long cmd = 0;
+	long v;
 	
 	ioctl(this->mixer.fd, SOUND_MIXER_READ_DEVMASK, &audio_devs);
 	
@@ -583,8 +583,8 @@
     if(this->mixer.mute) {
       
       if(this->mixer.fd != -1) {
-	int cmd = 0;
-	int v = 0;
+	long cmd = 0;
+	long v = 0;
 	
 	ioctl(this->mixer.fd, SOUND_MIXER_READ_DEVMASK, &audio_devs);
 	
@@ -657,7 +657,7 @@
 static int probe_audio_devices(oss_driver_t *this) {
   const char *base_names[2] = {"/dev/dsp", "/dev/sound/dsp"};
   int base_num, i;
-  int audio_fd, rate;
+  long audio_fd, rate;
   int best_rate;
   char devname[30];
 
@@ -696,9 +696,9 @@
   oss_class_t     *class = (oss_class_t *) class_gen;
   config_values_t *config = class->config;
   oss_driver_t    *this;
-  int              caps;
+  long              caps;
   int              audio_fd;
-  int              num_channels, status, arg;
+  long              num_channels, status, arg;
   static char     *sync_methods[] = {"auto", "getodelay", "getoptr", "softsync", "probebuffer", NULL};
   static char     *devname_opts[] = {"auto", "/dev/dsp", "/dev/sound/dsp", NULL};
   int devname_val, devname_num;
--- xinepatch.diff ends here ---


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->nobutaka 
Responsible-Changed-By: anray 
Responsible-Changed-When: Fri Jan 13 16:32:46 UTC 2006 
Responsible-Changed-Why:  
Over to maintainer 

http://www.freebsd.org/cgi/query-pr.cgi?pr=91728 
State-Changed-From-To: open->closed 
State-Changed-By: nobutaka 
State-Changed-When: Sun Feb 5 17:24:23 UTC 2006 
State-Changed-Why:  
Committed, thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=91728 
>Unformatted:
