summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorworo <woro@e10066b5-e1e2-0310-b819-94efdf66514b>2008-04-22 06:39:13 +0000
committerworo <woro@e10066b5-e1e2-0310-b819-94efdf66514b>2008-04-22 06:39:13 +0000
commit7270e75552318e948eca64b591a21ef8a70430ec (patch)
treebcf728c17de9ed7757edfc2a8ffbc2c1fbe0a658
parente14cfef65a02ad61c5292f0acc24513bb43cde07 (diff)
downloadvdr-plugin-muggle-7270e75552318e948eca64b591a21ef8a70430ec.tar.gz
vdr-plugin-muggle-7270e75552318e948eca64b591a21ef8a70430ec.tar.bz2
get lyrics with vdr before 1.5.4: also in the background by using system() instead of SystemExec()
git-svn-id: https://vdr-muggle.svn.sourceforge.net/svnroot/vdr-muggle/trunk/muggle-plugin@1204 e10066b5-e1e2-0310-b819-94efdf66514b
-rw-r--r--lyrics.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/lyrics.c b/lyrics.c
index d33ce82..76c1278 100644
--- a/lyrics.c
+++ b/lyrics.c
@@ -15,15 +15,21 @@ int mgLyrics::RunCommand(const string cmd) {
int res=-1;
if (access(cmd.c_str(),R_OK|X_OK)) return res;
char *tmp;
- msprintf(&tmp,"%s \"%s\" \"%s\" \"%s\"",cmd.c_str(),
+#if VDRVERSNUM < 10504
+ const char *backgr="&";
+#else
+ const char *backgr="";
+#endif
+ msprintf(&tmp,"%s \"%s\" \"%s\" \"%s\" %s",cmd.c_str(),
playItem->getArtist().c_str(),
playItem->getTitle().c_str(),
- playItem->getCachedFilename("lyrics.tmp").c_str());
+ playItem->getCachedFilename("lyrics.tmp").c_str(),
+ backgr);
mgDebug(1,"muggle[%d]: lyrics: executing '%s'\n",getpid (), tmp);
#if VDRVERSNUM >= 10504
res=SystemExec(tmp,true); // run detached
#else
- res=SystemExec(tmp);
+ res=system(tmp); // SystemExec cannot yet run detached
#endif
free(tmp);
return res;