ports/57198: multimedia/xmms fix to work with CDDA under -CURRENT
Vladimir Kushnir
vkushnir at Alfacom.net
Wed Sep 24 23:10:24 UTC 2003
>Number: 57198
>Category: ports
>Synopsis: multimedia/xmms fix to work with CDDA under -CURRENT
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-ports-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: sw-bug
>Submitter-Id: current-users
>Arrival-Date: Wed Sep 24 16:10:21 PDT 2003
>Closed-Date:
>Last-Modified:
>Originator: Vladimir Kushnir
>Release: FreeBSD 5.1-CURRENT i386
>Organization:
>Environment:
System: FreeBSD kushnir1.kiev.ua 5.1-CURRENT FreeBSD 5.1-CURRENT #11: Tue Sep 23 12:56:27 EEST 2003 root at kushnir1.kiev.ua:/usr/obj/usr/src/sys/KUSHNIR i386
>Description:
Under FreeBSD-CURRENT, several ports including multimedua/xmms would
not work with CDDA because of CDIOCREADAUDIO ioctl removal from
ATA/ATAPI driver.
>How-To-Repeat:
Try to listen CD with XMMS choosing "Digital audio extraction" option
in CD Audio Player plugin configuration. No sound.
>Fix:
--- patch-Input::cdaudio::cdaudio.c begins here ---
*** Input/cdaudio/cdaudio.c.orig Mon Jul 14 01:20:30 2003
--- Input/cdaudio/cdaudio.c Thu Sep 25 01:55:47 2003
***************
*** 19,24 ****
--- 19,25 ----
*/
#include "cdaudio.h"
+ #include <sys/cdrio.h>
#include <pthread.h>
#include <errno.h>
#include "xmms/i18n.h"
***************
*** 57,63 ****
#ifndef CDDA_DEVICE
# ifdef HAVE_SYS_CDIO_H
# ifdef __FreeBSD__
! # define CDDA_DEVICE "/dev/acd0c"
# elif defined __OpenBSD__
# define CDDA_DEVICE "/dev/cd0c"
# else
--- 58,64 ----
#ifndef CDDA_DEVICE
# ifdef HAVE_SYS_CDIO_H
# ifdef __FreeBSD__
! # define CDDA_DEVICE "/dev/acd0"
# elif defined __OpenBSD__
# define CDDA_DEVICE "/dev/cd0c"
# else
***************
*** 860,885 ****
}
- #if defined(CDIOCREADAUDIO)
#ifdef __FreeBSD__
int read_audio_data(int fd, int pos, int num, void *buf)
{
! struct ioc_read_audio cdra;
! cdra.address.lba = pos - CDDA_MSF_OFFSET;
! cdra.address_format = CD_LBA_FORMAT;
! cdra.nframes = num;
! cdra.buffer = buf;
!
! if (ioctl(fd, CDIOCREADAUDIO, &cdra) < 0)
! return -errno;
!
! return cdra.nframes;
}
- #else
- #error Please test on other <sys/cdio.h> platforms.
#endif
- #endif /* CDIOCREADAUDIO */
#ifdef XMMS_CDROM_BSD_NETBSD /* NetBSD, OpenBSD */
--- 861,876 ----
}
#ifdef __FreeBSD__
int read_audio_data(int fd, int pos, int num, void *buf)
{
! int bsize = 2352;
! if (ioctl(fd, CDRIOCSETBLOCKSIZE, &bsize) == -1) return -errno;
! if (pread(fd, buf, num*bsize, (pos - 150)*bsize) != num*bsize) return 0;
! return num;
}
#endif
#ifdef XMMS_CDROM_BSD_NETBSD /* NetBSD, OpenBSD */
--- patch-Input::cdaudio::cdaudio.c ends here ---
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-ports-bugs
mailing list