[Mplayerplug-in-cvs] mplayerplug-in/Source nsScriptablePeer.cpp,1.17,1.18 plugin-list.cpp,1.36,1.37
Brought to you by:
kdekorte
Update of /cvsroot/mplayerplug-in/mplayerplug-in/Source In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10491/Source Modified Files: nsScriptablePeer.cpp plugin-list.cpp plugin-support.cpp plugin-threads.cpp plugin-ui.cpp plugin.cpp plugin.h Log Message: Patches from my tree that I forgot to commit Index: plugin-ui.cpp =================================================================== RCS file: /cvsroot/mplayerplug-in/mplayerplug-in/Source/plugin-ui.cpp,v retrieving revision 1.71 retrieving revision 1.72 diff -C2 -d -r1.71 -r1.72 *** plugin-ui.cpp 10 Apr 2004 15:17:10 -0000 1.71 --- plugin-ui.cpp 17 Apr 2004 23:47:32 -0000 1.72 *************** *** 1075,1078 **** --- 1075,1081 ---- stop_callback(NULL, NULL, instance); instance->SetFullscreen(0); + if (DEBUG > 1) + printf("completed gtkgui_stop\n"); + return FALSE; } *************** *** 1211,1231 **** char *filename; char newname[1024]; if (instance->mInitialized == FALSE) return; pthread_mutex_lock(&(instance->playlist_mutex)); if (instance->currentnode != NULL) { ! filename = getURLFilename(instance->currentnode->url); if (filename) { ! if (instance->currentnode->retrieved == 1) { snprintf(newname, 1024, "%s/%s", instance->download_dir, filename); ! rename(instance->currentnode->fname,newname); ! snprintf(instance->currentnode->fname, 1024, "%s/%s", instance->download_dir, filename); ! instance->currentnode->remove = 0; } NPN_MemFree(filename); } ! } pthread_mutex_unlock(&(instance->playlist_mutex)); } --- 1214,1249 ---- char *filename; char newname[1024]; + Node *n, *lastplayed; if (instance->mInitialized == FALSE) return; pthread_mutex_lock(&(instance->playlist_mutex)); + + lastplayed = NULL; + if (instance->currentnode != NULL) { ! lastplayed = instance->currentnode; ! } else { ! n = instance->list; ! while (n != NULL) { ! if (n->played == 1) ! lastplayed = n; ! n = n->next; ! } ! } ! ! if( lastplayed != NULL) { ! filename = getURLFilename(lastplayed->url); if (filename) { ! if (lastplayed->retrieved == 1) { snprintf(newname, 1024, "%s/%s", instance->download_dir, filename); ! rename(lastplayed->fname,newname); ! snprintf(lastplayed->fname, 1024, "%s/%s", instance->download_dir, filename); ! lastplayed->remove = 0; } NPN_MemFree(filename); } ! } pthread_mutex_unlock(&(instance->playlist_mutex)); } Index: plugin-support.cpp =================================================================== RCS file: /cvsroot/mplayerplug-in/mplayerplug-in/Source/plugin-support.cpp,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** plugin-support.cpp 8 Apr 2004 14:34:03 -0000 1.32 --- plugin-support.cpp 17 Apr 2004 23:47:32 -0000 1.33 *************** *** 10,13 **** --- 10,16 ---- { int i = 0; + + if (DEBUG > 1) + printf("in lowercase\n"); while (string[i]) { *************** *** 24,27 **** --- 27,36 ---- FILE *fp; + if (DEBUG > 1) + printf("in fexists\n"); + + if (file == NULL) + return 0; + fp = fopen(file, "r"); if (fp != NULL) { *************** *** 42,46 **** if (DEBUG > 1) ! printf("entering getURLHostname %s\n", url); if (url == NULL) return NULL; --- 51,56 ---- if (DEBUG > 1) ! printf("entering getURLHostname\n"); ! if (url == NULL) return NULL; *************** *** 84,87 **** --- 94,100 ---- int len; + if (DEBUG > 1) + printf("in getURLFilename\n"); + if (url == NULL) return NULL; *************** *** 105,110 **** int i, len; ! if (0) ! printf("in getURLBase url: %s\n", url); if (url == NULL) return NULL; --- 118,124 ---- int i, len; ! if (DEBUG > 1) ! printf("in getURLBase\n"); ! if (url == NULL) return NULL; *************** *** 140,143 **** --- 154,162 ---- int isMms(char *url) { + if (DEBUG > 1) + printf("in isMms\n"); + + if (url == NULL) + return 0; if ((strncasecmp(url, "mms://", 6) == 0) || (strncasecmp(url, "mmst://", 7) == 0) *************** *** 175,178 **** --- 194,200 ---- int ret; + if (DEBUG > 1) + printf("in URLcmp\n"); + if (strcmp(url1, url2) == 0) return 0; *************** *** 263,269 **** --- 285,297 ---- { char *p; + + if (DEBUG > 1) + printf("in remove_quotes\n"); // don't scan the string if it not in there, this should be a bit faster than the while loop + if (url == NULL) + return; + p = strchr(url, '`'); *************** *** 293,300 **** --- 321,334 ---- int retval; char buffer[1024]; + + if (DEBUG > 1) + printf("in sendcommand\n"); buffer[1023] = '\0'; retval = 0; + if (command == NULL || instance == NULL) + return 0; + if (instance->js_state != JS_STATE_TRANSITIONING) { *************** *** 320,325 **** int count, status; //we can do the following twice on the same thread with no ill effects - printf("Cancelling Player Thread...."); pthread_cancel(instance->player_thread); pthread_join(instance->player_thread, &thread_return); --- 354,361 ---- int count, status; + if (DEBUG > 1) + printf("in killmplayer\n"); + //we can do the following twice on the same thread with no ill effects pthread_cancel(instance->player_thread); pthread_join(instance->player_thread, &thread_return); *************** *** 328,332 **** status = 0; instance->threadsetup = 0; - printf("Done\n"); if (DEBUG) --- 364,367 ---- *************** *** 334,340 **** ("Trying to kill mplayer process(%d), if it still exists\n", instance->pid); ! ! // commented this out because we kept getting weird crashes with it. ! //sendCommand(instance, "quit\n"); instance->cancelled = 1; count = 0; --- 369,374 ---- ("Trying to kill mplayer process(%d), if it still exists\n", instance->pid); ! ! sendCommand(instance, "quit\n"); instance->cancelled = 1; count = 0; *************** *** 401,405 **** if (DEBUG > 1) ! printf("fullyQualifyURL\nitem: %s\nbaseurl: %s\nhostname: %s\n", item, instance->baseurl, instance->hostname); --- 435,442 ---- if (DEBUG > 1) ! printf("in fullyQualifyURL\n"); ! ! if (DEBUG > 1) ! printf("item: %s\nbaseurl: %s\nhostname: %s\n", item, instance->baseurl, instance->hostname); Index: plugin.h =================================================================== RCS file: /cvsroot/mplayerplug-in/mplayerplug-in/Source/plugin.h,v retrieving revision 1.42 retrieving revision 1.43 diff -C2 -d -r1.42 -r1.43 *** plugin.h 7 Apr 2004 20:29:30 -0000 1.42 --- plugin.h 17 Apr 2004 23:47:32 -0000 1.43 *************** *** 232,235 **** --- 232,237 ---- GdkPixmap *pb_sm_fs_down; + GtkStyle *style; + GdkColor color; #endif Index: plugin-threads.cpp =================================================================== RCS file: /cvsroot/mplayerplug-in/mplayerplug-in/Source/plugin-threads.cpp,v retrieving revision 1.90 retrieving revision 1.91 diff -C2 -d -r1.90 -r1.91 *** plugin-threads.cpp 10 Apr 2004 15:17:10 -0000 1.90 --- plugin-threads.cpp 17 Apr 2004 23:47:32 -0000 1.91 *************** *** 869,872 **** --- 869,873 ---- printf("----player thread: breaking read loop - Quit\n"); local_td->instance->js_state = JS_STATE_UNDEFINED; + tryagain = TRYAGAIN_FALSE; break; } *************** *** 921,924 **** --- 922,926 ---- #endif } + tryagain = TRYAGAIN_FALSE; break; } *************** *** 954,957 **** --- 956,960 ---- printf ("----player thread: breaking read loop - cancelled\n"); + tryagain = TRYAGAIN_FALSE; break; } Index: plugin-list.cpp =================================================================== RCS file: /cvsroot/mplayerplug-in/mplayerplug-in/Source/plugin-list.cpp,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -d -r1.36 -r1.37 *** plugin-list.cpp 11 Apr 2004 13:17:48 -0000 1.36 --- plugin-list.cpp 17 Apr 2004 23:47:32 -0000 1.37 *************** *** 306,310 **** buffer[size] = '\0'; ! if (DEBUG) printf("READ: %i\n%s\n", size, buffer); --- 306,310 ---- buffer[size] = '\0'; ! if (DEBUG > 1) printf("READ: %i\n%s\n", size, buffer); *************** *** 403,407 **** lowercase((char *) buffer_lower); p = buffer_lower; ! if (memmem(p, size, "<smil", 5)) { while (p != NULL) { speed = -1; --- 403,407 ---- lowercase((char *) buffer_lower); p = buffer_lower; ! if (memmem(p, size, "<smil", 5) && found == 0) { while (p != NULL) { speed = -1; *************** *** 501,505 **** if (memmem (p, size, "quicktime-media-link", ! strlen("quicktime-media-link"))) { if (DEBUG) printf("found QuickTime Media Link file\n"); --- 501,505 ---- if (memmem (p, size, "quicktime-media-link", ! strlen("quicktime-media-link")) && found == 0) { if (DEBUG) printf("found QuickTime Media Link file\n"); *************** *** 536,540 **** // some mp3 files start with ID3, not a reference file // not all MP3 files have the ID tag ! if (strncasecmp(buffer, "ID3", 3) == 0) { if (DEBUG) printf("found MP3\n"); --- 536,540 ---- // some mp3 files start with ID3, not a reference file // not all MP3 files have the ID tag ! if (strncasecmp(buffer, "ID3", 3) == 0 && found == 0) { if (DEBUG) printf("found MP3\n"); *************** *** 547,551 **** lowercase((char *) buffer_lower); p = buffer_lower; ! if (memmem(p, size, "<asx", strlen("<asx"))) { if (DEBUG) printf("found ASX file\n"); --- 547,551 ---- lowercase((char *) buffer_lower); p = buffer_lower; ! if (memmem(p, size, "<asx", strlen("<asx")) && found == 0) { if (DEBUG) printf("found ASX file\n"); *************** *** 583,587 **** } // asf files ! if (strncasecmp(buffer, "[reference]", 11) == 0) { if (DEBUG) printf("found ASF file\n"); --- 583,587 ---- } // asf files ! if (strncasecmp(buffer, "[reference]", 11) == 0 && found == 0) { if (DEBUG) printf("found ASF file\n"); *************** *** 631,636 **** break; } // simple playlist usually realmedia file ! if (strncasecmp(buffer, "rtsp://", 7) == 0) { p = buffer; while (p != NULL) { --- 631,642 ---- break; } + + // if we have an HTML file, ignore it and don't process it + if (memmem(buffer_lower,size,"<html", 5) != NULL) { + found = 1; + } + // simple playlist usually realmedia file ! if (strncasecmp(buffer, "rtsp://", 7) == 0 && found == 0) { p = buffer; while (p != NULL) { *************** *** 657,662 **** } // simple playlist, usually old windows media ! if ((strncasecmp(buffer, "http://", 7) == 0 || memmem(buffer,size,"http://", 7) != NULL) && found == 0 && memmem(buffer,size,"<A", 2) == NULL && memmem(buffer,size,"<a", 2) == NULL) { ! // if (strncasecmp(buffer, "http://", 7) == 0) { p = buffer; while (p != NULL) { --- 663,668 ---- } // simple playlist, usually old windows media ! if ((strncasecmp(buffer, "http://", 7) == 0 || memmem(buffer_lower,size,"http://", 7) != NULL) ! && found == 0 && memmem(buffer_lower,size,"<a", 2) == NULL) { p = buffer; while (p != NULL) { *************** *** 683,687 **** } // simple playlist, usually old windows media ! if (strncasecmp(buffer, "mms://", 6) == 0) { p = buffer; while (p != NULL) { --- 689,693 ---- } // simple playlist, usually old windows media ! if (strncasecmp(buffer, "mms://", 6) == 0 && found == 0) { p = buffer; while (p != NULL) { Index: nsScriptablePeer.cpp =================================================================== RCS file: /cvsroot/mplayerplug-in/mplayerplug-in/Source/nsScriptablePeer.cpp,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** nsScriptablePeer.cpp 1 Apr 2004 16:08:28 -0000 1.17 --- nsScriptablePeer.cpp 17 Apr 2004 23:47:32 -0000 1.18 *************** *** 311,315 **** { *aControls = mControls; ! return NS_OK; } --- 311,318 ---- { *aControls = mControls; ! if (mControls == NULL) ! return NS_ERROR_NULL_POINTER; ! else ! return NS_OK; } Index: plugin.cpp =================================================================== RCS file: /cvsroot/mplayerplug-in/mplayerplug-in/Source/plugin.cpp,v retrieving revision 1.103 retrieving revision 1.104 diff -C2 -d -r1.103 -r1.104 *** plugin.cpp 11 Apr 2004 13:17:48 -0000 1.103 --- plugin.cpp 17 Apr 2004 23:47:32 -0000 1.104 *************** *** 264,275 **** mControlsScriptablePeer->SetInstance(NULL); mControlsScriptablePeer->Release(); } ! NS_IF_RELEASE(mControlsScriptablePeer); if (mScriptablePeer != NULL) { mScriptablePeer->InitControls(NULL); mScriptablePeer->SetInstance(NULL); } ! NS_IF_RELEASE(mScriptablePeer); } --- 264,277 ---- mControlsScriptablePeer->SetInstance(NULL); mControlsScriptablePeer->Release(); + NS_IF_RELEASE(mControlsScriptablePeer); } ! if (mScriptablePeer != NULL) { mScriptablePeer->InitControls(NULL); mScriptablePeer->SetInstance(NULL); + NS_IF_RELEASE(mScriptablePeer); } ! } *************** *** 508,511 **** --- 510,518 ---- #ifdef GTK1_ENABLED gtk_widget_set_usize(gtkwidget, aWindow->width, aWindow->height); + style = gtk_style_copy(gtk_widget_get_style(gtkwidget)); + color.red = style->bg[GTK_STATE_NORMAL].red; + color.green = style->bg[GTK_STATE_NORMAL].green; + color.blue = style->bg[GTK_STATE_NORMAL].blue; + #endif InitPixbufs(this); *************** *** 1368,1372 **** if (threadsignaled == 1 && js_state == JS_STATE_UNDEFINED) { - launchPlayerThread(this); pthread_mutex_unlock(&control_mutex); --- 1375,1378 ---- *************** *** 1647,1650 **** --- 1653,1660 ---- GdkColor black; #endif + #ifdef GTK1_ENABLED + GdkColor black; + #endif + int x, y, disp_y, pos_y; *************** *** 1653,1657 **** fullscreen); ! #ifdef GTK2_ENABLED black.red = 0; black.green = 0; --- 1663,1667 ---- fullscreen); ! #ifdef GTK_ENABLED black.red = 0; black.green = 0; *************** *** 1762,1765 **** --- 1772,1785 ---- gtk_widget_modify_bg(drawing_area,GTK_STATE_NORMAL,&(gtk_widget_get_style(image)->bg[GTK_STATE_NORMAL])); #endif + #ifdef GTK1_ENABLED + style->bg[GTK_STATE_NORMAL].red = color.red; + style->bg[GTK_STATE_NORMAL].green = color.green; + style->bg[GTK_STATE_NORMAL].blue = color.blue; + + gtk_widget_set_style(gtkwidget,style); + gtk_widget_set_style(drawing_area,style); + gtk_widget_ensure_style(gtkwidget); + gtk_widget_ensure_style(drawing_area); + #endif #endif *************** *** 1857,1860 **** --- 1877,1889 ---- gtk_widget_modify_bg(drawing_area,GTK_STATE_NORMAL,&black); #endif + #ifdef GTK1_ENABLED + style->bg[GTK_STATE_NORMAL].red = black.red; + style->bg[GTK_STATE_NORMAL].green = black.green; + style->bg[GTK_STATE_NORMAL].blue = black.blue; + gtk_widget_set_style(gtkwidget,style); + gtk_widget_set_style(drawing_area,style); + gtk_widget_ensure_style(gtkwidget); + gtk_widget_ensure_style(drawing_area); + #endif #endif fullscreen = 1; |