[Mplayerplug-in-cvs] mplayerplug-in/Source plugin-list.cpp, 1.77, 1.78 plugin-setup.cpp, 1.142, 1.1
Brought to you by:
kdekorte
Update of /cvsroot/mplayerplug-in/mplayerplug-in/Source In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv32749/Source Modified Files: plugin-list.cpp plugin-setup.cpp plugin-setup.h plugin-support.cpp plugin-threads.cpp plugin.cpp Log Message: Add in make dist support, and autogenerating spec files (way over due on these) Change url max length from 1024 to 4096 (some sites still do no work, investigating) Index: plugin-threads.cpp =================================================================== RCS file: /cvsroot/mplayerplug-in/mplayerplug-in/Source/plugin-threads.cpp,v retrieving revision 1.275 retrieving revision 1.276 diff -C2 -d -r1.275 -r1.276 *** plugin-threads.cpp 22 Nov 2007 14:59:35 -0000 1.275 --- plugin-threads.cpp 3 Dec 2007 17:34:08 -0000 1.276 *************** *** 247,251 **** char *filename; char *baseurl; ! char buffer[1024]; #ifndef X_DISPLAY_MISSING char *dispName = XDisplayName(NULL); --- 247,251 ---- char *filename; char *baseurl; ! char buffer[4096]; #ifndef X_DISPLAY_MISSING char *dispName = XDisplayName(NULL); *************** *** 285,293 **** if (DEBUG) printf("using fname for url\n"); ! snprintf(instance->td->list->url, 1024, "%s", instance->fname); } else { if (DEBUG) printf("using url for url\n"); ! snprintf(instance->td->list->url, 1024, "%s", instance->url); } --- 285,293 ---- if (DEBUG) printf("using fname for url\n"); ! snprintf(instance->td->list->url, 4096, "%s", instance->fname); } else { if (DEBUG) printf("using url for url\n"); ! snprintf(instance->td->list->url, 4096, "%s", instance->url); } *************** *** 295,299 **** if (DEBUG) printf("using href for url\n"); ! snprintf(instance->td->list->url, 1024, "%s", instance->href); } --- 295,299 ---- if (DEBUG) printf("using href for url\n"); ! snprintf(instance->td->list->url, 4096, "%s", instance->href); } *************** *** 353,357 **** printf("url %s\nbuffer %s\n", instance->td->list->url, buffer); ! snprintf(instance->td->list->url, 1024, "%s", buffer); pthread_mutex_unlock(&(instance->playlist_mutex)); } --- 353,357 ---- printf("url %s\nbuffer %s\n", instance->td->list->url, buffer); ! snprintf(instance->td->list->url, 4096, "%s", buffer); pthread_mutex_unlock(&(instance->playlist_mutex)); } *************** *** 732,736 **** int i, amt; int zerocfbytes_count = 0; ! char url_copy[1024]; int c; char ch; --- 732,736 ---- int i, amt; int zerocfbytes_count = 0; ! char url_copy[4096]; int c; char ch; *************** *** 1555,1568 **** if (result->tryagain == TRYAGAIN_FALLBACK) { //fallback to msst and then to http if we can ! strlcpy(url_copy, local_url, 1023); ! url_copy[1023] = '\0'; if (strncmp(local_url, "mms://", 6) == 0) { ! snprintf(local_url, 1023, "mmst://%s", url_copy + 6); result->retval = TRUE; } else if (local_mmsstream && strncmp(local_url, "mmst://", 7) == 0) { ! snprintf(local_url, 1023, "http://%s", url_copy + 7); result->retval = TRUE; } else { --- 1555,1568 ---- if (result->tryagain == TRYAGAIN_FALLBACK) { //fallback to msst and then to http if we can ! strlcpy(url_copy, local_url, 4095); ! url_copy[4095] = '\0'; if (strncmp(local_url, "mms://", 6) == 0) { ! snprintf(local_url, 4095, "mmst://%s", url_copy + 6); result->retval = TRUE; } else if (local_mmsstream && strncmp(local_url, "mmst://", 7) == 0) { ! snprintf(local_url, 4095, "http://%s", url_copy + 7); result->retval = TRUE; } else { *************** *** 1587,1591 **** PlayResult *result = NULL; FILE *playlist; ! char cmd[2048]; char message[1024]; char mmsplaylist[1024]; --- 1587,1591 ---- PlayResult *result = NULL; FILE *playlist; ! char cmd[8192]; char message[1024]; char mmsplaylist[1024]; *************** *** 1596,1600 **** ThreadData *local_td; Node *local_list; ! char local_url[1024]; int local_mmsstream; int i; --- 1596,1600 ---- ThreadData *local_td; Node *local_list; ! char local_url[4096]; int local_mmsstream; int i; *************** *** 1719,1723 **** printf("----player thread: adding %s\n", local_td->instance->qtNext[i]); ! strlcpy(node->url, local_td->instance->qtNext[i], 1024); i++; addToEnd(local_list, node); --- 1719,1723 ---- printf("----player thread: adding %s\n", local_td->instance->qtNext[i]); ! strlcpy(node->url, local_td->instance->qtNext[i], 4096); i++; addToEnd(local_list, node); *************** *** 1871,1876 **** local_list->url); listempty = 0; ! snprintf(local_url, 1024, "%s", local_list->url); ! local_url[1023] = '\0'; local_mmsstream = local_list->mmsstream; } --- 1871,1876 ---- local_list->url); listempty = 0; ! snprintf(local_url, 4096, "%s", local_list->url); ! local_url[4095] = '\0'; local_mmsstream = local_list->mmsstream; } Index: plugin-list.cpp =================================================================== RCS file: /cvsroot/mplayerplug-in/mplayerplug-in/Source/plugin-list.cpp,v retrieving revision 1.77 retrieving revision 1.78 diff -C2 -d -r1.77 -r1.78 *** plugin-list.cpp 20 Sep 2007 23:43:10 -0000 1.77 --- plugin-list.cpp 3 Dec 2007 17:34:07 -0000 1.78 *************** *** 88,92 **** if (src != NULL && dest != NULL) { if (dest->url != NULL && src->url != NULL) ! strlcpy(dest->url, src->url, 1024); if (dest->fname != NULL && src->fname != NULL) strlcpy(dest->fname, src->fname, 1024); --- 88,92 ---- if (src != NULL && dest != NULL) { if (dest->url != NULL && src->url != NULL) ! strlcpy(dest->url, src->url, 4096); if (dest->fname != NULL && src->fname != NULL) strlcpy(dest->fname, src->fname, 1024); *************** *** 139,143 **** int tagtime = 0; char tagtarget[128]; ! char tagurl[1024]; endvideo = strstr(smilbuffer, "</video"); --- 139,143 ---- int tagtime = 0; char tagtarget[128]; ! char tagurl[4096]; endvideo = strstr(smilbuffer, "</video"); *************** *** 237,241 **** Node *n; char *filename; ! char localitem[1024]; fullyQualifyURL(instance, item, localitem); --- 237,241 ---- Node *n; char *filename; ! char localitem[4096]; fullyQualifyURL(instance, item, localitem); *************** *** 304,308 **** char buffer[16 * 1024]; char buffer_lower[16 * 1024]; ! char url[1024]; unsigned long int size, found, i; long int remainder; --- 304,308 ---- char buffer[16 * 1024]; char buffer_lower[16 * 1024]; ! char url[4096]; unsigned long int size, found, i; long int remainder; *************** *** 564,568 **** p++; i = (long) p - (long) buffer_lower; ! snprintf(url, 1024, "%s", buffer + i); sub = strchr(url, '\"'); --- 564,568 ---- p++; i = (long) p - (long) buffer_lower; ! snprintf(url, 4096, "%s", buffer + i); sub = strchr(url, '\"'); *************** *** 786,790 **** p++; i = (long) p - (long) buffer_lower; ! snprintf(url, 1024, "%s", buffer + i); sub = strchr(url, '\r'); --- 786,790 ---- p++; i = (long) p - (long) buffer_lower; ! snprintf(url, 4096, "%s", buffer + i); sub = strchr(url, '\r'); *************** *** 846,850 **** } else { i = (long) p - (long) buffer_lower; ! snprintf(url, 1024, "rtsp://%s", buffer + i + 7); sub = strchr(url, 0xd); // terminate on CR if (sub != NULL) --- 846,850 ---- } else { i = (long) p - (long) buffer_lower; ! snprintf(url, 4096, "rtsp://%s", buffer + i + 7); sub = strchr(url, 0xd); // terminate on CR if (sub != NULL) *************** *** 879,883 **** } else { i = (long) p - (long) buffer_lower; ! snprintf(url, 1024, "pnm://%s", buffer + i + 6); sub = strchr(url, 0xd); // terminate on CR if (sub != NULL) --- 879,883 ---- } else { i = (long) p - (long) buffer_lower; ! snprintf(url, 4096, "pnm://%s", buffer + i + 6); sub = strchr(url, 0xd); // terminate on CR if (sub != NULL) *************** *** 912,916 **** break; } else { ! snprintf(url, 1024, "%s", p); sub = strchr(url, 0xd); if (sub != NULL) --- 912,916 ---- break; } else { ! snprintf(url, 4096, "%s", p); sub = strchr(url, 0xd); if (sub != NULL) *************** *** 940,944 **** break; } else { ! snprintf(url, 1024, "%s", p); sub = strchr(url, 0xd); if (sub != NULL) --- 940,944 ---- break; } else { ! snprintf(url, 4096, "%s", p); sub = strchr(url, 0xd); if (sub != NULL) Index: plugin-setup.h =================================================================== RCS file: /cvsroot/mplayerplug-in/mplayerplug-in/Source/plugin-setup.h,v retrieving revision 1.67 retrieving revision 1.68 diff -C2 -d -r1.67 -r1.68 *** plugin-setup.h 11 Feb 2007 21:41:12 -0000 1.67 --- plugin-setup.h 3 Dec 2007 17:34:07 -0000 1.68 *************** *** 98,102 **** #define STRUCTURES typedef struct area { ! char url[1024]; /* url in smil <area> tag */ char target[128]; /* target in <area> */ int begin; /* begin (seconds) */ --- 98,102 ---- #define STRUCTURES typedef struct area { ! char url[4096]; /* url in smil <area> tag */ char target[128]; /* target in <area> */ int begin; /* begin (seconds) */ *************** *** 105,109 **** typedef struct lnode { ! char url[1024]; // url to media char fname[1024]; // local filename int status; // node status --- 105,109 ---- typedef struct lnode { ! char url[4096]; // url to media char fname[1024]; // local filename int status; // node status Index: plugin.cpp =================================================================== RCS file: /cvsroot/mplayerplug-in/mplayerplug-in/Source/plugin.cpp,v retrieving revision 1.343 retrieving revision 1.344 diff -C2 -d -r1.343 -r1.344 *** plugin.cpp 6 Aug 2007 19:30:24 -0000 1.343 --- plugin.cpp 3 Dec 2007 17:34:08 -0000 1.344 *************** *** 1155,1159 **** // http src url's are automatically requested, so if we request an http here too, we get it twice if (isMms(url, 0)) { ! snprintf(list->url, 1024, "%s", url); state = STATE_STARTED_PLAYER; list->mmsstream = 1; --- 1155,1159 ---- // http src url's are automatically requested, so if we request an http here too, we get it twice if (isMms(url, 0)) { ! snprintf(list->url, 4096, "%s", url); state = STATE_STARTED_PLAYER; list->mmsstream = 1; *************** *** 1165,1169 **** if (fname != NULL) { if (isMms(fname, nomediacache)) { ! snprintf(list->url, 1024, "%s", fname); state = STATE_STARTED_PLAYER; list->mmsstream = 1; --- 1165,1169 ---- if (fname != NULL) { if (isMms(fname, nomediacache)) { ! snprintf(list->url, 4096, "%s", fname); state = STATE_STARTED_PLAYER; list->mmsstream = 1; *************** *** 1183,1187 **** if ((href != NULL) && (url == NULL) && (fname == NULL)) { if (isMms(href, nomediacache)) { ! snprintf(list->url, 1024, "%s", href); state = STATE_STARTED_PLAYER; list->mmsstream = 1; --- 1183,1187 ---- if ((href != NULL) && (url == NULL) && (fname == NULL)) { if (isMms(href, nomediacache)) { ! snprintf(list->url, 4096, "%s", href); state = STATE_STARTED_PLAYER; list->mmsstream = 1; *************** *** 1422,1426 **** if (n->url != NULL && url != NULL) { ! if ((strncmp(n->url, url, 1024) == 0) && href != NULL) { if (srcToButton(n->fname, this)) { n->play = 0; --- 1422,1426 ---- if (n->url != NULL && url != NULL) { ! if ((strncmp(n->url, url, 4096) == 0) && href != NULL) { if (srcToButton(n->fname, this)) { n->play = 0; *************** *** 1429,1433 **** } else { n = newNode(); ! snprintf(n->url, 1024, "%s", href); addToEnd(td->list, n); pthread_mutex_unlock(&playlist_mutex); --- 1429,1433 ---- } else { n = newNode(); ! snprintf(n->url, 4096, "%s", href); addToEnd(td->list, n); pthread_mutex_unlock(&playlist_mutex); *************** *** 1444,1448 **** } else { n = newNode(); ! snprintf(n->url, 1024, "%s", href); addToEnd(td->list, n); pthread_mutex_unlock(&playlist_mutex); --- 1444,1448 ---- } else { n = newNode(); ! snprintf(n->url, 4096, "%s", href); addToEnd(td->list, n); pthread_mutex_unlock(&playlist_mutex); *************** *** 1726,1730 **** } } else { ! snprintf(n->url, 1024, "%s", stream->url); break; } --- 1726,1730 ---- } } else { ! snprintf(n->url, 4096, "%s", stream->url); break; } *************** *** 1743,1752 **** (strncmp (getURLFilename(td->list->url), ! getURLFilename(stream->url), 1024) == 0)) && (mmsstream == 0)) { if (DEBUG) printf("Redirected initial URL\n"); n = list; ! snprintf(n->url, 1024, "%s", stream->url); } } --- 1743,1752 ---- (strncmp (getURLFilename(td->list->url), ! getURLFilename(stream->url), 4096) == 0)) && (mmsstream == 0)) { if (DEBUG) printf("Redirected initial URL\n"); n = list; ! snprintf(n->url, 4096, "%s", stream->url); } } *************** *** 1848,1852 **** stream->url); n = newNode(); ! snprintf(n->url, 1024, "%s", stream->url); if ((nomediacache == 1) && (stream->end > 16384)) { addToEnd(td->list, n); --- 1848,1852 ---- stream->url); n = newNode(); ! snprintf(n->url, 4096, "%s", stream->url); if ((nomediacache == 1) && (stream->end > 16384)) { addToEnd(td->list, n); Index: plugin-support.cpp =================================================================== RCS file: /cvsroot/mplayerplug-in/mplayerplug-in/Source/plugin-support.cpp,v retrieving revision 1.104 retrieving revision 1.105 diff -C2 -d -r1.104 -r1.105 *** plugin-support.cpp 20 Aug 2007 13:51:09 -0000 1.104 --- plugin-support.cpp 3 Dec 2007 17:34:07 -0000 1.105 *************** *** 612,616 **** char *localitem) { ! char tmpdir[1024]; char *tmp; char *item; --- 612,616 ---- char *localitem) { ! char tmpdir[4096]; char *tmp; char *item; *************** *** 623,627 **** tmp = strstr(item, "<"); if (tmp != NULL) { ! strlcpy(item, tmp + 1, 1024); tmp = strstr(item, ">"); if (DEBUG > 1) --- 623,627 ---- tmp = strstr(item, "<"); if (tmp != NULL) { ! strlcpy(item, tmp + 1, 4096); tmp = strstr(item, ">"); if (DEBUG > 1) *************** *** 629,633 **** (tmp - item)); if (tmp != NULL) { ! strlcpy(tmp, "", 1024); } if (DEBUG > 1) --- 629,633 ---- (tmp - item)); if (tmp != NULL) { ! strlcpy(tmp, "", 4096); } if (DEBUG > 1) *************** *** 647,670 **** if (item[0] != '/') { ! strlcpy(tmpdir, item, 1024); // reuse the buffer if (instance->baseurl != NULL) { ! strlcpy(localitem, instance->baseurl, 1024); } else { ! strlcpy(localitem, "", 1024); } ! strlcat(localitem, tmpdir, 1024); } else { if (instance->hostname != NULL) { if (fexists(item) == 0) { ! snprintf(tmpdir, 1024, "http://%s%s", instance->hostname, item); ! strlcpy(localitem, tmpdir, 1024); } else { // first char == / and hostname is null, sounds like a filename ! strlcpy(localitem, item, 1024); } } else { // first char == / and hostname is null, sounds like a filename ! strlcpy(localitem, item, 1024); } } --- 647,670 ---- if (item[0] != '/') { ! strlcpy(tmpdir, item, 4096); // reuse the buffer if (instance->baseurl != NULL) { ! strlcpy(localitem, instance->baseurl, 4096); } else { ! strlcpy(localitem, "", 4096); } ! strlcat(localitem, tmpdir, 4096); } else { if (instance->hostname != NULL) { if (fexists(item) == 0) { ! snprintf(tmpdir, 4096, "http://%s%s", instance->hostname, item); ! strlcpy(localitem, tmpdir, 4096); } else { // first char == / and hostname is null, sounds like a filename ! strlcpy(localitem, item, 4096); } } else { // first char == / and hostname is null, sounds like a filename ! strlcpy(localitem, item, 4096); } } *************** *** 673,677 **** // if :80 is in the URL, cut it out ! strlcpy(localitem, item, 1024); tmp = strstr(localitem, ":8080"); if (tmp == NULL) { --- 673,677 ---- // if :80 is in the URL, cut it out ! strlcpy(localitem, item, 4096); tmp = strstr(localitem, ":8080"); if (tmp == NULL) { *************** *** 679,683 **** if (tmp != NULL) { *tmp = '\0'; ! strlcat(localitem, tmp + 3, 1024); } } --- 679,683 ---- if (tmp != NULL) { *tmp = '\0'; ! strlcat(localitem, tmp + 3, 4096); } } *************** *** 686,691 **** if (strncasecmp(localitem, "file://", 7) == 0) { // chop off file:// ! strlcpy(tmpdir, localitem, 1024); ! strlcpy(localitem, tmpdir + 7, 1024); // replace %20's in url with a space if (strstr(localitem, "%20") != NULL) { --- 686,691 ---- if (strncasecmp(localitem, "file://", 7) == 0) { // chop off file:// ! strlcpy(tmpdir, localitem, 4096); ! strlcpy(localitem, tmpdir + 7, 4096); // replace %20's in url with a space if (strstr(localitem, "%20") != NULL) { *************** *** 701,707 **** // check and see if the file exists, if it does not then prepend smb:// to the filename if (fexists(localitem) == 0) { ! strlcpy(tmpdir, "smb://", 1024); ! strlcat(tmpdir, localitem, 1024); ! strlcpy(localitem, tmpdir, 1024); } --- 701,707 ---- // check and see if the file exists, if it does not then prepend smb:// to the filename if (fexists(localitem) == 0) { ! strlcpy(tmpdir, "smb://", 4096); ! strlcat(tmpdir, localitem, 4096); ! strlcpy(localitem, tmpdir, 4096); } *************** *** 712,716 **** } else { ! strlcpy(localitem, item, 1024); } --- 712,716 ---- } else { ! strlcpy(localitem, item, 4096); } Index: plugin-setup.cpp =================================================================== RCS file: /cvsroot/mplayerplug-in/mplayerplug-in/Source/plugin-setup.cpp,v retrieving revision 1.142 retrieving revision 1.143 diff -C2 -d -r1.142 -r1.143 *** plugin-setup.cpp 15 Nov 2007 13:38:52 -0000 1.142 --- plugin-setup.cpp 3 Dec 2007 17:34:07 -0000 1.143 *************** *** 646,650 **** if (strncasecmp(parameters->argn[i], "qtsrc", 5) == 0) { ! instance->href = (char *)malloc(1024); tmp = rindex(instance->url,'/'); if (tmp) { --- 646,650 ---- if (strncasecmp(parameters->argn[i], "qtsrc", 5) == 0) { ! instance->href = (char *)malloc(4096); tmp = rindex(instance->url,'/'); if (tmp) { |