Update of /cvsroot/mplayerplug-in/mplayerplug-in/Source
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8316/Source
Modified Files:
plugin-list.cpp plugin-support.cpp plugin-ui.cpp plugin.cpp
plugin.h
Log Message:
Fix up some issues with user-agent
Index: plugin-ui.cpp
===================================================================
RCS file: /cvsroot/mplayerplug-in/mplayerplug-in/Source/plugin-ui.cpp,v
retrieving revision 1.112
retrieving revision 1.113
diff -C2 -d -r1.112 -r1.113
*** plugin-ui.cpp 30 Jan 2005 22:02:25 -0000 1.112
--- plugin-ui.cpp 19 Mar 2005 15:31:11 -0000 1.113
***************
*** 511,515 ****
if (instance->drawing_area != NULL)
gtk_widget_show(GTK_WIDGET(instance->drawing_area));
!
gdk_flush();
}
--- 511,515 ----
if (instance->drawing_area != NULL)
gtk_widget_show(GTK_WIDGET(instance->drawing_area));
!
gdk_flush();
}
Index: plugin-support.cpp
===================================================================
RCS file: /cvsroot/mplayerplug-in/mplayerplug-in/Source/plugin-support.cpp,v
retrieving revision 1.64
retrieving revision 1.65
diff -C2 -d -r1.64 -r1.65
*** plugin-support.cpp 17 Feb 2005 01:18:38 -0000 1.64
--- plugin-support.cpp 19 Mar 2005 15:31:11 -0000 1.65
***************
*** 240,244 ****
}
-
if (ret == -1) {
hostname1 = getURLHostname(buffer1);
--- 240,243 ----
***************
*** 248,252 ****
&& strstr(hostname2, hostname1) == NULL) {
// hostname1 is a not substring of hostname2
! if (DEBUG)
printf("URLcmp: hostnames do not match\n");
ret = -1;
--- 247,251 ----
&& strstr(hostname2, hostname1) == NULL) {
// hostname1 is a not substring of hostname2
! if (DEBUG > 1)
printf("URLcmp: hostnames do not match\n");
ret = -1;
***************
*** 290,297 ****
}
if (strcmp(tmp1, tmp2) == 0) {
! if (tmp1hasq != tmp2hasq)
ret = -1;
! else
! ret = 0;
} else {
ret = -1;
--- 289,321 ----
}
if (strcmp(tmp1, tmp2) == 0) {
! if (tmp1hasq != tmp2hasq) {
ret = -1;
! } else {
! // try with &s instead of ?s
! ret = -1;
! q1 = strchr(tmp1, '&');
! q2 = strchr(tmp2, '&');
! if (q1 != NULL || q2 != NULL) {
! if (q1 != NULL) {
! q1[0] = '\0';
! tmp1hasq = 1;
! }
! if (q2 != NULL) {
! q2[0] = '\0';
! tmp2hasq = 1;
! }
! if (strcmp(tmp1, tmp2) == 0) {
! if (tmp1hasq != tmp2hasq) {
! ret = -1;
! } else {
! ret = 0;
! }
! } else {
! ret = -1;
! }
! } else {
! ret = 0;
! }
! }
} else {
ret = -1;
Index: plugin.h
===================================================================
RCS file: /cvsroot/mplayerplug-in/mplayerplug-in/Source/plugin.h,v
retrieving revision 1.61
retrieving revision 1.62
diff -C2 -d -r1.61 -r1.62
*** plugin.h 27 Jan 2005 00:58:34 -0000 1.61
--- plugin.h 19 Mar 2005 15:31:12 -0000 1.62
***************
*** 77,80 ****
--- 77,81 ----
NPError SetWindow(NPWindow * aWindow);
NPError DestroyStream(NPStream * stream, NPError reason);
+ void URLNotify(const char *url, NPReason reason, void *notifyData);
int32 WriteReady(NPStream * stream);
int32 Write(NPStream * stream, int32 offset, int32 len, void *buffer);
Index: plugin-list.cpp
===================================================================
RCS file: /cvsroot/mplayerplug-in/mplayerplug-in/Source/plugin-list.cpp,v
retrieving revision 1.46
retrieving revision 1.47
diff -C2 -d -r1.46 -r1.47
*** plugin-list.cpp 8 Nov 2004 21:17:25 -0000 1.46
--- plugin-list.cpp 19 Mar 2005 15:31:11 -0000 1.47
***************
*** 273,277 ****
if (filename != NULL)
NPN_MemFree(filename);
! NPN_GetURL(instance->mInstance, node->url, NULL);
}
} else {
--- 273,277 ----
if (filename != NULL)
NPN_MemFree(filename);
! NPN_GetURLNotify(instance->mInstance, node->url, NULL, NULL);
}
} else {
Index: plugin.cpp
===================================================================
RCS file: /cvsroot/mplayerplug-in/mplayerplug-in/Source/plugin.cpp,v
retrieving revision 1.182
retrieving revision 1.183
diff -C2 -d -r1.182 -r1.183
*** plugin.cpp 18 Mar 2005 15:10:16 -0000 1.182
--- plugin.cpp 19 Mar 2005 15:31:12 -0000 1.183
***************
*** 766,771 ****
fixed_event_box = gtk_event_box_new();
fixed_container = gtk_fixed_new();
! gtk_widget_set_events(GTK_WIDGET(fixed_event_box), GDK_BUTTON_PRESS_MASK);
! #ifdef GTK2_ENABLED
g_signal_connect_swapped(G_OBJECT(fixed_event_box),
"button_press_event",
--- 766,772 ----
fixed_event_box = gtk_event_box_new();
fixed_container = gtk_fixed_new();
! gtk_widget_set_events(GTK_WIDGET(fixed_event_box),
! GDK_BUTTON_PRESS_MASK);
! #ifdef GTK2_ENABLED
g_signal_connect_swapped(G_OBJECT(fixed_event_box),
"button_press_event",
***************
*** 775,784 ****
#ifdef GTK1_ENABLED
gtk_signal_connect_object(GTK_OBJECT(fixed_event_box),
! "button_press_event",
! GTK_SIGNAL_FUNC(popup_handler),
! GTK_OBJECT(popup_menu));
#endif
! gtk_container_add(GTK_CONTAINER(fixed_event_box),fixed_container);
!
status = GTK_LABEL(gtk_label_new(_("Initializing")));
progress_bar = GTK_PROGRESS_BAR(gtk_progress_bar_new());
--- 776,785 ----
#ifdef GTK1_ENABLED
gtk_signal_connect_object(GTK_OBJECT(fixed_event_box),
! "button_press_event",
! GTK_SIGNAL_FUNC(popup_handler),
! GTK_OBJECT(popup_menu));
#endif
! gtk_container_add(GTK_CONTAINER(fixed_event_box), fixed_container);
!
status = GTK_LABEL(gtk_label_new(_("Initializing")));
progress_bar = GTK_PROGRESS_BAR(gtk_progress_bar_new());
***************
*** 870,874 ****
#ifdef GTK2_ENABLED
! gtk_widget_modify_bg(fixed_event_box, GTK_STATE_NORMAL, &black);
gtk_widget_modify_fg(GTK_WIDGET(status), GTK_STATE_NORMAL,
&white);
--- 871,876 ----
#ifdef GTK2_ENABLED
! gtk_widget_modify_bg(fixed_event_box, GTK_STATE_NORMAL,
! &black);
gtk_widget_modify_fg(GTK_WIDGET(status), GTK_STATE_NORMAL,
&white);
***************
*** 1240,1247 ****
n = td->list;
while (n != NULL) {
! if ((useragent != NULL) && (strstr(mimetype, "quicktime") == NULL)) // if we have a user agent
! if (strncasecmp(n->url, "http://", 7) == 0) // and we have an http url
! isHttpStream = true; // then we might have an http stream
! if ((isHttpStream || n->mmsstream == 1)
&& (n->play == 1)) {
if (threadsignaled == 0) {
--- 1242,1246 ----
n = td->list;
while (n != NULL) {
! if ((n->mmsstream == 1)
&& (n->play == 1)) {
if (threadsignaled == 0) {
***************
*** 1278,1281 ****
--- 1277,1325 ----
}
+ void nsPluginInstance::URLNotify(const char *url, NPReason reason,
+ void *notifyData)
+ {
+ Node *n;
+ bool isHttpStream = false;
+
+
+ if (DEBUG)
+ printf("URL: %s\nReason %i\n", url, reason);
+
+ if (reason == 1) {
+ // check for streaming media
+ if (threadsignaled == 0) {
+ // look for mmsstream
+ n = td->list;
+ while (n != NULL) {
+ if ((useragent != NULL) && (strstr(mimetype, "quicktime") == NULL)) // if we have a user agent
+ if (strncasecmp(n->url, "http://", 7) == 0) // and we have an http url
+ isHttpStream = true; // then we might have an http stream
+ if ((isHttpStream || n->mmsstream == 1)
+ && (n->play == 1)) {
+ if (threadsignaled == 0) {
+ if (DEBUG)
+ printf("signalling player (mmsstream)\n");
+ if (autostart) {
+ signalPlayerThread(this);
+ threadsignaled = 1;
+ } else {
+ if (showcontrols) {
+ panel_height = 16;
+ #ifdef GTK_ENABLED
+ g_idle_add(gtkgui_draw, this);
+ #endif
+ }
+ }
+ }
+ break;
+ }
+ n = n->next;
+ }
+ }
+ }
+
+ }
+
int32 nsPluginInstance::WriteReady(NPStream * stream)
{
***************
*** 1359,1363 ****
if (n->cachebytes < (cachesize * 1024))
n->cachebytes = cachesize * 1024;
!
// if the file is really big , cap the amount to be cached
if (n->cachebytes > (cachesize * 1024 * 2))
--- 1403,1407 ----
if (n->cachebytes < (cachesize * 1024))
n->cachebytes = cachesize * 1024;
!
// if the file is really big , cap the amount to be cached
if (n->cachebytes > (cachesize * 1024 * 2))
***************
*** 1664,1668 ****
printf("*****Play Called\n");
}
!
if (autostart == 0 && threadsignaled == 0) {
signalPlayerThread(this);
--- 1708,1712 ----
printf("*****Play Called\n");
}
!
if (autostart == 0 && threadsignaled == 0) {
signalPlayerThread(this);
***************
*** 2023,2028 ****
black.blue = 0;
if (drawing_area != NULL) {
! colormap = gdk_window_get_colormap(drawing_area->window);
! gdk_color_alloc(colormap, &black);
}
#endif
--- 2067,2072 ----
black.blue = 0;
if (drawing_area != NULL) {
! colormap = gdk_window_get_colormap(drawing_area->window);
! gdk_color_alloc(colormap, &black);
}
#endif
***************
*** 2412,2416 ****
10, 10);
#ifdef GTK2_ENABLED
! gtk_widget_modify_bg(fixed_event_box, GTK_STATE_NORMAL, &black);
if (drawing_area != NULL)
gtk_widget_modify_bg(drawing_area, GTK_STATE_NORMAL,
--- 2456,2461 ----
10, 10);
#ifdef GTK2_ENABLED
! gtk_widget_modify_bg(fixed_event_box, GTK_STATE_NORMAL,
! &black);
if (drawing_area != NULL)
gtk_widget_modify_bg(drawing_area, GTK_STATE_NORMAL,
|