Bug 81372 - EBUILD: media-tv/mythtv-0.16.20050115 viaXvMC (cle266) support
Bug#: 81372 Product:  Gentoo Linux Version: unspecified Platform: x86
OS/Version: Linux Status: RESOLVED Severity: major Priority: P4
Resolution: FIXED Assigned To: media-tv@gentoo.org Reported By: deepshag@gmail.com
Component: Ebuilds
URL:  http://sourceforge.net/project/shownotes.php?release_id=266463
Summary: EBUILD: media-tv/mythtv-0.16.20050115 viaXvMC (cle266) support
Keywords:  InCVS
Status Whiteboard: 
Opened: 2005-02-09 07:24 0000
Description:   Opened: 2005-02-09 07:24 0000
SYMPTOMS:  Ebuild appears to compile normally, free of errors, but when user
attempts to play a recorded program or view live TV, mythfrontend crashes
entirely, and returns error messages indicating that it failed to initialize
the  XvMC control.

SCOPE:  Affects gentoo users running MythTV on an computer using the Via CLE266
hardware MPEG decoder.  Primary users of the Via Epia mini-ITX motherboard
family.

This one took me a minute to track down, but there is an error in the use of
sed to uncomment lines in the file settings.pro (located
/var/tmp/portage/mythtv-0.16.20050115/work/mythtv/settings.pro).  It should be
noted also that the settings.pro included with mythtv-0.16 is non-standard to
start with, and not all of the via XvMC lines start out commented out, like
they should (to make it like the nvidia XvMC lines).  

The original calls from the ebuild are (lines 131-140):
  if use cle266 ; then
    sed -e 's:#EXTRA_LIBS += -lviaXvMC -lXvMC:EXTRA_LIBS += -lviaXvMC -lXvMC:'
\
      -i 'settings.pro' || die "enable cle266 sed failed"
  fi

  if ! use cle266 ; then
    sed -e 's:CONFIG += using_xvmc using_xvmc_vld:#CONFIG += using_xvmc
using_xvmc_vld:' \
      -e 's:DEFINES += USING_XVMC USING_XVMC_VLD:#DEFINES += USING_XVMC
USING_XVMC_VLD:' \
      -i 'settings.pro' || die "disable VLD XvMC sed failed"
  fi

Should be replaced with:
  if use cle266 ; then
    sed -e 's:#CONFIG += using_xvmc using_xvmc_vld:CONFIG += using_xvmc
using_xvmc_vld:' \
      -e 's:#DEFINES += USING_XVMC USING_XVMC_VLD:DEFINES += USING_XVMC
USING_XVMC_VLD:' \
      -e 's:#EXTRA_LIBS += -lviaXvMC -lXvMC:EXTRA_LIBS += -lviaXvMC -lXvMC:' \
      -i 'settings.pro' || die "enable cle266 sed failed"
  fi

  if ! use cle266 ; then # needed because nvidia and cle266 are not compatible
    sed -e 's:EXTRA_LIBS += -lviaXvMC -lXvMC:#EXTRA_LIBS += -lviaXvMC -lXvMC:'
\
      -i 'settings.pro' || die "disable VLD XvMC sed failed"
  fi

I tested this ebuild after making these changes, and was able to successfully
build mythtv 0.16 with viaXvMC support, and it acted normally (didn't crash as
soon as it attempted an XvMC call).

------- Comment #1 From Michael Trowbridge 2005-02-09 07:39:41 0000 -------
Created an attachment (id=50831) [details]
Patch to fix the via XvMC support in ebuild mythtv-0.16.20050115.ebuild

------- Comment #2 From Doug Goldstein 2005-02-09 23:25:08 0000 -------
Thanks. In CVS.

------- Comment #3 From Anders Hellgren 2005-02-10 06:36:22 0000 -------
This fix breaks USE="nvidia -cle266", as the nvidia sed matches also the
XvMC_VLD support. It results in the following settings.pro.

# XvMC support, modify as necessary.
CONFIG += using_xvmc
DEFINES += USING_XVMC
EXTRA_LIBS += -lXvMCNVIDIA -lXvMC

# XvMC_VLD support, modify as necessary. Incompatible with normal XvMC support.
CONFIG += using_xvmc using_xvmc_vld
DEFINES += USING_XVMC USING_XVMC_VLD
##EXTRA_LIBS += -lviaXvMC -lXvMC

Mythtv consequently fails to compile due to 

xvmc_render.h:13:36: X11/extensions/vldXvMC.h: No such file or directory

while compiling vmcvldvideo.c

The ! use cle266 case needs to be restored to its previous state.