Thread: [Mplayerplug-in-cvs] mplayerplug-in/Source plugin-list.cpp,1.40,1.41 plugin-setup.h,1.34,1.35 plugin
Brought to you by:
kdekorte
From: Kevin D. <kde...@us...> - 2004-09-04 16:42:27
|
Update of /cvsroot/mplayerplug-in/mplayerplug-in/Source In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5290/Source Modified Files: plugin-list.cpp plugin-setup.h plugin-support.cpp plugin.cpp Log Message: Fix bug in URLcmp Index: plugin-support.cpp =================================================================== RCS file: /cvsroot/mplayerplug-in/mplayerplug-in/Source/plugin-support.cpp,v retrieving revision 1.46 retrieving revision 1.47 diff -C2 -d -r1.46 -r1.47 *** plugin-support.cpp 13 Aug 2004 18:51:52 -0000 1.46 --- plugin-support.cpp 4 Sep 2004 16:42:17 -0000 1.47 *************** *** 80,84 **** } hostname[i] = '\0'; ! if (DEBUG) printf("exiting getURLHostname with %s\n", hostname); --- 80,84 ---- } hostname[i] = '\0'; ! if (DEBUG > 1) printf("exiting getURLHostname with %s\n", hostname); *************** *** 193,196 **** --- 193,198 ---- char *q1; // question mark in tmp char *q2; // question mark in tmp2 + char *hostname1; // hostname1 + char *hostname2; // hostname2 int ret; *************** *** 233,283 **** } if (ret == -1) { ! // compare the paths, some sites change the hostname mid stream (like cartoonnetwork.com -> www.cartoonnetwork.com); ! tmp1 = strstr(buffer1, "://"); ! if (tmp1 != NULL) { ! tmp1 = tmp1 + 3; ! while (tmp1[0] != '/') { ! if (tmp1[0] == '\0') ! break; ! tmp1++; } ! } ! tmp2 = strstr(buffer2, "://"); ! if (tmp2 != NULL) { ! tmp2 = tmp2 + 3; ! while (tmp2[0] != '/') { ! if (tmp2[0] == '\0') ! break; ! tmp2++; } ! } ! if (tmp1 != NULL && tmp2 != NULL) { ! if (strcmp(tmp1, tmp2) == 0) { ! ret = 0; ! } else { ! ret = -1; ! q1 = strchr(tmp1, '?'); ! q2 = strchr(tmp2, '?'); ! if (q1 != NULL || q2 != NULL) { ! if (q1 != NULL) ! q1[0] = '\0'; ! if (q2 != NULL) ! q2[0] = '\0'; ! if (strcmp(tmp1, tmp2) == 0) { ! ret = 0; ! } else { ! ret = -1; } } } } ! free(buffer1); free(buffer2); - return ret; - } else { - return ret; } } --- 235,297 ---- } + if (ret == -1) { ! hostname1 = getURLHostname(buffer1); ! hostname2 = getURLHostname(buffer2); ! ! if (strstr(hostname2, hostname1) == NULL) { ! // hostname1 is a not substring of hostname2 ! ret = -1; ! } else { ! // url1 is a substring of url2, so continue comparing ! ! // compare the paths, some sites change the hostname mid stream (like cartoonnetwork.com -> www.cartoonnetwork.com); ! tmp1 = strstr(buffer1, "://"); ! if (tmp1 != NULL) { ! tmp1 = tmp1 + 3; ! while (tmp1[0] != '/') { ! if (tmp1[0] == '\0') ! break; ! tmp1++; ! } } ! tmp2 = strstr(buffer2, "://"); ! if (tmp2 != NULL) { ! tmp2 = tmp2 + 3; ! while (tmp2[0] != '/') { ! if (tmp2[0] == '\0') ! break; ! tmp2++; ! } } ! if (tmp1 != NULL && tmp2 != NULL) { ! if (strcmp(tmp1, tmp2) == 0) { ! ret = 0; ! } else { ! ret = -1; ! q1 = strchr(tmp1, '?'); ! q2 = strchr(tmp2, '?'); ! if (q1 != NULL || q2 != NULL) { ! if (q1 != NULL) ! q1[0] = '\0'; ! if (q2 != NULL) ! q2[0] = '\0'; ! if (strcmp(tmp1, tmp2) == 0) { ! ret = 0; ! } else { ! ret = -1; ! } } } } } ! NPN_MemFree(hostname1); ! NPN_MemFree(hostname2); free(buffer1); free(buffer2); } + + return ret; + } *************** *** 427,431 **** } } - //wait(&status); } --- 441,444 ---- Index: plugin-list.cpp =================================================================== RCS file: /cvsroot/mplayerplug-in/mplayerplug-in/Source/plugin-list.cpp,v retrieving revision 1.40 retrieving revision 1.41 diff -C2 -d -r1.40 -r1.41 *** plugin-list.cpp 31 Aug 2004 17:29:53 -0000 1.40 --- plugin-list.cpp 4 Sep 2004 16:42:16 -0000 1.41 *************** *** 234,238 **** if (URLcmp(n->url, localitem) == 0) { if (DEBUG) ! printf("found duplicate entry\n%s\n", n->url); break; } --- 234,238 ---- if (URLcmp(n->url, localitem) == 0) { if (DEBUG) ! printf("found duplicate entry\n%s\n", n->url); break; } *************** *** 629,634 **** if (DEBUG) printf("URL: %s\n", url); - parent->playlist = 1; addToList(instance, url, parent, -1); if (parent->mmsstream == 1 && parent->next == NULL) --- 629,634 ---- if (DEBUG) printf("URL: %s\n", url); addToList(instance, url, parent, -1); + parent->playlist = 1; if (parent->mmsstream == 1 && parent->next == NULL) Index: plugin-setup.h =================================================================== RCS file: /cvsroot/mplayerplug-in/mplayerplug-in/Source/plugin-setup.h,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** plugin-setup.h 13 Jul 2004 14:09:47 -0000 1.34 --- plugin-setup.h 4 Sep 2004 16:42:17 -0000 1.35 *************** *** 24,28 **** #include <X11/X.h> #include <X11/Xmd.h> ! extern "C" Bool DPMSQueryExtension(Display *, int *, int *); extern "C" Bool DPMSCapable(Display *); --- 24,28 ---- #include <X11/X.h> #include <X11/Xmd.h> ! //#include <X11/extensions/dpms.h> extern "C" Bool DPMSQueryExtension(Display *, int *, int *); extern "C" Bool DPMSCapable(Display *); Index: plugin.cpp =================================================================== RCS file: /cvsroot/mplayerplug-in/mplayerplug-in/Source/plugin.cpp,v retrieving revision 1.126 retrieving revision 1.127 diff -C2 -d -r1.126 -r1.127 *** plugin.cpp 29 Aug 2004 15:22:17 -0000 1.126 --- plugin.cpp 4 Sep 2004 16:42:17 -0000 1.127 *************** *** 1296,1302 **** } if (status != NULL) { ! gtk_label_set_text(status, message); ! gtk_widget_show(GTK_WIDGET(status)); ! gtk_widget_queue_draw(GTK_WIDGET(status)); } #endif --- 1296,1304 ---- } if (status != NULL) { ! if (state < STATE_PLAYING) { ! gtk_label_set_text(status, message); ! gtk_widget_show(GTK_WIDGET(status)); ! gtk_widget_queue_draw(GTK_WIDGET(status)); ! } } #endif |