NetBSD Problem Report #48401

From www@NetBSD.org  Sat Nov 23 05:08:26 2013
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [149.20.53.66])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(Client CN "mail.NetBSD.org", Issuer "Postmaster NetBSD.org" (verified OK))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 8EF62A61B3
	for <gnats-bugs@gnats.NetBSD.org>; Sat, 23 Nov 2013 05:08:26 +0000 (UTC)
Message-Id: <20131123050824.E98FBA6291@mollari.NetBSD.org>
Date: Sat, 23 Nov 2013 05:08:24 +0000 (UTC)
From: nathanialsloss@yahoo.com.au
Reply-To: nathanialsloss@yahoo.com.au
To: gnats-bugs@NetBSD.org
Subject: multimedia/mplayer fixups for skiping cd audio and video capture
X-Send-Pr-Version: www-1.0

>Number:         48401
>Category:       pkg
>Synopsis:       multimedia/mplayer fixups for skiping cd audio and video capture
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Nov 23 05:10:00 +0000 2013
>Originator:     Nat Sloss
>Release:        pkgsrc-2013Q2
>Organization:
>Environment:
NetBSD beast 6.1.1_PATCH NetBSD 6.1.1_PATCH (PCIPAE) #22: Thu Nov 21 23:13:25 EST 2013  build@microrusty:/usr/src/sys/arch/i386/compile/obj/PCIPAE i386
>Description:
Mplayer uses cdparanoia and I have found cdaudio playpack to be broken, the audio will skip no matter the -cache value.  After searching the net I found other people with the same problem that recommended to use libcdio instead.

Also I've included a patch for tv v4l2 encoding as I found one of the webcams I own would supply empty frames and this would distort viewing and encoding.
>How-To-Repeat:
Try the following:

mplayer cdda://1

You may find the audio will skip or stutter after one second.
>Fix:
Make libcdio the default for mplayer by applying these patches:

Index: pkgsrc/multimedia/mplayer-share/options.mk
===================================================================
RCS file: /cvsroot/pkgsrc/multimedia/mplayer-share/options.mk,v
retrieving revision 1.49
diff -u -r1.49 options.mk
--- pkgsrc/multimedia/mplayer-share/options.mk	16 Jan 2013 18:07:08 -0000	1.49
+++ pkgsrc/multimedia/mplayer-share/options.mk	23 Nov 2013 04:54:59 -0000
@@ -53,6 +53,7 @@

 # OS-specific options.
 .if ${OPSYS} == "FreeBSD" || ${OPSYS} == "Linux" || ${OPSYS} == "NetBSD"
+PKG_SUPPORTED_OPTIONS+=	libcdio
 PKG_SUPPORTED_OPTIONS+=	cdparanoia
 .elif ${OPSYS} == "SunOS"
 PKG_SUPPORTED_OPTIONS+=	mlib
@@ -91,7 +92,7 @@
 # Define PKG_SUGGESTED_OPTIONS.
 # -------------------------------------------------------------------------

-.for o in cdparanoia dv esound gif jpeg \
+.for o in libcdio dv esound gif jpeg \
 	    dvdread dvdnav \
 	    lame mad mplayer-menu \
 	    mplayer-default-cflags mplayer-runtime-cpudetection \
@@ -137,6 +138,13 @@
 CONFIGURE_ARGS+=	--disable-caca
 .endif

+.if !empty(PKG_OPTIONS:Mlibcdio)
+CONFIGURE_ARGS+=	--enable-libcdio
+.  include "../../misc/libcdio/buildlink3.mk"
+.else
+CONFIGURE_ARGS+=	--disable-libcdio
+.endif
+
 .if !empty(PKG_OPTIONS:Mcdparanoia)
 CONFIGURE_ARGS+=	--enable-cdparanoia
 .  include "../../audio/cdparanoia/buildlink3.mk"
Index: pkgsrc/multimedia/mplayer-share/patches/patch-aa
===================================================================
RCS file: /cvsroot/pkgsrc/multimedia/mplayer-share/patches/patch-aa,v
retrieving revision 1.31
diff -u -r1.31 patch-aa
--- pkgsrc/multimedia/mplayer-share/patches/patch-aa	12 Jan 2013 11:55:35 -0000	1.31
+++ pkgsrc/multimedia/mplayer-share/patches/patch-aa	23 Nov 2013 04:55:23 -0000
@@ -8,8 +8,8 @@
   --enable-aa.
 o Add support for dvb capture on NetBSD.

---- configure.orig	2012-05-22 14:01:51.000000000 -0400
-+++ configure	2013-01-11 22:15:07.000000000 -0500
+--- configure.orig	2012-05-22 18:01:51.000000000 +0000
++++ configure
 @@ -1519,8 +1519,9 @@ if test -z "$_target" ; then
        alpha) host_arch=alpha ;;
        sun4*|sparc*) host_arch=sparc ;;
@@ -129,3 +129,11 @@

  if darwin; then

+@@ -5853,6 +5879,7 @@ if test "$_libcdio" = yes ; then
+     _cdparanoia=no
+     def_libcdio='#define CONFIG_LIBCDIO 1'
+     def_havelibcdio='yes'
++    libs_mplayer="${libs_mplayer} -lcdio -lcdio_cdda -lcdio_paranoia"
+ else
+     _libcdio=no
+     def_libcdio='#undef CONFIG_LIBCDIO'
--- /dev/null	2013-11-23 15:34:43.000000000 +1100
+++ pkgsrc/multimedia/mplayer-share/patches/patch-stream_stream__cdda.c	2013-11-23 15:52:17.000000000 +1100
@@ -0,0 +1,13 @@
+$NetBSD$
+
+--- stream/stream_cdda.c.orig	2012-01-15 12:40:02.000000000 +0000
++++ stream/stream_cdda.c
+@@ -336,7 +336,7 @@ static int open_cdda(stream_t *st,int m,
+     cdd = cdda_identify_scsi(p->generic_dev,p->device,0,NULL);
+   else
+ #endif
+-#if defined(__NetBSD__)
++#if defined(__NetBSD__) && !defined(CONFIG_LIBCDIO)
+     cdd = cdda_identify_scsi(p->device,p->device,0,NULL);
+ #else
+     cdd = cdda_identify(p->device,0,NULL);
--- /dev/null	2013-11-23 15:34:43.000000000 +1100
+++ pkgsrc/multimedia/mplayer-share/patches/patch-stream_tvi__v4l2.c	2013-11-23 15:52:18.000000000 +1100
@@ -0,0 +1,26 @@
+$NetBSD$
+
+--- stream/tvi_v4l2.c.orig	2011-06-26 14:42:35.000000000 +0000
++++ stream/tvi_v4l2.c
+@@ -1641,7 +1641,7 @@ static void *video_grabber(void *data)
+         buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
+         buf.memory = V4L2_MEMORY_MMAP;
+         ret = ioctl(priv->video_fd, VIDIOC_DQBUF, &buf);
+-
++	
+         if (ret < 0) {
+             /*
+               if there's no signal, the buffer might me dequeued
+@@ -1675,6 +1675,12 @@ static void *video_grabber(void *data)
+             continue;
+         }
+ 
++	if (buf.bytesused == 0) {
++		if (buf.m.userptr)
++                    ioctl(priv->video_fd, VIDIOC_QBUF, &buf);
++		continue;
++	}
++			
+         /* store the timestamp of the very first frame as reference */
+         if (!priv->frames++) {
+             if (!priv->tv_param->noaudio) pthread_mutex_lock(&priv->skew_mutex);

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.