Mailing List archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[vdr] 1.3.17. Poisoned plugins



Andrey Kuzmin wrote:
I've tried cumulative patch posted by CYM. Dxr3 works now as in
1.3.16, thanks a lot! Nice work!

There are 3 plugins in my configuration that are poisoned now:

It will be nice if someone could make a patch for mp3 plugin, others
are not so critical :)



Here you go.. also search back up the list under the thread "Complete all-in-one patch...".


diff -ruN mp3-0.9.8-orig/decoder.c mp3-0.9.8/decoder.c
--- mp3-0.9.8-orig/decoder.c	2004-12-04 16:19:01.000000000 -0800
+++ mp3-0.9.8/decoder.c	2004-12-04 17:20:39.000000000 -0800
@@ -410,8 +410,9 @@
   cFileInfo::Clear();
   cSongInfo::Clear();
   while(fgets(buf,sizeof(buf),f)) {
-    char *name =strtok(buf ,delimiters);
-    char *value=strtok(0,delimiters);
+    char * lasts=NULL;
+    char *name =strtok_r(buf ,delimiters, &lasts);
+    char *value=strtok_r(0,delimiters, &lasts);
     if(name) {
       if(!strcasecmp(name,"##END")) break;
       if(value) {
diff -ruN mp3-0.9.8-orig/player-mp3.c mp3-0.9.8/player-mp3.c
--- mp3-0.9.8-orig/player-mp3.c	2004-12-04 16:14:31.000000000 -0800
+++ mp3-0.9.8/player-mp3.c	2004-12-04 17:29:43.000000000 -0800
@@ -717,7 +717,8 @@
   int in=Index(curr)+1; if(in<0) in=0;
   if((max-in)>=2) {
     for(int i=in ; i<max ; i++) {
-      int ran=(rand() % ((max-in)*4-4))/4; ran+=((ran+in) >= i);
+      unsigned int seedp;
+      int ran=(rand_r(&seedp) % ((max-in)*4-4))/4; ran+=((ran+in) >= i);
       int t=shuffle[i];
       shuffle[i]=shuffle[ran+in];
       shuffle[ran+in]=t;
--- loader.c.orig	2004-12-04 15:42:24.000000000 -0800
+++ loader.c	2004-12-04 16:03:48.000000000 -0800
@@ -2,6 +2,7 @@
  * $Id: loader.c,v 1.12 2004/06/22 16:48:03 lordjaxom Exp $
  */
 
+#include <dirent.h>
 #include "loader.h"
 #include "data.h"
 #include "i18n.h"
@@ -10,13 +11,12 @@
 #include "text2skin.h"
 #include <vdr/plugin.h>
 #include <sys/types.h>
-#include <dirent.h>
 
 void cText2SkinLoader::Start(void) {
 	DIR *d = opendir(SkinPath());
 	if (d) {
-		struct dirent *ent;
-		while ((ent = readdir(d)) != NULL) {
+		struct dirent *ent, path;
+		while (!readdir_r(d, &path, &ent) && ent != NULL) {
 			char *path;
 			struct stat buf;
 			if (strcmp(ent->d_name, ".") == 0 || strcmp(ent->d_name, "..") == 0)

Home | Main Index | Thread Index