[Mplayer-cvslog] CVS: main playtreeparser.c,1.26,1.27

Roberto Togni CVS syncmail at mplayerhq.hu
Mon Apr 26 21:33:39 CEST 2004


CVS change done by Roberto Togni CVS

Update of /cvsroot/mplayer/main
In directory mail:/var2/tmp/cvs-serv23534

Modified Files:
	playtreeparser.c 
Log Message:
Fix embedded smil playlist detection if there are parameters on the url


Index: playtreeparser.c
===================================================================
RCS file: /cvsroot/mplayer/main/playtreeparser.c,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -r1.26 -r1.27
--- playtreeparser.c	17 Apr 2004 16:46:39 -0000	1.26
+++ playtreeparser.c	26 Apr 2004 19:33:37 -0000	1.27
@@ -11,6 +11,7 @@
 #include <sys/stat.h>
 #include <fcntl.h>
 #include <unistd.h>
+#include <ctype.h>
 #include "m_config.h"
 #include "playtree.h"
 #include "playtreeparser.h"
@@ -545,7 +546,8 @@
 play_tree_t*
 parse_textplain(play_tree_parser_t* p) {
   char* line;
-  int reflen;
+  char *c;
+  int embedded;
   play_tree_t *list = NULL, *entry = NULL, *last_entry = NULL;
 
   mp_msg(MSGT_PLAYTREE,MSGL_V,"Trying plaintext playlist...\n");
@@ -556,11 +558,19 @@
     if(line[0] == '\0')
       continue;
 
-    //Special check for smil refernce in file
-    reflen=strlen(line);
-    if ( (reflen>5) && (strncasecmp(line+(reflen-5),".smil",5)==0) ) { //embedded playlist link
-      entry=embedded_playlist_parse(line);
-    } else {      //regular file link
+    //Special check for smil reference in file
+    embedded = 0;
+    if (strlen(line) > 5)
+      for(c = line; c[0]; c++ )
+        if((c[0] == '.') && (tolower(c[1]) == 's') && (tolower(c[2])== 'm') && 
+           (tolower(c[3]) == 'i') && (tolower(c[4]) == 'l') &&
+           (!c[5] || c[5] == '?' || c[5] == '&')) {
+          entry=embedded_playlist_parse(line);
+          embedded = 1;
+          break;
+        }
+
+    if (!embedded) {      //regular file link
       entry = play_tree_new();
       play_tree_add_file(entry,line);
     }




More information about the MPlayer-cvslog mailing list