[Mplayerplug-in-cvs] mplayerplug-in/Source plugin-setup.cpp,1.21,1.22 plugin.cpp,1.73,1.74 plugin.h,
Brought to you by:
kdekorte
From: Kevin D. <kde...@us...> - 2004-03-20 20:35:58
|
Update of /cvsroot/mplayerplug-in/mplayerplug-in/Source In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23098/Source Modified Files: plugin-setup.cpp plugin.cpp plugin.h Log Message: nodownloadmedia config option Index: plugin-setup.cpp =================================================================== RCS file: /cvsroot/mplayerplug-in/mplayerplug-in/Source/plugin-setup.cpp,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** plugin-setup.cpp 20 Mar 2004 15:58:27 -0000 1.21 --- plugin-setup.cpp 20 Mar 2004 20:25:57 -0000 1.22 *************** *** 610,613 **** --- 610,623 ---- } + if (strncasecmp(buffer, "nodownloadmedia", 15) == 0) { + snprintf(parse, 1000, "%s", strtok(buffer, "=")); + snprintf(parse, 1000, "%s", strtok(NULL, "=")); + sscanf(parse, "%i", &instance->nodownloadmedia); + if (instance->nodownloadmedia != 0) + instance->nodownloadmedia = 1; + continue; + } + + if (strncasecmp(buffer, "vopopt", 6) == 0) { snprintf(parse, 1000, "%s", strtok(buffer, "=")); Index: plugin.cpp =================================================================== RCS file: /cvsroot/mplayerplug-in/mplayerplug-in/Source/plugin.cpp,v retrieving revision 1.73 retrieving revision 1.74 diff -C2 -d -r1.73 -r1.74 *** plugin.cpp 20 Mar 2004 15:58:27 -0000 1.73 --- plugin.cpp 20 Mar 2004 20:25:57 -0000 1.74 *************** *** 179,183 **** mediaPercent = 0; mediaTime = 0.0; ! #ifdef GTK_ENABLED progress_bar = NULL; --- 179,184 ---- mediaPercent = 0; mediaTime = 0.0; ! nodownloadmedia = 0; ! #ifdef GTK_ENABLED progress_bar = NULL; *************** *** 871,893 **** NPN_DestroyStream(mInstance, stream, NPRES_DONE); } ! if (strlen(n->fname) == 0) { ! snprintf(n->fname, 1024, "%s", ! tempnam("/tmp", "mplayerplug-inXXXXXX")); ! if (DEBUG) ! printf("WR tempname: %s\n", n->fname); ! ! } ! if (n->totalbytes != (int) stream->end) ! n->totalbytes = stream->end; ! if (n->cachebytes < (long int) (stream->end * cache_percent / 100)) ! n->cachebytes = (long int) (stream->end * cache_percent / 100); ! if (n->cachebytes < (cachesize * 1024)) ! n->cachebytes = cachesize * 1024; ! pthread_mutex_unlock(&playlist_mutex); ! return STREAMBUFSIZE; } else { if (DEBUG) --- 872,907 ---- NPN_DestroyStream(mInstance, stream, NPRES_DONE); } + if ((nodownloadmedia == 1) && (stream->end > 16384)) { + pthread_mutex_unlock(&playlist_mutex); + if (threadsignaled == 0) { + if (DEBUG) + printf("signalling player from write ready\n"); + if (autostart) { + signalPlayerThread(this); + threadsignaled = 1; + } + } + return -1; + + } else { + if (strlen(n->fname) == 0) { + snprintf(n->fname, 1024, "%s", + tempnam("/tmp", "mplayerplug-inXXXXXX")); + if (DEBUG) + printf("WR tempname: %s\n", n->fname); ! } ! if (n->totalbytes != (int) stream->end) ! n->totalbytes = stream->end; ! if (n->cachebytes < (long int) (stream->end * cache_percent / 100)) ! n->cachebytes = (long int) (stream->end * cache_percent / 100); ! if (n->cachebytes < (cachesize * 1024)) ! n->cachebytes = cachesize * 1024; ! pthread_mutex_unlock(&playlist_mutex); ! return STREAMBUFSIZE; ! } } else { if (DEBUG) *************** *** 896,911 **** n = newNode(); snprintf(n->url, 1024, "%s", stream->url); ! snprintf(n->fname, 1024, "%s", ! tempnam("/tmp", "mplayerplug-inXXXXXX")); ! addToEnd(td->list, n); ! if (n->totalbytes != (int) stream->end) ! n->totalbytes = stream->end; ! pthread_mutex_unlock(&playlist_mutex); ! if (DEBUG >= 3) { ! printf ! ("**Exiting WriteReady Callback, state = %d, js_state = %d\n", ! state, js_state); } - return STREAMBUFSIZE; } --- 910,931 ---- n = newNode(); snprintf(n->url, 1024, "%s", stream->url); ! if ((nodownloadmedia == 1) && (stream->end > 16384)) { ! addToEnd(td->list, n); ! pthread_mutex_unlock(&playlist_mutex); ! return -1; ! } else { ! snprintf(n->fname, 1024, "%s", ! tempnam("/tmp", "mplayerplug-inXXXXXX")); ! addToEnd(td->list, n); ! if (n->totalbytes != (int) stream->end) ! n->totalbytes = stream->end; ! pthread_mutex_unlock(&playlist_mutex); ! if (DEBUG >= 3) { ! printf ! ("**Exiting WriteReady Callback, state = %d, js_state = %d\n", ! state, js_state); ! } ! return STREAMBUFSIZE; } } Index: plugin.h =================================================================== RCS file: /cvsroot/mplayerplug-in/mplayerplug-in/Source/plugin.h,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** plugin.h 20 Mar 2004 15:57:47 -0000 1.32 --- plugin.h 20 Mar 2004 20:25:57 -0000 1.33 *************** *** 140,144 **** int mediaPercent; // percentage of media played float mediaTime; // time in seconds ! #ifdef GTK_ENABLED GtkWidget *gtkwidget; --- 140,145 ---- int mediaPercent; // percentage of media played float mediaTime; // time in seconds ! int nodownloadmedia; ! #ifdef GTK_ENABLED GtkWidget *gtkwidget; |