# HG changeset patch # User nathan # Date 1256354445 -28800 # Node ID 566c0f412764209f85fd85e16074234236d255aa # Parent f8a59739816b12a11645d2b90d08498cc4c70011 set environment variable with DVB device number diff -r f8a59739816b -r 566c0f412764 README --- a/README Tue Sep 01 20:55:41 2009 +0800 +++ b/README Sat Oct 24 11:20:45 2009 +0800 @@ -177,7 +177,9 @@ MPlayer is called through a script called "mplayer.sh" with the filename to play as first argument and the phrase SLAVE as second argument if slave mode is -enabled. You can use the commandline option -M/--mplayer to change the name and +enabled. Additional the environment variable DVB_DEVICE will be set with the +number of the DVB card which VDR uses as primary display. +You can use the commandline option -M/--mplayer to change the name and location of the mplayer script. The script has to call MPlayer with all the necessary options. diff -r f8a59739816b -r 566c0f412764 examples/mplayer.sh.example --- a/examples/mplayer.sh.example Tue Sep 01 20:55:41 2009 +0800 +++ b/examples/mplayer.sh.example Sat Oct 24 11:20:45 2009 +0800 @@ -12,6 +12,9 @@ # mplayer options, -vc will be added below # add "-lircconf " to enable LIRC support OPTS="-vo mpegpes" +if [ "aa$DVB_DEVICE" != "aa" ]; then + OPTS="-vo mpegpes:card=$DVB_DEVICE -ao mpegpes:card=$DVB_DEVICE" +fi # mplayer options for SlaveMode SLAVE="-slave -quiet -nolirc" diff -r f8a59739816b -r 566c0f412764 player-mplayer.c --- a/player-mplayer.c Tue Sep 01 20:55:41 2009 +0800 +++ b/player-mplayer.c Sat Oct 24 11:20:45 2009 +0800 @@ -397,6 +397,10 @@ else aid[0]=0; snprintf(cmd,sizeof(cmd),"%s \"%s\" %s%s",MPlayerCmd,fname,MPlayerSetup.SlaveMode?"SLAVE":"",aid); free(fname); + // give index of primary dvb adapter device to mplayer via environment variable + char dvb[4]; + snprintf(dvb,sizeof(dvb),"%d",cDevice::PrimaryDevice()->CardIndex()+1); + setenv("DVB_DEVICE",dvb,1); execle("/bin/sh","sh","-c",cmd,(char *)0,environ); esyslog("ERROR: exec failed for %s: (%d) %s",cmd,errno,strerror(errno)); exit(127);