diff options
| author | root <root@elwms02.(none)> | 2010-04-06 16:13:08 +0200 |
|---|---|---|
| committer | root <root@elwms02.(none)> | 2010-04-06 16:13:08 +0200 |
| commit | 0e7005fcc7483c01aa102fbea358c5ac65a48d62 (patch) | |
| tree | 11517ce0d3d2977c6732b3aa583b0008083e0bd3 /plugins/mp3 | |
| download | x-vdr-0e7005fcc7483c01aa102fbea358c5ac65a48d62.tar.gz x-vdr-0e7005fcc7483c01aa102fbea358c5ac65a48d62.tar.bz2 | |
hello world
Diffstat (limited to 'plugins/mp3')
| -rw-r--r-- | plugins/mp3/examples/README | 211 | ||||
| -rw-r--r-- | plugins/mp3/examples/image_convert.sh.example | 80 | ||||
| -rw-r--r-- | plugins/mp3/examples/mount.sh.example | 34 | ||||
| -rw-r--r-- | plugins/mp3/examples/mp3sources.conf.example | 4 | ||||
| -rw-r--r-- | plugins/mp3/examples/mplayer.sh.example | 48 | ||||
| -rw-r--r-- | plugins/mp3/examples/network.sh.example | 19 | ||||
| -rw-r--r-- | plugins/mp3/patches/mp3-0.9.15-span-0.0.4.diff | 145 | ||||
| -rw-r--r-- | plugins/mp3/patches/mp3-with_oss.diff | 11 | ||||
| -rw-r--r-- | plugins/mp3/plugin.sh | 90 | ||||
| -rw-r--r-- | plugins/mp3/tracklist-fix.diff | 33 |
10 files changed, 675 insertions, 0 deletions
diff --git a/plugins/mp3/examples/README b/plugins/mp3/examples/README new file mode 100644 index 0000000..be04e84 --- /dev/null +++ b/plugins/mp3/examples/README @@ -0,0 +1,211 @@ + +This is a dual-plugin for VDR. +The "MP3-Plugin" allows playback of MP3 and other audio files. +The "MPlayer-Plugin" is used to call MPlayer for playback of video +files (e.g. DivX) + +Written by: Stefan Hülswitt <s.huelswitt@gmx.de> +Project's homepage: http://www.muempf.de/ +Latest version available at: http://www.muempf.de/down/ + +See the file COPYING for license information. + +---------------------------------------------------------------------- + +For the user manual see the MANUAL file. + +This is the development branch. +Current limitations: +- Back buttons doesn't works while playback. +- Mplayer only works together with VDR if you have set your first DVB card + (/dev/dvb/adapter0/video0) as primary device. + +Installing: +----------- + +By default the Makefile builds both plugins. If you want to use only one of +them, you can add one of "WITHOUT_MP3=1" or "WITHOUT_MPLAYER=1" to your +Make.config. + +Currently the plugins can be build with VDR 1.1.29 or later, but you should not +use version 1.1.31 as this will cause high CPU load during network streaming. +Main development platform is now VDR 1.3.x, but the plugins should work fine +under VDR 1.2.6 too.. + +Any mentioned plugin config file should be located in the "plugins" +subdirectory of your VDR config directory. For a complete description of the +config files, see the MANUAL file. + +The MP3 plugin needs some external libraries (some optionally): + +You must have installed libmad and libid3tag from +<http://www.underbit.com/products/mad/> for decoding MP3 and ID3 support. +Recommended version is 0.15.1b. To compile and install I suggest the following +sequence from the source directory (libmad and libid3tag are installed +separately, so you must execute this once for each directory): + +> configure +> make +> make install +> ldconfig + +You must have installed zlib on your system, too (zlib is used internally by +libid3tag for compressed tags). This should be no problem, as virtually every +Linux distribution includes this library. + +For playback of WAV and other sound files you must have installed libsndfile +<http://www.mega-nerd.com/libsndfile/> on your system. Recommended version +is 1.0.11. The old 0.0.x series doesn't work due to some API changes. To +compile and install libsndfile I suggest the following sequence from the +libsndfile source directory: + +> configure +> make +> make install +> ldconfig + +If you don't want to install libsndfile, you must add "WITHOUT_LIBSNDFILE=1" to +your Make.config. + +If you want to listen to CD audio, you can use cdfs +<http://www.elis.rug.ac.be/~ronsse/cdfs/> (version 0.5c suggested). I suggest +that you create a new entry in /etc/fstab and mp3sources.conf for cdfs. The +/etc/fstab entry could look like: + /dev/hdc /mnt/cdfs cdfs ro,noauto,user 0 0 +The entry for mp3sources.conf could look like: + /mnt/cdfs;CD-Audio;1 +Or if you want only WAV files to be displayed: + /mnt/cdfs;CD-Audio;1;*.wav +If you don't like cdfs, you could use any other filesystems which allows to +access the CD audio data as WAV files. + +For playback of OGG files you must have installed libvorbis and libvorbisfile +<http://www.xiph.org/ogg/vorbis/> on your system. Most Linux distributions +include packages for this. +If you don't want to install the vorbis libraries, you must add +"WITHOUT_LIBVORBISFILE=1" to your Make.config. + +The MP3 plugin can output the sound to an OSS soundcard. To compile this +support add "WITH_OSS_OUTPUT=1" to your Make.config. The output device defaults +to "/dev/dsp" (see command line option -D too). Don't forget to enable OSS +output in the plugin setup menu. + +Before compiling the plugin, you could have a look at "mp3-config.h". This file +includes a number of defines to set options and values at compile time. You +should only change defines, if you have understand the source code parts which +deal with the define. Improper settings can make the MP3 plugin to fail or to +operate unsmoothly. So you should know what you are doing. + +To build the plugin(s) type: +"make plugins" +from the VDR source directory. + +To make the progressbar work with the MPlayer plugin and slave mode you need to +apply a small patch to mplayer. Select an appropriate patch file for your +MPlayer version from the patches subdirectory. Apply the patch and recompile +MPlayer. + +Early 0.90rc versions of MPlayer need a patch to enabled HEAD driver support +too. You will find one for 0.90rc1 in the patches subdirectory. Probably you'll +have to point configure to the new DVB include files with +--with-extraincdir=/usr/local/src/DVB/include or where ever you have stored the +files. MPlayer versions later as 0.90rc5 allow to select HEAD support with a +configure option or even detect this automatically. + +Command line options: +--------------------- + +Both plugins have a command line option -m/--mount to define the name and +location of the mount script. The default mount script is "mount.sh". This +script is called from the plugin with 2 options on the command line. The first +is one of mount/unmount/eject/status and gives the action to perform. The +second one is the base directory as defined in "mp3sources.conf" or +"mplayersources.conf". The script must return the exit code 0 if the action was +successful and 1 if the action failed (see the comments in the example +"mount.sh" script which comes with the archive). + +The MP3 plugin maintains a cache for information scanned from song files (e.g. +ID3 tags). This information is saved to the id3info.cache file by default +located in the video directory. You can use command line option -C/--cache to +specify a different directory for this file. + +If you are using cdfs, the MP3 plugin is able to query a CDDB database for the +song information (like title, artist). Local CDDB lookups can be enable from +the setup menu and you must give the path to your local CDDB files with +commandline option -B/--cddb. The database layout follows the xmcd standard +(one subdirectory level for the categories, individual files for every disc). +The settings for remote CDDB lookups can be found in the setup menu, too. Any +information retrieved from a remote host is stored to your local CDDB database, +so the user running VDR needs write access to this directory. + +If you are using any of the networking capabilities and you have a dial-up +network, you can use the commandline option -n/--network to give a script name. +This script is called before and after any network access and receives one +option on commandline. This can either be "up" or "down", depending on if it's +before or after the network access. In the "up" case the script should not +return before the network is connected and useable. By default the plugin +assumes that network access can be done at any time without prior action. + +If you want to use the OSS output capability but your soundcard device is not +"/dev/dsp" (which is the default) you can use the commandline option -D/--dsp +to give an alternative soundcard device. + +If you want to use the cover image display, you have to provide an image +converting script. Usually your covers are in a common image format like e.g. +JPEG or PNG, but the MP3 plugin can only display MPEG (still) frames. The +conversion is done by the script, which takes two arguments: first the filename +of the image file and second the filename or the resulting MPEG file. The +script also has to take care that any needed subdirectories in the cache are +created e.g. mkdir -p. You will find an example script in the examples +subdirectory. By default the script is called "image_convert.sh", but you can +use the commandline option -i/--iconv to change the name and location of the +script. +To speed up consecutive accesses to the same image, the converted frames are +cached on disk. The default cache directory is "/var/cache/images/mp3". You can +change this location with the commandline option -c/--icache. +Don't forget to enable the image display in the plugin setup menu. +The search order for images is: +- An image in the same directory as the song, named like the song but with the + song extension replaced with the image format extension + e.g. test.mp3 -> test.jpg +- An image named "cover" with the image format extension in the same directory + as the song (album cover). + e.g. cover.gif +- An image named "artist" with the image format extension in the parent + directory of the song (artist image). + e.g. artist.png +- An image named "background" with the image format extension in the base + directory of the MP3 source. +For all locations the extensions "jpg", "png" & "gif" are checked (in that +order). If no image can be found, a full screen black image is displayed (this +is included statically in the plugin). + +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 +location of the mplayer script. The script has to call MPlayer with all the +necessary options. + +The script should parse the SLAVE keyword too and give appropriate options to +MPlayer. To enable slave mode you must give at least the "-slave" option, while +I suggest "-slave -nolirc -quiet". + +You can use the mplayer.sh.example file, which comes with the archive, as a +starting point. Juri Haberland maintains a full featured mplayer.sh file which +is available at <http://batleth.sapienti-sat.org/projects/VDR/>. + +Summary of commandline options: +------------------------------- + +MP3 Plugin: +-m CMD, --mount=CMD use CMD to mount/unmount/eject mp3 sources +-n CMD, --network=CMD execute CMD before & after network access +-B DIR, --cddb=DIR search CDDB files in DIR +-C DIR, --cache=DIR store ID3 cache file in DIR +-D DIR, --dsp=DIR device for OSS output +-i CMD, --iconv=CMD use CMD to convert background images +-c DIR, --icache=DIR cache converted images in DIR + +MPlayer plugin: +-m CMD, --mount=CMD use CMD to mount/unmount/eject mplayer sources +-M CMD, --mplayer=CMD use CMD when calling MPlayer diff --git a/plugins/mp3/examples/image_convert.sh.example b/plugins/mp3/examples/image_convert.sh.example new file mode 100644 index 0000000..1fbe153 --- /dev/null +++ b/plugins/mp3/examples/image_convert.sh.example @@ -0,0 +1,80 @@ +#!/bin/bash +# +# requires: ...topnm, pnmscale, pnmcomp, ppmntsc, ppmtoy4m, mpeg2enc +# + +# video format. pal or ntsc +FORMAT=pal + +# target image width/height (taking into account visible screen area) +if [ "$FORMAT" = "ntsc" ]; then + TW=600 + TH=420 +else + TW=632 + TH=512 +fi + +TMP=/tmp/image_convert.$$.pnm +IMG=$1 +MPG=$2 + +DIR=`dirname "$MPG"` +if [ ! -d "$DIR" ]; then + mkdir -p "$DIR" +fi +# +# get the file type and set the according converter to PNM +# +FILE_TYPE=`file -i -L -b "$IMG" 2>/dev/null | cut -f2 -d/` +case "$FILE_TYPE" in + jpg | jpeg) + TO_PNM=jpegtopnm + ;; + tiff) + TO_PNM=tifftopnm + ;; + bmp | x-bmp) + TO_PNM=bmptoppm + ;; + png | x-png) + TO_PNM=pngtopnm + ;; + Netpbm | pnm | x-portable-pixmap) + TO_PNM=cat + ;; + gif) + TO_PNM=giftopnm + ;; + *) + echo "filetype '$FILE_TYPE' is not supported" + exit 1 + ;; +esac +# +# extract the image size & compute scale value +# +LANG=C # get the decimal point right +$TO_PNM "$IMG" >$TMP 2>/dev/null +S=`pnmfile $TMP | awk '{ printf "%d %d ",$4,$6 }'` +S=`echo $S $TW $TH | awk '{ sw=$3/$1; sh=$4/$2; s=(sw<sh)?sw:sh; printf "%.4f\n",(s>1)?1.0:s; }'` +# +# now run the conversion +# +if [ "$FORMAT" = "ntsc" ]; then + pnmscale $S $TMP | \ + pnmpad -black -width 704 -height 480 | \ + ppmntsc | \ + ppmtoy4m -v 0 -n 1 -r -F 30000:1001 | \ + mpeg2enc -f 7 -T 90 -F 4 -nn -a 2 -v 0 -o "$MPG" +else + pnmscale $S $TMP | \ + pnmpad -black -width 704 -height 576 | \ + ppmntsc --pal | \ + ppmtoy4m -v 0 -n 1 -r -F 25:1 | \ + mpeg2enc -f 7 -T 90 -F 3 -np -a 2 -v 0 -o "$MPG" +fi +# +# cleanup +# +rm $TMP diff --git a/plugins/mp3/examples/mount.sh.example b/plugins/mp3/examples/mount.sh.example new file mode 100644 index 0000000..b692143 --- /dev/null +++ b/plugins/mp3/examples/mount.sh.example @@ -0,0 +1,34 @@ +#!/bin/bash +# +# This script is called from VDR to mount/unmount/eject +# the sources for MP3 play. +# +# argument 1: wanted action, one of mount,unmount,eject,status +# argument 2: mountpoint to act on +# +# mount,unmount,eject must return 0 if succeeded, 1 if failed +# status must return 0 if device is mounted, 1 if not +# + +action="$1" +path="$2" + +case "$action" in +mount) + eject -t "$path" || exit 1 # close the tray + mount "$path" || exit 1 # mount it + ;; +unmount) + umount "$path" || exit 1 # unmount it + ;; +eject) + eject "$path" || exit 1 # eject disk + ;; +status) + cat /proc/mounts | grep -q "$path" # check if mounted + if [ $? -ne 0 ]; then # not mounted ... + exit 1 + fi +esac + +exit 0 diff --git a/plugins/mp3/examples/mp3sources.conf.example b/plugins/mp3/examples/mp3sources.conf.example new file mode 100644 index 0000000..c577a2c --- /dev/null +++ b/plugins/mp3/examples/mp3sources.conf.example @@ -0,0 +1,4 @@ +/mp3;Locale Platte;0;*.mp3/*.ogg/*.wav +/mnt/nfs/mp3;Remote NFS;0 +/mnt/cdrom;CDROM;1 +/mnt/cdfs;CD-Audio;1;*.wav diff --git a/plugins/mp3/examples/mplayer.sh.example b/plugins/mp3/examples/mplayer.sh.example new file mode 100644 index 0000000..a3011eb --- /dev/null +++ b/plugins/mp3/examples/mplayer.sh.example @@ -0,0 +1,48 @@ +#!/bin/bash +# +# This script is called from VDR to start MPlayer +# +# argument 1: the file to play +# argument 2: (optional) the phrase SLAVE if SlaveMode is enabled +# argument 3: (optional) the phrase AID x to select audio stream x + +# where to find mplayer +MPLAYER="mplayer" + +# mplayer options, -vc will be added below +# add "-lircconf <lircrc>" to enable LIRC support +OPTS="-vo mpegpes" + +# mplayer options for SlaveMode +SLAVE="-slave -quiet -nolirc" + +##################### + +FILE=$1 +type=`file "$FILE"` + +while shift; do + if [ "$1" = "SLAVE" ]; then + sopt=$SLAVE + elif [ "$1" = "AID" ]; then + aopt="-aid $2" + shift + fi +done + +case "$type" in +*AVI*) + VC="ffdivx" + ;; +*MPEG*) + VC="mpegpes" + ;; +*) + echo "Unknown video file format $type" + echo "Edit mplayer.sh to support this file type" + exit 1 + ;; +esac + +exec $MPLAYER $OPTS -vc $VC $sopt $aopt "$FILE" + diff --git a/plugins/mp3/examples/network.sh.example b/plugins/mp3/examples/network.sh.example new file mode 100644 index 0000000..418ac65 --- /dev/null +++ b/plugins/mp3/examples/network.sh.example @@ -0,0 +1,19 @@ +#!/bin/bash +# +# This script is called from VDR before & after network access +# +# argument 1: wanted action, one of up,down +# + +action="$1" + +case "$action" in +up) + echo "starting dialin" + ;; +down) + echo "hangup" + ;; +esac + +exit 0 diff --git a/plugins/mp3/patches/mp3-0.9.15-span-0.0.4.diff b/plugins/mp3/patches/mp3-0.9.15-span-0.0.4.diff new file mode 100644 index 0000000..6b20fe0 --- /dev/null +++ b/plugins/mp3/patches/mp3-0.9.15-span-0.0.4.diff @@ -0,0 +1,145 @@ +diff -Naur mp3-0.9.15/mp3.c mp3-0.9.15-span/mp3.c +--- mp3-0.9.15/mp3.c 2006-08-30 17:39:24.000000000 +0200 ++++ mp3-0.9.15-span/mp3.c 2006-09-27 14:05:13.000000000 +0200 +@@ -1786,6 +1786,12 @@ + } + return true; + } ++ else if (strcmp(Id, SPAN_PROVIDER_CHECK_ID) == 0) { ++ if(Data) { ++ *((Span_Provider_Check_1_0*)Data)->isActive = true; ++ } ++ return true; ++ } + return false; + } + +diff -Naur mp3-0.9.15/player-mp3.c mp3-0.9.15-span/player-mp3.c +--- mp3-0.9.15/player-mp3.c 2006-07-30 19:59:31.000000000 +0200 ++++ mp3-0.9.15-span/player-mp3.c 2006-09-27 14:21:42.000000000 +0200 +@@ -34,6 +34,7 @@ + #include <vdr/ringbuffer.h> + #include <vdr/thread.h> + #include <vdr/tools.h> ++#include <vdr/plugin.h> + + #include "common.h" + #include "setup-mp3.h" +@@ -1304,6 +1305,23 @@ + outlen+=(sizeof(header)-6); + buff[4+FHS]=outlen>>8; + buff[5+FHS]=outlen; ++ ++// Spectrum Analyzer: Hand over the PCM16-data to SpAn ++ int offset = sizeof(header)+FHS; ++ Span_SetPcmData_1_0 SetPcmData; ++ cPlugin *Plugin = cPluginManager::CallFirstService(SPAN_SET_PCM_DATA_ID, NULL); ++ if (Plugin) ++ { ++ SetPcmData.length = (unsigned int)(outlen-offset); ++// the timestamp (ms) of the frame(s) to be visualized: ++ SetPcmData.index = index; ++// tell SpAn the ringbuffer's size for it's internal bookkeeping of the data to be visualized: ++ SetPcmData.bufferSize = MP3BUFSIZE; ++ SetPcmData.data = buff + offset + 1; // get rid of the header ++ SetPcmData.bigEndian = true; ++ cPluginManager::CallFirstService(SPAN_SET_PCM_DATA_ID, &SetPcmData); ++ } ++ + f=new cFrame(buff,-(outlen+6+FHS),ftUnknown,index); + } + if(!f) free(buff); +@@ -1469,8 +1487,25 @@ + fh->samplerate=sr; + cFrame *f=0; + unsigned int outlen=scale.ScaleBlock(buff+FHS,sizeof(buff)-FHS,Samples,Data[0],Data[1],MP3Setup.AudioMode?amDitherLE:amRoundLE); +- if(outlen) ++ if(outlen) ++ { ++// Spectrum Analyzer: Hand over the PCM16-data to SpAn ++ int offset = FHS; ++ Span_SetPcmData_1_0 SetPcmData; ++ cPlugin *Plugin = cPluginManager::CallFirstService(SPAN_SET_PCM_DATA_ID, NULL); ++ if (Plugin) ++ { ++ SetPcmData.length = (unsigned int)(outlen-offset); ++// the timestamp (ms) of the frame(s) to be visualized: ++ SetPcmData.index = index; ++// tell SpAn the ringbuffer's size for it's internal bookkeeping of the data to be visualized: ++ SetPcmData.bufferSize = MP3BUFSIZE; ++ SetPcmData.data = buff + offset + 1; // get rid of the header ++ SetPcmData.bigEndian = false; ++ cPluginManager::CallFirstService(SPAN_SET_PCM_DATA_ID, &SetPcmData); ++ } + f=new cFrame(buff,outlen+FHS,ftUnknown,index); ++ } + return f; + } + +@@ -1592,6 +1627,7 @@ + #ifdef DEBUG_DELAY + int lastwrite=0; + #endif ++ bool frameIncomplete = true; + + dsyslog("mp3: player thread started (pid=%d)", getpid()); + state=msStop; +@@ -1658,10 +1694,23 @@ + #endif + int w=output->Output(p,pc,SOF); + if(w>0) { ++// Spectrum Analyzer: Tell SpAn which timestamp is currently playing ++ if ( frameIncomplete ) ++ { ++ Span_SetPlayindex_1_0 SetPlayindexData; ++ cPlugin *Plugin = cPluginManager::CallFirstService(SPAN_SET_PLAYINDEX_ID, NULL); ++ if (Plugin) ++ { ++ SetPlayindexData.index = playindex; ++ cPluginManager::CallFirstService(SPAN_SET_PLAYINDEX_ID, &SetPlayindexData); ++ } ++ frameIncomplete = false; ++ } + p+=w; pc-=w; + if(pc<=0) { + ringBuffer->Drop(pframe); + pframe=0; ++ frameIncomplete = true; + goto next; + } + } +diff -Naur mp3-0.9.15/player-mp3.h mp3-0.9.15-span/player-mp3.h +--- mp3-0.9.15/player-mp3.h 2006-07-30 19:59:20.000000000 +0200 ++++ mp3-0.9.15-span/player-mp3.h 2006-09-27 14:13:31.000000000 +0200 +@@ -27,6 +27,31 @@ + + // ------------------------------------------------------------------- + ++#define SPAN_PROVIDER_CHECK_ID "Span-ProviderCheck-v1.0" ++#define SPAN_SET_PCM_DATA_ID "Span-SetPcmData-v1.1" ++#define SPAN_SET_PLAYINDEX_ID "Span-SetPlayindex-v1.0" ++ ++//Span requests to collect possible providers / clients ++struct Span_Provider_Check_1_0 { ++ bool *isActive; ++ bool *isRunning; ++}; ++ ++// SpanData ++struct Span_SetPcmData_1_0 { ++ unsigned int length; // the length of the PCM-data ++ const unsigned char *data; // the PCM-Data ++ int index; // the timestamp (ms) of the frame(s) to be visualized ++ unsigned int bufferSize; // for span-internal bookkeeping of the data to be visualized ++ bool bigEndian; // are the pcm16-data coded bigEndian? ++}; ++ ++struct Span_SetPlayindex_1_0 { ++ int index; // the timestamp (ms) of the frame(s) being currently played ++}; ++ ++// ------------------------------------------------------------------- ++ + class cRingBufferFrame; + class cFrame; + diff --git a/plugins/mp3/patches/mp3-with_oss.diff b/plugins/mp3/patches/mp3-with_oss.diff new file mode 100644 index 0000000..b54b435 --- /dev/null +++ b/plugins/mp3/patches/mp3-with_oss.diff @@ -0,0 +1,11 @@ +--- Makefile.ORG ++++ Makefile +@@ -32,7 +32,7 @@ + #WITHOUT_LIBVORBISFILE=1 + + ### uncomment the following line, if you want OSS sound output +-#WITH_OSS_OUTPUT=1 ++WITH_OSS_OUTPUT=1 + + ### uncomment the following line, if you want to include debug symbols + #DBG=1 diff --git a/plugins/mp3/plugin.sh b/plugins/mp3/plugin.sh new file mode 100644 index 0000000..2d94e8a --- /dev/null +++ b/plugins/mp3/plugin.sh @@ -0,0 +1,90 @@ +#!/bin/sh + +# x-vdr (Installations-Skript fuer einen VDR mit Debian als Basis) +# von Marc Wernecke - www.zulu-entertainment.de +# 29.05.2008 +# +# vdr-mp3 + +# defaults +source ./../../x-vdr.conf +source ./../../setup.conf +source ./../../functions +WEB="http://www.muempf.de/down/vdr-mp3-0.10.1.tar.gz" +VERSION="mp3-0.10.1" +LINK="mp3" + +VAR=`basename $WEB` +DIR=`pwd` + +# plugin entfernen +function clean_plugin() { + cd $SOURCEDIR/VDR/PLUGINS/src + rm -rf $LINK + rm -rf $VERSION + rm -f $VDRLIBDIR/libvdr-$LINK.so* + rm -f $VDRLIBDIR/libvdr-mplayer.so* + log "cleaning $LINK" +} + +# plugin installieren +function install_plugin() { + download_plugin + extract_plugin + cd $SOURCEDIR/VDR/PLUGINS/src + rm -f $LINK + ln -vfs $VERSION $LINK + patch_plugin + + ## plugin specials - start ## + + # mp3sources.conf + if [ -f $DIR/mp3sources.conf ]; then + cp -f $DIR/mp3sources.conf $VDRCONFDIR/plugins + else + { + echo "$MUSICDIR;Locale Platte;0;*.mp3/*.ogg/*.wav" + echo "/media/usb;USB-Stick;1;*.mp3/*.ogg/*.wav" + echo "/media/cdrom;CDROM;1;*.mp3/*.ogg/*.wav" + echo "/media/cdfs;CD-Audio;1;*.wav" + echo "" + } > $VDRCONFDIR/plugins/mp3sources.conf + fi + chown $VDRUSER:$VDRGROUP $VDRCONFDIR/plugins/mp3sources.conf + + # mplayersources.conf + if [ -f $DIR/mplayersources.conf ]; then + cp -f $DIR/mplayersources.conf $VDRCONFDIR/plugins + else + { + echo "$DIVXDIR;DivX Filme;0;*.avi" + echo "$DVDISODIR;DVD Filme;0;*.iso" + echo "$VIDEODIR;Aufnahmen;0;*0*.vdr" + echo "$MEDIADIR/DVD-VCD;DVD or VCD;0" + [ "$vodcatcher" = "on" ] && echo "/tmp;Vodcatcher;0" + echo "/media/usb;USB-Stick;1" + echo "" + } > $VDRCONFDIR/plugins/mplayersources.conf + fi + chown $VDRUSER:$VDRGROUP $VDRCONFDIR/plugins/mplayersources.conf + + # mplayer + if [ -f $SOURCEDIR/x-vdr/utilities/mplayer/mplayer.sh ]; then + cp -f $SOURCEDIR/x-vdr/utilities/mplayer/mplayer.sh $VDRSCRIPTDIR + cp -f $SOURCEDIR/x-vdr/utilities/mplayer/mplayer.sh.conf $VDRSCRIPTDIR + chown $VDRUSER:$VDRGROUP $VDRSCRIPTDIR/mplayer.sh $VDRSCRIPTDIR/mplayer.sh.conf + chmod 0744 $VDRSCRIPTDIR/mplayer.sh + fi + ## plugin specials - ende ## +} + +# plugin commands +if [ $# \> 0 ]; then + cmd=$1 + cmd_plugin +else + install_plugin + log "install-plugin fuer $VERSION ist fertig" +fi + +exit 0 diff --git a/plugins/mp3/tracklist-fix.diff b/plugins/mp3/tracklist-fix.diff new file mode 100644 index 0000000..27af1cb --- /dev/null +++ b/plugins/mp3/tracklist-fix.diff @@ -0,0 +1,33 @@ +diff -ruN mp3/mp3.c mp3/mp3.c +--- mp3/mp3.c ++++ mp3/mp3.c +@@ -780,16 +780,15 @@ + case kNext: + case kNext|k_Repeat: + #endif +- mgr->Next(); player->Play(); ++ if(!mgr->Eol() && mgr->Next()) player->Play(); + break; + case kDown: + case kDown|k_Repeat: + #if APIVERSNUM >= 10347 + case kPrev: + case kPrev|k_Repeat: + #endif +- if(!player->PrevCheck()) mgr->Prev(); +- player->Play(); ++ if(mgr->Prev()) player->Play(); + break; + case kLeft: + case kLeft|k_Repeat: +diff -ruN mp3/player-mp3.h mp3/player-mp3.h +--- mp3/player-mp3.h ++++ mp3/player-mp3.h +@@ -118,6 +118,7 @@ + bool NextCurrent(void); + void Release(void); + void Throttle(bool thr); ++ bool Eol(void) { return eol; } + }; + + extern cPlayManager *mgr; |
