mvpmc-cvs Mailing List for MediaMVP Media Center
Status: Alpha
Brought to you by:
gettler
You can subscribe to this list here.
2004 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(25) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2005 |
Jan
(39) |
Feb
(47) |
Mar
(30) |
Apr
(61) |
May
(43) |
Jun
(31) |
Jul
(20) |
Aug
(21) |
Sep
(36) |
Oct
(101) |
Nov
(48) |
Dec
(45) |
2006 |
Jan
(16) |
Feb
(23) |
Mar
(2) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: John H. <hon...@us...> - 2006-03-07 00:30:10
|
Update of /cvsroot/mvpmc/mvplib/libreplaytv In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27945 Modified Files: deviceinfoclient.c discovery.c rtvlib.c Log Message: -Fix issues with rtv discovery that I introduced w/ yesterdays checkin. Index: rtvlib.c =================================================================== RCS file: /cvsroot/mvpmc/mvplib/libreplaytv/rtvlib.c,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** rtvlib.c 9 Oct 2005 20:25:15 -0000 1.24 --- rtvlib.c 7 Mar 2006 00:30:04 -0000 1.25 *************** *** 49,52 **** --- 49,53 ---- } else if ( strcmp(rtv_devices.rtv[x].device.ipaddr, ipaddr) == 0 ) { + //printf("%s: existing entry: idx=%d\n", __FUNCTION__, x); return(&(rtv_devices.rtv[x])); //Existing entry } *************** *** 54,57 **** --- 55,59 ---- if ( first_null_idx != -1 ) { *new = 1; + //printf("%s: new entry: idx=%d\n", __FUNCTION__, first_null_idx); return(&(rtv_devices.rtv[first_null_idx])); } Index: deviceinfoclient.c =================================================================== RCS file: /cvsroot/mvpmc/mvplib/libreplaytv/deviceinfoclient.c,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** deviceinfoclient.c 23 Sep 2005 00:51:17 -0000 1.9 --- deviceinfoclient.c 7 Mar 2006 00:30:04 -0000 1.10 *************** *** 224,227 **** --- 224,229 ---- rtv_device_info_t *devinfo; + RTV_DBGLOG(RTVLOG_DSCVR, "%s: Enter: address=%s: current_rtv_cnt=%d\n", __FUNCTION__, address, rtv_devices.num_rtvs); + *device_p = NULL; rtv = rtv_get_device_struct(address, &new_entry); *************** *** 229,232 **** --- 231,235 ---- if ( !(new_entry) ) { + RTV_DBGLOG(RTVLOG_DSCVR, "%s: address=%s already exists in device struct. Decrement count.\n", __FUNCTION__, address); rtv_devices.num_rtvs--; } *************** *** 244,253 **** if ( queryStr == NULL ) { sprintf(url, "http://%s/Device_Descr.xml", address); } else { strncpy(url, queryStr, 511); } - RTV_DBGLOG(RTVLOG_GUIDE, "%s: url=%s\n", __FUNCTION__, url); hc = hc_start_request(url); if (!hc) { --- 247,257 ---- if ( queryStr == NULL ) { sprintf(url, "http://%s/Device_Descr.xml", address); + RTV_DBGLOG(RTVLOG_DSCVR, "%s: Build default query str: %s\n", __FUNCTION__, url); } else { strncpy(url, queryStr, 511); + RTV_DBGLOG(RTVLOG_DSCVR, "%s: Use supplied query str: %s\n", __FUNCTION__, url); } hc = hc_start_request(url); if (!hc) { *************** *** 275,280 **** --- 279,288 ---- } + *device_p = rtv; rtv_devices.num_rtvs++; + if ( RTVLOG_DSCVR ) { + rtv_print_device_info(devinfo); + } return (rc); } Index: discovery.c =================================================================== RCS file: /cvsroot/mvpmc/mvplib/libreplaytv/discovery.c,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** discovery.c 5 Mar 2006 02:31:37 -0000 1.8 --- discovery.c 7 Mar 2006 00:30:04 -0000 1.9 *************** *** 314,317 **** --- 314,318 ---- static int server_process_connection(int fd, const char *socket_ip_addr_str) { + char eos_seq[4] = {'\r', '\n', '\r', '\n'}; int dva_request = 0; *************** *** 330,349 **** // DVArchive running on an aliased IP address sends requests from the primary IP instaed of aliased IP. // ! if ( (len = read(fd, rxbuff, TCP_BUF_SZ)) < 0 ) { ! errno_sav = errno; ! RTV_ERRLOG("%s: read failed: %d=>%s\n", __FUNCTION__, errno_sav, strerror(errno_sav) ); ! return(-errno_sav); } rxbuff[len] = '\0'; RTV_DBGLOG(RTVLOG_DSCVR, "%s: rx=%s\n", __FUNCTION__, rxbuff); if ( (str_p = strstr(rxbuff, X_HOSTADDR_STR)) != NULL ) { // DVArchive. get IP address from X+HOSTADDR string. // ! str_p += strlen(X_HOSTADDR_STR); ! strncpy(ip_addr_str, str_p, INET_ADDRSTRLEN); ! ip_addr_str[INET_ADDRSTRLEN] = '\0'; dva_request = 1; } --- 331,381 ---- // DVArchive running on an aliased IP address sends requests from the primary IP instaed of aliased IP. // ! len = 0; ! while ( 1 ) { ! int rxlen; ! ! if ( (rxlen = read(fd, &(rxbuff[len]), TCP_BUF_SZ-len)) < 0 ) { ! errno_sav = errno; ! RTV_ERRLOG("%s: read failed: %d=>%s\n", __FUNCTION__, errno_sav, strerror(errno_sav) ); ! return(-errno_sav); ! } ! len += rxlen; ! ! if ( len < 4 ) { ! // Too small. bail. ! // ! RTV_ERRLOG("%s: message to small: sz=%d\n", __FUNCTION__, len); ! return(-EILSEQ); ! } ! ! // Check for end of message: \r\n\r\n ! // ! if ( strncmp(&rxbuff[len-4], eos_seq, 4) == 0 ) { ! break; ! } } + // if ( (len = read(fd, rxbuff, TCP_BUF_SZ)) < 0 ) { + // errno_sav = errno; + // RTV_ERRLOG("%s: read failed: %d=>%s\n", __FUNCTION__, errno_sav, strerror(errno_sav) ); + // return(-errno_sav); + // } + rxbuff[len] = '\0'; RTV_DBGLOG(RTVLOG_DSCVR, "%s: rx=%s\n", __FUNCTION__, rxbuff); if ( (str_p = strstr(rxbuff, X_HOSTADDR_STR)) != NULL ) { + char *p2; // DVArchive. get IP address from X+HOSTADDR string. // ! str_p += strlen(X_HOSTADDR_STR); ! if ( (p2 = strchr(str_p, '\r')) == NULL ) { ! RTV_ERRLOG("%s: Invalid x-host string format: (%s)\n", __FUNCTION__, rxbuff); ! return(-EILSEQ); ! } ! ! strncpy(ip_addr_str, str_p, p2-str_p); ! ip_addr_str[p2-str_p] = '\0'; dva_request = 1; } *************** *** 378,382 **** if ( !(dva_request) ) { ! RTV_DBGLOG(RTVLOG_DSCVR, "%s: Dropping Non-DVArchive request\n", __FUNCTION__); return(-ENOTSUP); } --- 410,414 ---- if ( !(dva_request) ) { ! RTV_DBGLOG(RTVLOG_DSCVR, "%s: Dropping Non-DVArchive request: %s\n", __FUNCTION__, ip_addr_str); return(-ENOTSUP); } *************** *** 714,718 **** RTV_DBGLOG(RTVLOG_DSCVR, "%s: ----- http connection from IP: %s ------\n\n", __FUNCTION__, ip_addr); ! if ( server_process_connection(cli_fd, ip_addr) < 0 ) { close(cli_fd); break; --- 746,750 ---- RTV_DBGLOG(RTVLOG_DSCVR, "%s: ----- http connection from IP: %s ------\n\n", __FUNCTION__, ip_addr); ! if ( (errno_sav = server_process_connection(cli_fd, ip_addr)) < 0 ) { close(cli_fd); break; |
From: John H. <hon...@us...> - 2006-03-05 02:31:42
|
Update of /cvsroot/mvpmc/mvplib/libreplaytv In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25889 Modified Files: discovery.c Log Message: -Fix problem with discovering DVArchive when configure to use an IP Alias. Index: discovery.c =================================================================== RCS file: /cvsroot/mvpmc/mvplib/libreplaytv/discovery.c,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** discovery.c 9 Oct 2005 20:25:15 -0000 1.7 --- discovery.c 5 Mar 2006 02:31:37 -0000 1.8 *************** *** 303,313 **** //+*********************************************************************************************** // Name: server_process_connection //+*********************************************************************************************** ! static int server_process_connection(int fd, rtv_device_t *rtv) { ! int errno_sav, len; char rxbuff[TCP_BUF_SZ+1], txbuff[TCP_BUF_SZ+1]; RTV_DBGLOG(RTVLOG_DSCVR, "%s: Enter...\n", __FUNCTION__); if ( (len = read(fd, rxbuff, TCP_BUF_SZ)) < 0 ) { errno_sav = errno; --- 303,333 ---- //+*********************************************************************************************** // Name: server_process_connection + // + // If we don't have a device entry for the requesting address then attempt to get the info. + // Only process the http connection request if it is dvarchive. We need to do this to get dvarchive + // into either RTV 4K or 5K mode. We don't want to respond to a real RTV because it will + // make us show up as a networked RTV. + // //+*********************************************************************************************** ! #define X_USERAGENT_STR "X-User-Agent: " ! #define X_HOSTADDR_STR "X-Host-Addr: " ! static int server_process_connection(int fd, const char *socket_ip_addr_str) { ! int dva_request = 0; ! ! int errno_sav, len, new_entry; char rxbuff[TCP_BUF_SZ+1], txbuff[TCP_BUF_SZ+1]; + rtv_device_t *rtv; + char *str_p; + char ip_addr_str[INET_ADDRSTRLEN+1]; + RTV_DBGLOG(RTVLOG_DSCVR, "%s: Enter...\n", __FUNCTION__); + + // Read the request. + // Attempt to pull IP address from XHOSTADDR string. + // For DVArchive, we need to use the XHOSTADDR IP in the request instead of the socket's IP because + // DVArchive running on an aliased IP address sends requests from the primary IP instaed of aliased IP. + // if ( (len = read(fd, rxbuff, TCP_BUF_SZ)) < 0 ) { errno_sav = errno; *************** *** 317,321 **** rxbuff[len] = '\0'; ! RTV_DBGLOG(RTVLOG_DSCVR, "%s\n", rxbuff); if ( strstr(rxbuff, "Device_Descr.xml") != NULL ) { if ( rtv_globals.rtv_emulate_mode == RTV_DEVICE_4K ) { --- 337,389 ---- rxbuff[len] = '\0'; ! RTV_DBGLOG(RTVLOG_DSCVR, "%s: rx=%s\n", __FUNCTION__, rxbuff); ! ! if ( (str_p = strstr(rxbuff, X_HOSTADDR_STR)) != NULL ) { ! ! // DVArchive. get IP address from X+HOSTADDR string. ! // ! str_p += strlen(X_HOSTADDR_STR); ! strncpy(ip_addr_str, str_p, INET_ADDRSTRLEN); ! ip_addr_str[INET_ADDRSTRLEN] = '\0'; ! dva_request = 1; ! } ! else { ! ! // ReplayTV. Get IP address from socket. ! // ! strcpy(ip_addr_str, socket_ip_addr_str); ! } ! ! ! // See if we have the device-info for the box making the request. ! // If not attempt to get it. ! // ! rtv = rtv_get_device_struct(ip_addr_str, &new_entry); ! if ( new_entry ) { ! RTV_DBGLOG(RTVLOG_DSCVR, "%s (%d): ----- attempt rtv_get_device_info(): for IP=%s ------\n\n", __FUNCTION__, __LINE__, ip_addr_str); ! if ( rtv_get_device_info(ip_addr_str, NULL, &rtv) != 0 ) { ! RTV_ERRLOG("%s: Failed rtv_get_device_info() for IP=%s\n", __FUNCTION__, ip_addr_str); ! return(-EILSEQ); ! } ! ! RTV_DBGLOG(RTVLOG_DSCVR, "%s: rtv_get_device_info() IP=%s: PASSED\n", __FUNCTION__, ip_addr_str); ! if ( atoi(rtv->device.modelNumber) != 4999 ) { ! // Not DVArchive. Go ahead and mark it as discovered. ! // We don't consider DVArchive discovered until it has requested the guide. ! // ! rtv->device.autodiscovered = 1; ! num_rtv_discovered++; ! } ! } ! ! if ( !(dva_request) ) { ! RTV_DBGLOG(RTVLOG_DSCVR, "%s: Dropping Non-DVArchive request\n", __FUNCTION__); ! return(-ENOTSUP); ! } ! ! // Process the http request ! // ! RTV_DBGLOG(RTVLOG_DSCVR, "%s: Processing DVArchive request.\n", __FUNCTION__); ! if ( strstr(rxbuff, "Device_Descr.xml") != NULL ) { if ( rtv_globals.rtv_emulate_mode == RTV_DEVICE_4K ) { *************** *** 386,393 **** memcpy(query_str, pt1, pt2 - pt1); query_str[pt2-pt1] = '\0'; ! RTV_DBGLOG(RTVLOG_DSCVR, "%s: query_str: %s: l=%d\n\n", __FUNCTION__, query_str, strlen(query_str)); // Query the device // if ( (rc = rtv_get_device_info(ip_addr, query_str, &rtv)) == 0 ) { if ( atoi(rtv->device.modelNumber) != 4999 ) { --- 454,463 ---- memcpy(query_str, pt1, pt2 - pt1); query_str[pt2-pt1] = '\0'; ! RTV_DBGLOG(RTVLOG_DSCVR, "%s: resp=%s\n", __FUNCTION__, resp); ! RTV_DBGLOG(RTVLOG_DSCVR, "%s: query_str=%s: l=%d\n\n", __FUNCTION__, query_str, strlen(query_str)); // Query the device // + RTV_DBGLOG(RTVLOG_DSCVR, "%s: attempt rtv_get_device_info() IP=%s\n", __FUNCTION__, ip_addr); if ( (rc = rtv_get_device_info(ip_addr, query_str, &rtv)) == 0 ) { if ( atoi(rtv->device.modelNumber) != 4999 ) { *************** *** 398,401 **** --- 468,475 ---- num_rtv_discovered++; } + RTV_DBGLOG(RTVLOG_DSCVR, "%s: rtv_get_device_info() IP=%s: PASSED\n", __FUNCTION__, ip_addr); + } + else { + RTV_DBGLOG(RTVLOG_DSCVR, "%s: rtv_get_device_info() IP=%s: FAILED\n", __FUNCTION__, ip_addr); } return(rc); *************** *** 425,429 **** int ssdp_sendfd, resp_recvfd, recv_mcastfd, http_listen_fd, cli_fd; ! int tmp, rc, len, errno_sav, new_entry; socklen_t addrlen; struct sockaddr_in ssdp_addr, resp_addr, local_addr, recv_addr, cliaddr; --- 499,503 ---- int ssdp_sendfd, resp_recvfd, recv_mcastfd, http_listen_fd, cli_fd; ! int tmp, rc, len, errno_sav; socklen_t addrlen; struct sockaddr_in ssdp_addr, resp_addr, local_addr, recv_addr, cliaddr; *************** *** 436,440 **** char *uuid_str; time_t tim; - rtv_device_t *rtv; sigset_t sigs; struct timeval tv; --- 510,513 ---- *************** *** 592,626 **** // Process the FD needing attention if ( FD_ISSET(resp_recvfd, &rfds) ) { ! RTV_DBGLOG(RTVLOG_DSCVR, "FSSET: resp_recvfd: %s\n", tm_buf); len = sizeof(recv_addr); rc = recvfrom(resp_recvfd, buff, SSDP_BUF_SZ, 0, (struct sockaddr*)&recv_addr, &len); if ( rc < 1 ) { errno_sav = errno; ! RTV_ERRLOG("recv resp_recvfd: %d=>%s\n", errno_sav, strerror(errno_sav)); goto error; } inet_ntop(AF_INET, &(recv_addr.sin_addr), ip_addr, INET_ADDRSTRLEN); ! RTV_DBGLOG(RTVLOG_DSCVR, "recvfrom IP: %s\n", ip_addr); buff[rc] = '\0'; ! RTV_DBGLOG(RTVLOG_DSCVR, "%s", buff); process_ssdp_response(ip_addr, buff); } else if ( FD_ISSET(recv_mcastfd, &rfds) ) { ! RTV_DBGLOG(RTVLOG_DSCVR, "FSSET: recv_mcastfd: %s\n", tm_buf); len = sizeof(recv_addr); rc = recvfrom(recv_mcastfd, buff, SSDP_BUF_SZ, 0, (struct sockaddr*)&recv_addr, &len); if ( rc < 1 ) { errno_sav = errno; ! RTV_ERRLOG("recv recv_mcastfd: %d=>%s\n", errno_sav, strerror(errno_sav)); goto error; } ! RTV_DBGLOG(RTVLOG_DSCVR, "recvfrom IP: %s\n", inet_ntoa(recv_addr.sin_addr)); buff[rc] = '\0'; ! RTV_DBGLOG(RTVLOG_DSCVR, "%s", buff); } else if ( FD_ISSET(http_listen_fd, &rfds) ) { ! RTV_DBGLOG(RTVLOG_DSCVR, "FSSET: http_listen_fd: %s\n", tm_buf); // Accept the connection --- 665,699 ---- // Process the FD needing attention if ( FD_ISSET(resp_recvfd, &rfds) ) { ! RTV_DBGLOG(RTVLOG_DSCVR, "%s: FDSET: resp_recvfd (SSDP): %s\n", __FUNCTION__, tm_buf); len = sizeof(recv_addr); rc = recvfrom(resp_recvfd, buff, SSDP_BUF_SZ, 0, (struct sockaddr*)&recv_addr, &len); if ( rc < 1 ) { errno_sav = errno; ! RTV_ERRLOG("%s: recv resp_recvfd (SSDP): %d=>%s\n", __FUNCTION__, errno_sav, strerror(errno_sav)); goto error; } inet_ntop(AF_INET, &(recv_addr.sin_addr), ip_addr, INET_ADDRSTRLEN); ! RTV_DBGLOG(RTVLOG_DSCVR, "%s: SSDP recvfrom IP: %s\n", __FUNCTION__, ip_addr); buff[rc] = '\0'; ! RTV_DBGLOG(RTVLOG_DSCVR, "%s: SSDP rx-msg=%s", __FUNCTION__, buff); process_ssdp_response(ip_addr, buff); } else if ( FD_ISSET(recv_mcastfd, &rfds) ) { ! RTV_DBGLOG(RTVLOG_DSCVR, "%s: FDSET: MCAST_FD: %s\n", __FUNCTION__, tm_buf); len = sizeof(recv_addr); rc = recvfrom(recv_mcastfd, buff, SSDP_BUF_SZ, 0, (struct sockaddr*)&recv_addr, &len); if ( rc < 1 ) { errno_sav = errno; ! RTV_ERRLOG("%s: recv MCAST_FD: %d=>%s\n", __FUNCTION__, errno_sav, strerror(errno_sav)); goto error; } ! RTV_DBGLOG(RTVLOG_DSCVR, "%s: MCAST_FD: recvfrom IP: %s\n", __FUNCTION__, inet_ntoa(recv_addr.sin_addr)); buff[rc] = '\0'; ! RTV_DBGLOG(RTVLOG_DSCVR, "%s: MCAST-BUF=%s", __FUNCTION__, buff); } else if ( FD_ISSET(http_listen_fd, &rfds) ) { ! RTV_DBGLOG(RTVLOG_DSCVR, "%s: FDSET: http_listen_fd: %s\n", __FUNCTION__, tm_buf); // Accept the connection *************** *** 641,678 **** RTV_DBGLOG(RTVLOG_DSCVR, "%s: ----- http connection from IP: %s ------\n\n", __FUNCTION__, ip_addr); ! // If we don't have a device entry for this address then attempt to get the info. ! // Only process the connection if it is dvarchive. We need to do this to get dvarchive ! // into either RTV 4K or 5K mode. We don't want to respond to a real RTV because it will ! // make us show up as a networked RTV. ! // ! rtv = rtv_get_device_struct(ip_addr, &new_entry); ! if ( new_entry ) { ! if ( (rc = rtv_get_device_info(ip_addr, NULL, &rtv)) != 0 ) { ! // Just close the fd and don't worry about it. ! // ! close(cli_fd); ! break; ! } ! else { ! // Should have passed with new_entry=0 ! // ! if ( atoi(rtv->device.modelNumber) != 4999 ) { ! // Not DVArchive. Go ahead and mark it as discovered. ! // We don't consider DVArchive discovered until it has requested the guide. ! // ! rtv->device.autodiscovered = 1; ! num_rtv_discovered++; ! close(cli_fd); ! break; ! } ! } ! } ! ! if ( atoi(rtv->device.modelNumber) != 4999 ) { close(cli_fd); break; ! } ! ! server_process_connection(cli_fd, rtv); } else { --- 714,721 ---- RTV_DBGLOG(RTVLOG_DSCVR, "%s: ----- http connection from IP: %s ------\n\n", __FUNCTION__, ip_addr); ! if ( server_process_connection(cli_fd, ip_addr) < 0 ) { close(cli_fd); break; ! } } else { |
From: Jon G. <ge...@us...> - 2006-02-25 17:15:10
|
Update of /cvsroot/mvpmc/mvpmc/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22971/src Modified Files: mythtv.c Log Message: Pop up a gui error if a user attempts to use livetv when libcmyth does not support using livetv with the current version of mythbackend. Index: mythtv.c =================================================================== RCS file: /cvsroot/mvpmc/mvpmc/src/mythtv.c,v retrieving revision 1.96 retrieving revision 1.97 diff -C2 -d -r1.96 -r1.97 *** mythtv.c 25 Feb 2006 05:35:50 -0000 1.96 --- mythtv.c 25 Feb 2006 17:15:01 -0000 1.97 *************** *** 3219,3223 **** if ((c=cmyth_conn_get_free_recorder_count(ctrl)) < 0) { fprintf(stderr, "unable to get free recorder\n"); ! mythtv_shutdown(1); cmyth_release(ctrl); cmyth_dbg(CMYTH_DBG_DEBUG, "%s [%s:%d]: (trace) -2}\n", --- 3219,3225 ---- if ((c=cmyth_conn_get_free_recorder_count(ctrl)) < 0) { fprintf(stderr, "unable to get free recorder\n"); ! if (c == -2) { ! gui_error("LiveTV with this version of MythTV is not supported"); ! } cmyth_release(ctrl); cmyth_dbg(CMYTH_DBG_DEBUG, "%s [%s:%d]: (trace) -2}\n", |
From: Jon G. <ge...@us...> - 2006-02-25 17:12:57
|
Update of /cvsroot/mvpmc/mvplib/libcmyth In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22149/libcmyth Modified Files: connection.c Log Message: Change cmyth_conn_get_free_recorder_count() to return an error if mythbackend is using the new livetv code, since it is not supported at this time. Index: connection.c =================================================================== RCS file: /cvsroot/mvpmc/mvplib/libcmyth/connection.c,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** connection.c 20 Nov 2005 06:55:15 -0000 1.26 --- connection.c 25 Feb 2006 17:12:48 -0000 1.27 *************** *** 1022,1025 **** --- 1022,1032 ---- } + if (conn->conn_version >= 20) { + cmyth_dbg(CMYTH_DBG_ERROR, + "%s: LiveTV not supported with myth protocol %lu\n", + __FUNCTION__, conn->conn_version); + return -2; + } + pthread_mutex_lock(&mutex); |
From: Jon G. <ge...@us...> - 2006-02-25 05:35:52
|
Update of /cvsroot/mvpmc/mvpmc/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14671/src Modified Files: mythtv.c Log Message: Fix a bug in load_episodes() that was causing the entire recorded programs list to be leaked each time it was reloaded. Index: mythtv.c =================================================================== RCS file: /cvsroot/mvpmc/mvpmc/src/mythtv.c,v retrieving revision 1.95 retrieving revision 1.96 diff -C2 -d -r1.95 -r1.96 *** mythtv.c 16 Feb 2006 01:11:40 -0000 1.95 --- mythtv.c 25 Feb 2006 05:35:50 -0000 1.96 *************** *** 387,390 **** --- 387,392 ---- gui_error("MythTV connection lost!"); } + + cmyth_alloc_show(); } *************** *** 693,697 **** cmyth_dbg(CMYTH_DBG_DEBUG, "%s [%s:%d]: (trace) {\n", __FUNCTION__, __FILE__, __LINE__); ! if ((episode_plist == NULL) || episode_dirty) { ep_list = cmyth_proglist_get_all_recorded(ctrl); CHANGE_GLOBAL_REF(episode_plist, ep_list); --- 695,701 ---- cmyth_dbg(CMYTH_DBG_DEBUG, "%s [%s:%d]: (trace) {\n", __FUNCTION__, __FILE__, __LINE__); ! if ((ep_list == NULL) || episode_dirty) { ! if (ep_list) ! cmyth_release(ep_list); ep_list = cmyth_proglist_get_all_recorded(ctrl); CHANGE_GLOBAL_REF(episode_plist, ep_list); *************** *** 706,719 **** } else { fprintf(stderr, "Using cached episode data\n"); - ep_list = cmyth_hold(episode_plist); } fprintf(stderr, "'cmyth_proglist_get_all_recorded' worked\n"); ! count = cmyth_proglist_get_count(episode_plist); /* Sort on first load and when setting changes or list update makes the sort dirty */ if(mythtv_sort_dirty) { printf("Sort for Dirty List\n"); ! cmyth_proglist_sort(episode_plist, count, mythtv_sort); mythtv_sort_dirty = 0; } --- 710,722 ---- } else { fprintf(stderr, "Using cached episode data\n"); } fprintf(stderr, "'cmyth_proglist_get_all_recorded' worked\n"); ! count = cmyth_proglist_get_count(ep_list); /* Sort on first load and when setting changes or list update makes the sort dirty */ if(mythtv_sort_dirty) { printf("Sort for Dirty List\n"); ! cmyth_proglist_sort(ep_list, count, mythtv_sort); mythtv_sort_dirty = 0; } *************** *** 726,730 **** cmyth_proginfo_t prog; ! prog = cmyth_proglist_get_item(episode_plist, i); recgroup = cmyth_proginfo_recgroup(prog); --- 729,733 ---- cmyth_proginfo_t prog; ! prog = cmyth_proglist_get_item(ep_list, i); recgroup = cmyth_proginfo_recgroup(prog); *************** *** 735,742 **** --- 738,749 ---- } + cmyth_release(ep_list); + cmyth_release(ctrl); + return count; err: cmyth_release(ep_list); + cmyth_release(ctrl); cmyth_dbg(CMYTH_DBG_DEBUG, "%s [%s:%d]: (trace) }\n", __FUNCTION__, __FILE__, __LINE__); *************** *** 2784,2787 **** --- 2791,2796 ---- cmyth_dbg(CMYTH_DBG_DEBUG, "%s [%s:%d]: (trace) }\n", __FUNCTION__, __FILE__, __LINE__); + + cmyth_alloc_show(); } |
From: Jon G. <ge...@us...> - 2006-02-25 05:33:36
|
Update of /cvsroot/mvpmc/mvplib/include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12484/include Modified Files: cmyth.h Log Message: Add some more debug code to the libcmyth allocator, so it can display the file and line number of each allocation. Index: cmyth.h =================================================================== RCS file: /cvsroot/mvpmc/mvplib/include/cmyth.h,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -d -r1.37 -r1.38 *** cmyth.h 29 Jan 2006 02:32:23 -0000 1.37 --- cmyth.h 25 Feb 2006 05:33:32 -0000 1.38 *************** *** 105,112 **** extern void *cmyth_hold(void *p); extern char *cmyth_strdup(char *str); ! extern void *cmyth_allocate(size_t len); extern void *cmyth_reallocate(void *p, size_t len); typedef void (*destroy_t)(void *p); extern void cmyth_set_destroy(void *block, destroy_t func); --- 105,119 ---- extern void *cmyth_hold(void *p); extern char *cmyth_strdup(char *str); ! extern void *cmyth_allocate_data(size_t len, const char *file, const char *func, int line); extern void *cmyth_reallocate(void *p, size_t len); typedef void (*destroy_t)(void *p); extern void cmyth_set_destroy(void *block, destroy_t func); + extern void cmyth_alloc_show(void); + + #if defined(DEBUG) + #define cmyth_allocate(x) cmyth_allocate_data(x, __FILE__, __FUNCTION__, __LINE__) + #else + #define cmyth_allocate(x) cmyth_allocate_data(x, NULL, NULL, 0) + #endif |
From: Jon G. <ge...@us...> - 2006-02-25 05:33:35
|
Update of /cvsroot/mvpmc/mvplib/libcmyth In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12484/libcmyth Modified Files: alloc.c Log Message: Add some more debug code to the libcmyth allocator, so it can display the file and line number of each allocation. Index: alloc.c =================================================================== RCS file: /cvsroot/mvpmc/mvplib/libcmyth/alloc.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** alloc.c 16 Dec 2005 03:58:02 -0000 1.3 --- alloc.c 25 Feb 2006 05:33:32 -0000 1.4 *************** *** 79,82 **** --- 79,86 ---- #ifdef DEBUG unsigned int magic; + struct refcounter *next; + const char *file; + const char *func; + int line; #endif /* DEBUG */ cmyth_atomic_t refcount; *************** *** 94,97 **** --- 98,198 ---- #define CMYTH_DATA(r) (((unsigned char *)(r)) + sizeof(refcounter_t)) + #if defined(DEBUG) + #define CMYTH_ALLOC_BINS 101 + static refcounter_t *ref_list[CMYTH_ALLOC_BINS]; + #endif /* DEBUG */ + + #if defined(DEBUG) + static inline void + cmyth_ref_remove(refcounter_t *ref) + { + int bin; + refcounter_t *r, *p; + + bin = ((unsigned long)ref >> 2) % CMYTH_ALLOC_BINS; + + r = ref_list[bin]; + p = NULL; + + while (r && (r != ref)) { + p = r; + r = r->next; + } + + assert(r == ref); + + if (p) { + p->next = r->next; + } else { + ref_list[bin] = r->next; + } + } + + static inline void + cmyth_ref_add(refcounter_t *ref) + { + int bin; + + bin = ((unsigned long)ref >> 2) % CMYTH_ALLOC_BINS; + + ref->next = ref_list[bin]; + ref_list[bin] = ref; + } + + static struct alloc_type { + const char *file; + const char *func; + int line; + int count; + } alloc_list[128]; + + void + cmyth_alloc_show(void) + { + int i, j; + int types = 0, bytes = 0, count = 0; + refcounter_t *r; + + for (i=0; i<CMYTH_ALLOC_BINS; i++) { + r = ref_list[i]; + + while (r) { + for (j=0; (j<types) && (j<128); j++) { + if ((alloc_list[j].file == r->file) && + (alloc_list[j].func == r->func) && + (alloc_list[j].line == r->line)) { + alloc_list[j].count++; + break; + } + } + if (j == types) { + alloc_list[j].file = r->file; + alloc_list[j].func = r->func; + alloc_list[j].line = r->line; + alloc_list[j].count = 1; + types++; + } + bytes += r->length + sizeof(*r); + count++; + r = r->next; + } + } + + printf("cmyth allocation count: %d\n", count); + printf("cmyth allocation bytes: %d\n", bytes); + printf("cmyth unique allocation types: %d\n", types); + for (i=0; i<types; i++) { + printf("ALLOC: %s %s():%d count %d\n", + alloc_list[i].file, alloc_list[i].func, + alloc_list[i].line, alloc_list[i].count); + } + } + #else + void + cmyth_alloc_show(void) + { + } + #endif /* DEBUG */ + /* * cmyth_allocate(size_t len) *************** *** 113,117 **** */ void * ! cmyth_allocate(size_t len) { #ifdef DEBUG --- 214,218 ---- */ void * ! cmyth_allocate_data(size_t len, const char *file, const char *func, int line) { #ifdef DEBUG *************** *** 131,137 **** --- 232,242 ---- #ifdef DEBUG ref->magic = ALLOC_MAGIC; + ref->file = file; + ref->func = func; + ref->line = line; guard = (guard_t*)((unsigned long)block + sizeof(refcounter_t) + len); guard->magic = GUARD_MAGIC; + cmyth_ref_add(ref); #endif /* DEBUG */ ref->destroy = NULL; *************** *** 358,361 **** --- 463,468 ---- ref->magic = 0; guard->magic = 0; + cmyth_ref_remove(ref); + ref->next = NULL; #endif /* DEBUG */ free(block); |
From: Jon G. <ge...@us...> - 2006-02-16 03:04:27
|
Update of /cvsroot/mvpmc/mvpmc/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32654/src Modified Files: config.c config.h gui.c main.c Log Message: Add the VFD display type setting to the config file, and cause the project name to be displayed on the VFD earlier in startup. Index: config.h =================================================================== RCS file: /cvsroot/mvpmc/mvpmc/src/config.h,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** config.h 10 Feb 2006 13:46:00 -0000 1.11 --- config.h 16 Feb 2006 03:04:19 -0000 1.12 *************** *** 60,63 **** --- 60,64 ---- #define CONFIG_MYTHTV_RECGROUP 0x00800000 #define CONFIG_STARTUP_SELECT 0x01000000 + #define CONFIG_DISPLAY_TYPE 0x02000000 #define MYTHTV_RG_MAX 32 *************** *** 99,102 **** --- 100,104 ---- config_mythtv_rg_t mythtv_recgroup[MYTHTV_RG_MAX]; int startup_selection; + int display_type; } config_t; *************** *** 131,134 **** --- 133,137 ---- #define CONFIG_ITEM_MYTHTV_RG_HIDE 0x0018 #define CONFIG_ITEM_MYTHTV_RG_SHOW 0x0019 + #define CONFIG_ITEM_DISPLAY_TYPE 0x0020 /* Index: gui.c =================================================================== RCS file: /cvsroot/mvpmc/mvpmc/src/gui.c,v retrieving revision 1.100 retrieving revision 1.101 diff -C2 -d -r1.100 -r1.101 *** gui.c 16 Feb 2006 01:11:40 -0000 1.100 --- gui.c 16 Feb 2006 03:04:19 -0000 1.101 *************** *** 3411,3414 **** --- 3411,3417 ---- mvpw_check_menu_item(settings_check, key, 1); display_type = (int)key; + + config->bitmask |= CONFIG_DISPLAY_TYPE; + config->display_type = (int)key; } Index: config.c =================================================================== RCS file: /cvsroot/mvpmc/mvpmc/src/config.c,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** config.c 10 Feb 2006 13:46:00 -0000 1.11 --- config.c 16 Feb 2006 03:04:19 -0000 1.12 *************** *** 51,54 **** --- 51,55 ---- #include "mvpmc.h" #include "mclient.h" + #include "display.h" #include "config.h" *************** *** 268,271 **** --- 269,273 ---- ITEM_FIXED(MYTHTV_SORT, mythtv_sort); ITEM_FIXED(MYTHTV_PROGRAMS, mythtv_programs); + ITEM_FIXED(DISPLAY_TYPE, display_type); case CONFIG_ITEM_MYTHTV_RG_HIDE: if ((config->bitmask & CONFIG_MYTHTV_RECGROUP) == 0) *************** *** 391,394 **** --- 393,397 ---- ITEM_FIXED(MYTHTV_SORT, mythtv_sort); ITEM_FIXED(MYTHTV_PROGRAMS, mythtv_programs); + ITEM_FIXED(DISPLAY_TYPE, display_type); case CONFIG_ITEM_MYTHTV_RG_HIDE: case CONFIG_ITEM_MYTHTV_RG_SHOW: *************** *** 491,494 **** --- 494,499 ---- if (add_item(list, CONFIG_ITEM_MYTHTV_RG_SHOW) < 0) goto err; + if (add_item(list, CONFIG_ITEM_DISPLAY_TYPE) < 0) + goto err; list->crc = 0; *************** *** 592,595 **** --- 597,602 ---- if (config->bitmask & CONFIG_STARTUP_SELECT) startup_selection = config->startup_selection; + if (config->bitmask & CONFIG_DISPLAY_TYPE) + display_type = config->display_type; } Index: main.c =================================================================== RCS file: /cvsroot/mvpmc/mvpmc/src/main.c,v retrieving revision 1.62 retrieving revision 1.63 diff -C2 -d -r1.62 -r1.63 *** main.c 15 Feb 2006 15:36:19 -0000 1.62 --- main.c 16 Feb 2006 03:04:19 -0000 1.63 *************** *** 836,844 **** audio_start, NULL); - if (gui_init(mythtv_server, replaytv_server) < 0) { - fprintf(stderr, "failed to initialize gui!\n"); - exit(1); - } - #ifndef MVPMC_HOST if (display_init() < 0) { --- 836,839 ---- *************** *** 848,851 **** --- 843,851 ---- #endif + if (gui_init(mythtv_server, replaytv_server) < 0) { + fprintf(stderr, "failed to initialize gui!\n"); + exit(1); + } + if (music_client() < 0) { fprintf(stderr, "failed to start up music client!\n"); |
From: Jon G. <ge...@us...> - 2006-02-16 01:11:48
|
Update of /cvsroot/mvpmc/mvpmc/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30268/src Modified Files: gui.c mvpmc.h mythtv.c video.c Log Message: Add support from Brian Prather for changing channels in myth livetv via the number keys on the remote. Index: mythtv.c =================================================================== RCS file: /cvsroot/mvpmc/mvpmc/src/mythtv.c,v retrieving revision 1.94 retrieving revision 1.95 diff -C2 -d -r1.94 -r1.95 *** mythtv.c 2 Feb 2006 05:31:46 -0000 1.94 --- mythtv.c 16 Feb 2006 01:11:40 -0000 1.95 *************** *** 2858,2861 **** --- 2858,2863 ---- switch_hw_state(MVPMC_STATE_MYTHTV); + mythtv_clear_channel(); + if (mythtv_ringbuf) video_functions = &file_functions; Index: video.c =================================================================== RCS file: /cvsroot/mvpmc/mvpmc/src/video.c,v retrieving revision 1.75 retrieving revision 1.76 diff -C2 -d -r1.75 -r1.76 *** video.c 29 Jan 2006 15:38:29 -0000 1.75 --- video.c 16 Feb 2006 01:11:40 -0000 1.76 *************** *** 561,582 **** void ! video_callback(mvp_widget_t *widget, char key) { ! int jump; ! long long offset, size; ! pts_sync_data_t async, vsync; ! ! if (!video_playing) ! return; ! ! if ( video_functions->key != NULL ) { ! if ( video_functions->key(key) == 1 ) { ! return; ! } ! } ! ! switch (key) { ! case MVPW_KEY_STOP: ! case MVPW_KEY_EXIT: disable_osd(); if ( !running_replaytv ) { --- 561,567 ---- void ! back_to_guide_menu() { ! disable_osd(); if ( !running_replaytv ) { *************** *** 661,665 **** --- 646,674 ---- } mvpw_expose(root); + } + + + void + video_callback(mvp_widget_t *widget, char key) + { + int jump; + long long offset, size; + pts_sync_data_t async, vsync; + + if (!video_playing) + return; + + if ( video_functions->key != NULL ) { + if ( video_functions->key(key) == 1 ) { + return; + } + } + + switch (key) { + case MVPW_KEY_STOP: + case MVPW_KEY_EXIT: + back_to_guide_menu(); break; + case MVPW_KEY_PAUSE: if (av_pause()) { *************** *** 765,777 **** break; case MVPW_KEY_ZERO ... MVPW_KEY_NINE: ! size = video_functions->size(); ! jump_target = -1; ! jumping = 1; ! pthread_kill(video_write_thread, SIGURG); ! pthread_kill(audio_write_thread, SIGURG); ! jump = key; ! jump_target = size * (jump / 10.0); ! pthread_cond_broadcast(&video_cond); ! timed_osd(seek_osd_timeout*1000); break; case MVPW_KEY_MENU: --- 774,791 ---- break; case MVPW_KEY_ZERO ... MVPW_KEY_NINE: ! if (mythtv_livetv) { ! back_to_guide_menu(); ! mythtv_key_callback(mythtv_browser, key); ! } else { ! size = video_functions->size(); ! jump_target = -1; ! jumping = 1; ! pthread_kill(video_write_thread, SIGURG); ! pthread_kill(audio_write_thread, SIGURG); ! jump = key; ! jump_target = size * (jump / 10.0); ! pthread_cond_broadcast(&video_cond); ! timed_osd(seek_osd_timeout*1000); ! } break; case MVPW_KEY_MENU: Index: mvpmc.h =================================================================== RCS file: /cvsroot/mvpmc/mvpmc/src/mvpmc.h,v retrieving revision 1.75 retrieving revision 1.76 diff -C2 -d -r1.75 -r1.76 *** mvpmc.h 10 Feb 2006 13:46:00 -0000 1.75 --- mvpmc.h 16 Feb 2006 01:11:40 -0000 1.76 *************** *** 127,130 **** --- 127,132 ---- extern mvp_widget_t *mythtv_record; extern mvp_widget_t *mythtv_popup; + extern void mythtv_clear_channel(); + extern void mythtv_key_callback(mvp_widget_t *widget, char key); extern mvp_widget_t *root; extern mvp_widget_t *iw; Index: gui.c =================================================================== RCS file: /cvsroot/mvpmc/mvpmc/src/gui.c,v retrieving revision 1.99 retrieving revision 1.100 diff -C2 -d -r1.99 -r1.100 *** gui.c 10 Feb 2006 15:19:21 -0000 1.99 --- gui.c 16 Feb 2006 01:11:40 -0000 1.100 *************** *** 901,904 **** --- 901,907 ---- volatile int screensaver_default = -1; + int chan_digit_cnt = 0; + char chan_num[4] = "\0\0\0"; + enum { EDGE_TOP = 0, *************** *** 2200,2207 **** } ! static void mythtv_key_callback(mvp_widget_t *widget, char key) { ! if (key == MVPW_KEY_EXIT) { if (mythtv_state == MYTHTV_STATE_LIVETV) { printf("return from livetv to myth main menu!\n"); --- 2203,2220 ---- } ! ! void mythtv_key_callback(mvp_widget_t *widget, char key) { ! ! // if we are changing channel based number keys then need to backup ! // one digit if we get exit key ! if (key == MVPW_KEY_EXIT && chan_digit_cnt > 0) ! { ! chan_digit_cnt--; ! chan_num[chan_digit_cnt] = '\0'; ! mvpw_select_via_text(widget,chan_num); ! } ! else if (key == MVPW_KEY_EXIT) { if (mythtv_state == MYTHTV_STATE_LIVETV) { printf("return from livetv to myth main menu!\n"); *************** *** 2216,2219 **** --- 2229,2233 ---- mythtv_main_menu = 1; mythtv_state = MYTHTV_STATE_MAIN; + mythtv_clear_channel(); } else { mythtv_popup = NULL; *************** *** 2319,2330 **** case MVPW_KEY_PAUSE: case MVPW_KEY_MUTE: - case MVPW_KEY_ZERO ... MVPW_KEY_NINE: case MVPW_KEY_VOL_UP: case MVPW_KEY_VOL_DOWN: video_callback(widget, key); break; } } static void mythtv_popup_key_callback(mvp_widget_t *widget, char key) --- 2333,2368 ---- case MVPW_KEY_PAUSE: case MVPW_KEY_MUTE: case MVPW_KEY_VOL_UP: case MVPW_KEY_VOL_DOWN: video_callback(widget, key); break; + case MVPW_KEY_ZERO ... MVPW_KEY_NINE: + //BKP change to allow digit based channel selection + printf("In mythtv_key_callback and got number key %c \n",key); + if(mythtv_state == MYTHTV_STATE_LIVETV) + { + if( chan_digit_cnt < (sizeof(chan_num) -1)) + { + // BKP add ifdef host thing because on host key is a ascii 9 !!! + chan_num[chan_digit_cnt++] = '0'+key; + mvpw_select_via_text(widget,chan_num); + } + } + else + { + video_callback(widget, key); + } + + break; } } + + void mythtv_clear_channel() + { + chan_digit_cnt = 0; + memset(chan_num,'\0',sizeof(chan_num)); + } + static void mythtv_popup_key_callback(mvp_widget_t *widget, char key) |
From: Jon G. <ge...@us...> - 2006-02-16 01:07:48
|
Update of /cvsroot/mvpmc/mvplib/include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29737/include Modified Files: mvp_widget.h Log Message: Patch to add mvpw_select_via_text() from Brian Prather. Index: mvp_widget.h =================================================================== RCS file: /cvsroot/mvpmc/mvplib/include/mvp_widget.h,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -d -r1.36 -r1.37 *** mvp_widget.h 13 Nov 2005 16:35:03 -0000 1.36 --- mvp_widget.h 16 Feb 2006 01:07:37 -0000 1.37 *************** *** 161,164 **** --- 161,167 ---- uint32_t bg, uint32_t border_color, int border_size); + extern void mvpw_select_via_text(mvp_widget_t *widget, char text[]); + + extern void mvpw_set_menu_attr(mvp_widget_t *widget, mvpw_menu_attr_t *attr); extern void mvpw_get_menu_attr(mvp_widget_t *widget, mvpw_menu_attr_t *attr); |
From: Jon G. <ge...@us...> - 2006-02-16 01:07:48
|
Update of /cvsroot/mvpmc/mvplib/libwidget In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29737/libwidget Modified Files: menu.c Log Message: Patch to add mvpw_select_via_text() from Brian Prather. Index: menu.c =================================================================== RCS file: /cvsroot/mvpmc/mvplib/libwidget/menu.c,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** menu.c 21 Dec 2005 05:02:56 -0000 1.24 --- menu.c 16 Feb 2006 01:07:37 -0000 1.25 *************** *** 166,169 **** --- 166,194 ---- } + // BKP added to allow selection of menu item by lable + void + mvpw_select_via_text(mvp_widget_t *widget, char text[]) + { + int i; + char *str; + + for (i=0; i<widget->data.menu.nitems; i++) + { + str = widget->data.menu.items[i].label; + if( strncmp( str, text, strlen(text)) == 0) + { + break; + } + } + if ( i < widget->data.menu.nitems) + { + hilite_item(widget,widget->data.menu.current,0); + widget->data.menu.current = i; + change_items(widget,i); + hilite_item(widget,widget->data.menu.current,1); + } + } + + static void key(mvp_widget_t *widget, char c) |
From: Rick S. <st...@us...> - 2006-02-15 15:36:29
|
Update of /cvsroot/mvpmc/mvpmc/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11413/mvpmc/src Modified Files: display.c fb.c main.c Log Message: Added new arguments to "--startup" feature such that the directory the filesystem starts in can now be specified: /bin/mvpmc --startup filesystem:file=/mnt/audio/rock Fix problem with small local display (VFD) such that mclient data is properly displayed: /bin/mvpmc -d IEE16x1 -c 192.168.0.10 --startup mclient Index: display.c =================================================================== RCS file: /cvsroot/mvpmc/mvpmc/src/display.c,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** display.c 10 Feb 2006 15:19:21 -0000 1.5 --- display.c 15 Feb 2006 15:36:19 -0000 1.6 *************** *** 1472,1476 **** { ! char total_line1_and_line2[100]; #if 0 --- 1472,1476 ---- { ! static char total_line1_and_line2[100]; #if 0 Index: main.c =================================================================== RCS file: /cvsroot/mvpmc/mvpmc/src/main.c,v retrieving revision 1.61 retrieving revision 1.62 diff -C2 -d -r1.61 -r1.62 *** main.c 10 Feb 2006 13:46:00 -0000 1.61 --- main.c 15 Feb 2006 15:36:19 -0000 1.62 *************** *** 71,74 **** --- 71,77 ---- int reboot_disable = 0; int filebrowser_disable = 0; + + extern char cwd[]; + /* * Let's use the "exit" option for "no startup *************** *** 348,351 **** --- 351,357 ---- #endif + char *optparm; + char optarg_tmp[1024]; + /* * Initialize to a known state before *************** *** 418,421 **** --- 424,439 ---- switch (c) { case 0: + /* + * Copy the parsed argument and look for + * parameters (which follow the ':' char). + */ + snprintf(optarg_tmp,1024,"%s",optarg); + optparm = NULL; + optparm = strchr(optarg_tmp,':'); + if (optparm != NULL) { + *optparm = 0; + optparm++; + } + if (strcmp(opts[opt_index].name, "no-settings") == 0) { settings_disable = 1; *************** *** 427,461 **** filebrowser_disable = 1; } ! if (strcmp (opts[opt_index].name, "startup") == 0) ! { ! if (strcmp (optarg, "replaytv") == 0) ! { ! startup_this_feature = MM_REPLAYTV; ! } ! else if (strcmp (optarg, "mythtv") == 0) ! { ! startup_this_feature = MM_MYTHTV; ! } ! else if (strcmp (optarg, "mclient") == 0) ! { ! startup_this_feature = MM_MCLIENT; ! } ! else if (strcmp (optarg, "vnc") == 0) ! { ! startup_this_feature = MM_VNC; ! } ! else if (strcmp (optarg, "settings") == 0) ! { ! startup_this_feature = MM_SETTINGS; ! } ! else if (strcmp (optarg, "about") == 0) ! { ! startup_this_feature = MM_ABOUT; ! } ! else if (strcmp (optarg, "filesystem") == 0) ! { ! startup_this_feature = MM_FILESYSTEM; ! } ! } break; case 'a': --- 445,483 ---- filebrowser_disable = 1; } ! if (strcmp (opts[opt_index].name, "startup") == 0) { ! /* ! * Decode the "startup" option parameter. ! */ ! if (strcmp (optarg_tmp, "replaytv") == 0) { ! startup_this_feature = MM_REPLAYTV; ! } ! else if (strcmp (optarg_tmp, "mythtv") == 0) { ! startup_this_feature = MM_MYTHTV; ! } ! else if (strcmp (optarg_tmp, "mclient") == 0) { ! startup_this_feature = MM_MCLIENT; ! } ! else if (strcmp (optarg_tmp, "vnc") == 0) { ! startup_this_feature = MM_VNC; ! } ! else if (strcmp (optarg_tmp, "settings") == 0) { ! startup_this_feature = MM_SETTINGS; ! } ! else if (strcmp (optarg_tmp, "about") == 0) { ! startup_this_feature = MM_ABOUT; ! } ! else if (strcmp (optarg_tmp, "filesystem") == 0) { ! startup_this_feature = MM_FILESYSTEM; ! /* ! * Decode the "filesystem" option parameter. ! */ ! if(optparm != NULL) { ! if (strncmp (optparm, "file=", strlen("file=")) == 0) { ! optparm += strlen("file="); ! snprintf(cwd,1024,"%s",optparm); ! } ! } ! } ! } break; case 'a': Index: fb.c =================================================================== RCS file: /cvsroot/mvpmc/mvpmc/src/fb.c,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** fb.c 2 Feb 2006 05:16:04 -0000 1.27 --- fb.c 15 Feb 2006 15:36:19 -0000 1.28 *************** *** 48,52 **** }; ! static char cwd[1024] = "/"; static void add_dirs(mvp_widget_t*); --- 48,52 ---- }; ! char cwd[1024] = "/"; static void add_dirs(mvp_widget_t*); |
From: Jon G. <ge...@us...> - 2006-02-15 03:07:32
|
Update of /cvsroot/mvpmc/mvpmc/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14855/src Modified Files: audio.c Log Message: http streaming patch from Martin Vallevand: - bug fix would stream and attempt to play unsupported audio types - support for http servers that send two http 200 level responses to one GET (required restructuring the code a bit) - redirection of http 301 responses - podcast title osd. - old icecast server osd - more osd error messages (ie empty playlist, which are frequent of shoutcast) - first hostname used is defined by m3u then from the gethostname() icecast wants to see the alias. Index: audio.c =================================================================== RCS file: /cvsroot/mvpmc/mvpmc/src/audio.c,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** audio.c 3 Feb 2006 06:02:57 -0000 1.21 --- audio.c 15 Feb 2006 03:07:21 -0000 1.22 *************** *** 1011,1016 **** mvpw_set_timer(playlist_widget, NULL, 0); - mvpw_hide(playlist_widget); mvpw_hide(fb_progress); video_set_root(); mvpw_focus(root); --- 1011,1016 ---- mvpw_set_timer(playlist_widget, NULL, 0); mvpw_hide(fb_progress); + mvpw_hide(playlist_widget); video_set_root(); mvpw_focus(root); *************** *** 1051,1054 **** --- 1051,1058 ---- CONTENT_UNKNOWN, CONTENT_REDIRECT, + CONTENT_200, + CONTENT_UNSUPPORTED, + CONTENT_ERROR, + CONTENT_TRYHOST, } content_type_t; *************** *** 1062,1068 **** typedef enum { HTTP_INIT, ! HTTP_RESPONSE, ! HTTP_DATA, ! HTTP_PARSE, HTTP_RETRY, HTTP_UNKNOWN, --- 1066,1071 ---- typedef enum { HTTP_INIT, ! HTTP_HEADER, ! HTTP_CONTENT, HTTP_RETRY, HTTP_UNKNOWN, *************** *** 1111,1114 **** --- 1114,1118 ---- #define GET_STRING "GET %s HTTP/1.0\r\nHost: %s\r\nUser-Agent: WinampMPEG/5.1\r\nAccept: */*\r\nIcy-MetaData:1\r\nConnection: close\r\n\r\n" + #define GET_M3U "GET %s HTTP/1.0\r\nHost: %s\r\nUser-Agent: WinampMPEG/5.1\r\nAccept: */*\r\n\r\n" #define GET_LIVE365 "GET /cgi-bin/api_login.cgi?action=login&org=live365&remember=Y&member_name=%s HTTP/1.0\r\nUser-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8) Gecko/20051111 Firefox/1.5 \r\nHost: www.live365.com\r\nAccept: */*\r\nConnection: Keep-Alive\r\n\r\n" *************** *** 1218,1222 **** int counter=0; ! int NumberOfEntries=1; int curNumberOfEntries=0; int live365Login = 0; --- 1222,1226 ---- int counter=0; ! int NumberOfEntries=0; int curNumberOfEntries=0; int live365Login = 0; *************** *** 1240,1243 **** --- 1244,1249 ---- static char * ContentAudio[] = {"audio/mpeg","audio/x-mpeg","audio/mpg",NULL}; + FILE * instream; + char *rcs; retcode = 1; *************** *** 1252,1266 **** http_state_type_t stateGet = HTTP_UNKNOWN; snprintf(url[0],MAX_URL_LEN,"%s",current); curNumberOfEntries = 1; while (retcode == 1 && ++counter < 5 ) { if ( curNumberOfEntries <= 0 ) { ! mvpw_set_text_str(fb_name, "Invalid playlist"); // no valid http in playlist retcode = -1; ! continue; } --- 1258,1275 ---- http_state_type_t stateGet = HTTP_UNKNOWN; + ContentType = CONTENT_UNKNOWN; snprintf(url[0],MAX_URL_LEN,"%s",current); curNumberOfEntries = 1; + NumberOfEntries=1; + shoutcastDisplay[0]=0; while (retcode == 1 && ++counter < 5 ) { if ( curNumberOfEntries <= 0 ) { ! mvpw_set_text_str(fb_name, "Empty playlist"); // no valid http in playlist retcode = -1; ! break; } *************** *** 1307,1313 **** // printf("%s\n",remoteHost->h_name); if (remoteHost!=NULL) { ! if (live365Login == 0 ) { ! snprintf(get_buf,MAX_URL_LEN,GET_STRING,scpage,remoteHost->h_name); } else { if (snprintf(get_buf,MAX_URL_LEN,GET_LIVE365,getenv("LIVE365DATA")) >= MAX_URL_LEN-1) { --- 1316,1330 ---- // printf("%s\n",remoteHost->h_name); if (remoteHost!=NULL) { ! if (live365Login == 0 ) { ! if (NumberOfEntries==1 && strcmp(remoteHost->h_name,scname)) { ! snprintf(url[1],MAX_URL_LEN,"http://%s:%s%s",remoteHost->h_name,scport,scpage); ! NumberOfEntries=2; ! } ! if (strstr(scpage,".m3u")==NULL ) { ! snprintf(get_buf,MAX_URL_LEN,GET_STRING,scpage,scname); ! } else { ! snprintf(get_buf,MAX_URL_LEN,GET_M3U,scpage,scname); ! } } else { if (snprintf(get_buf,MAX_URL_LEN,GET_LIVE365,getenv("LIVE365DATA")) >= MAX_URL_LEN-1) { *************** *** 1316,1320 **** } } ! // printf("%s %s\n",scname,get_buf); --- 1333,1337 ---- } } ! // printf("%s\n%s\n",scname,get_buf); *************** *** 1330,1335 **** int optionsize = sizeof(stream_tv); setsockopt(httpsock, SOL_SOCKET, SO_SNDTIMEO, &stream_tv, optionsize); - // printf("Option = %d\n",option); - mvpw_set_text_str(fb_name, "Connecting to server"); --- 1347,1350 ---- *************** *** 1337,1348 **** retcode = connect(httpsock, (struct sockaddr *)&server_addr,sizeof(server_addr)); if (retcode != 0) { ! printf("connect() failed \n"); mvpw_set_text_str(fb_name, "Connection Error"); retcode = -2; break; } ! ! ! // Send a GET to the Web server --- 1352,1364 ---- retcode = connect(httpsock, (struct sockaddr *)&server_addr,sizeof(server_addr)); if (retcode != 0) { ! printf("connect() failed %d\n",retcode); mvpw_set_text_str(fb_name, "Connection Error"); retcode = -2; + instream = NULL; + audio_stop = 1; + ContentType = CONTENT_ERROR; break; } ! // Send a GET to the Web server *************** *** 1355,1430 **** } - - // Receive from the Web server - // - The return code from recv() is the number of bytes received - // int whereami; - // int line_start = 0 ; - // int buflen = whereami = STREAM_PACKET_SIZE; - - FILE * instream; - stateGet = HTTP_INIT; playlistType = PLAYLIST_NONE; contentLength = 0; metaInt = 0; bitRate[0]=0; ! instream = fdopen(httpsock,"rb"); setbuf(instream,NULL); - - char *rcs; rcs = fgets(line_data,LINE_SIZE-1,instream); ! ptr = strrchr (line_data,'\r'); ! if (ptr!=NULL) { ! *ptr =0; ! } ! printf("%s\n",line_data); ! ! if (line_data[0]==0) { ! retcode = -2; ! break; ! } else { ! ptr = line_data; ! while (*ptr!=0 && *ptr!=0x20) { ! ptr++; ! } ! if (*ptr==0x20) { ! sscanf(ptr,"%d",&statusGet); ! } ! if (statusGet != 200 && statusGet != 302) { ! if ( NumberOfEntries > 1 && NumberOfEntries < curNumberOfEntries ) { ! // try next ! curNumberOfEntries++; ! close(httpsock); ! continue; ! } else { ! mvpw_set_text_str(fb_name, line_data); retcode = -2; break; } } - } - mvpw_set_text_str(fb_name, scname); - - - if (strcmp(line_data,"ICY 200 OK")==0) { - // default shoutcast to mp3 when none found - ContentType = CONTENT_MP3; - } else { - ContentType = CONTENT_UNKNOWN; - } - stateGet = HTTP_RESPONSE; - retcode = -2; - while ( rcs != NULL && !ferror(instream) && !feof(instream ) ) { rcs = fgets(line_data,LINE_SIZE-1,instream); ! if (rcs==NULL) { ! printf("fget() failed \n"); continue; } - - ptr = strrchr (line_data,'\r'); if (ptr!=NULL) { --- 1371,1449 ---- } stateGet = HTTP_INIT; + statusGet = 0; playlistType = PLAYLIST_NONE; contentLength = 0; metaInt = 0; bitRate[0]=0; ! retcode = -2; instream = fdopen(httpsock,"rb"); setbuf(instream,NULL); rcs = fgets(line_data,LINE_SIZE-1,instream); ! while ( rcs != NULL && !ferror(instream) && !feof(instream ) ) { ! if (stateGet == HTTP_INIT ) { ! ptr = strrchr (line_data,'\r'); ! if (ptr!=NULL) { ! *ptr =0; ! } ! printf("%s\n",line_data); ! ! if (line_data[0]==0) { ! ContentType = CONTENT_UNKNOWN; retcode = -2; break; + } else { + ptr = line_data; + while (*ptr!=0 && *ptr!=0x20) { + ptr++; + } + if (*ptr==0x20) { + sscanf(ptr,"%d",&statusGet); + } + if (statusGet != 200 && statusGet != 301 && statusGet != 302) { + if ( ContentType != CONTENT_TRYHOST && NumberOfEntries > 1 && NumberOfEntries > curNumberOfEntries ) { + ContentType = CONTENT_TRYHOST; + } else { + mvpw_set_text_str(fb_name, line_data); + ContentType = CONTENT_ERROR; + retcode = -2; + } + break; + } + } + if (strcmp(line_data,"ICY 200 OK")==0) { + // default shoutcast to mp3 when none found + ContentType = CONTENT_MP3; + } else if (strcmp(line_data,"200")==0) { + // default shoutcast to mp3 when none found + ContentType = CONTENT_200; + } else { + ContentType = CONTENT_UNKNOWN; + } + stateGet = HTTP_HEADER; + if ( shoutcastDisplay[0] ) { + mvpw_set_text_str(fb_name,shoutcastDisplay); + } else { + mvpw_set_text_str(fb_name,scname); } } rcs = fgets(line_data,LINE_SIZE-1,instream); ! if (rcs==NULL && errno != 0) { ! if (stateGet != HTTP_RETRY) { ! printf("fget() failed %d\n",errno); ! switch (errno) { ! case EBADF: ! mvpw_set_text_str(fb_name, "Error opening stream"); ! break; ! default: ! mvpw_set_text_str(fb_name, "General stream error"); ! break; ! } ! } continue; } ptr = strrchr (line_data,'\r'); if (ptr!=NULL) { *************** *** 1439,1454 **** if ( line_data[0]==0x0a || line_data[0]==0x0d || line_data[0]==0) { ! if (ContentType==CONTENT_MP3 || ContentType==CONTENT_OGG || ContentType==CONTENT_MPG || statusGet==302) { // stream the following audio data or redirect break; ! } else { ! if (stateGet!=HTTP_DATA) { ! stateGet = HTTP_PARSE; } continue; } } ! if (stateGet == HTTP_RESPONSE ) { // parse response --- 1458,1484 ---- if ( line_data[0]==0x0a || line_data[0]==0x0d || line_data[0]==0) { ! if (ContentType == CONTENT_UNSUPPORTED || ContentType==CONTENT_MP3 || ContentType==CONTENT_OGG || ContentType==CONTENT_MPG || stateGet==HTTP_RETRY) { // stream the following audio data or redirect break; ! } else if (ContentType == CONTENT_200) { ! // expect real data next time ! stateGet = HTTP_INIT; ! rcs = fgets(line_data,LINE_SIZE-1,instream); ! if (rcs==NULL) { ! printf("fget() #2 failed %d\n",errno); ! mvpw_set_text_str(fb_name, "Unexpected end of data"); } continue; + } else { + stateGet = HTTP_CONTENT; + continue; } + } else { + if (ContentType == CONTENT_200) { + ContentType = CONTENT_UNKNOWN; + } } ! if (stateGet == HTTP_HEADER ) { // parse response *************** *** 1477,1480 **** --- 1507,1511 ---- if (ContentType!=CONTENT_PLAYLIST) { i = 0; + ContentType = CONTENT_UNSUPPORTED; while (ContentAudio[i]!=NULL) { ptr = strstr(line_data,ContentAudio[i]); *************** *** 1520,1534 **** mvpw_menu_change_item(playlist_widget,playlist->key, &line_data[9]); snprintf(shoutcastDisplay,40,&line_data[9]); } else if (strncasecmp (line_data, "icy-br:",6)==0) { snprintf(bitRate,10,"kbps%s",&line_data[6]); ! } else if ( statusGet==302) { if (strncasecmp (line_data,"Location:" ,9 )==0) { ptr = strstr(line_data,"http://"); if (ptr!=NULL && (strlen(ptr) < MAX_URL_LEN) ) { - // free(current); - // current = strdup(ptr); snprintf(url[0],MAX_URL_LEN,"%s",ptr); stateGet=HTTP_RETRY; ContentType = CONTENT_REDIRECT; } } --- 1551,1574 ---- mvpw_menu_change_item(playlist_widget,playlist->key, &line_data[9]); snprintf(shoutcastDisplay,40,&line_data[9]); + } else if (strncasecmp (line_data,"x-audiocast-name:",17)==0 ) { + line_data[70]=0; + mvpw_set_text_str(fb_name, &line_data[17]); + mvpw_menu_change_item(playlist_widget,playlist->key, &line_data[17]); + snprintf(shoutcastDisplay,40,&line_data[17]); } else if (strncasecmp (line_data, "icy-br:",6)==0) { snprintf(bitRate,10,"kbps%s",&line_data[6]); ! } else if (strncasecmp (line_data, "x-audiocast-bitrate:",20)==0) { ! snprintf(bitRate,10,"kbps%s",&line_data[20]); ! } else if ( statusGet==301 || statusGet==302 ) { if (strncasecmp (line_data,"Location:" ,9 )==0) { ptr = strstr(line_data,"http://"); if (ptr!=NULL && (strlen(ptr) < MAX_URL_LEN) ) { snprintf(url[0],MAX_URL_LEN,"%s",ptr); stateGet=HTTP_RETRY; ContentType = CONTENT_REDIRECT; + } else { + mvpw_set_text_str(fb_name, "No redirection"); + ContentType = CONTENT_ERROR; + break; } } *************** *** 1536,1540 **** } else { ! // parse non-audio data if (playlistType == PLAYLIST_NONE) { ptr = strstr(line_data,"[playlist]"); --- 1576,1580 ---- } else { ! // parse non-audio content if (playlistType == PLAYLIST_NONE) { ptr = strstr(line_data,"[playlist]"); *************** *** 1543,1547 **** ContentType = CONTENT_PLAYLIST; curNumberOfEntries = -1; // start again ! NumberOfEntries = 1; } } else if (strncmp(line_data,"File",4)==0 && line_data[5]=='=') { --- 1583,1591 ---- ContentType = CONTENT_PLAYLIST; curNumberOfEntries = -1; // start again ! NumberOfEntries = 1; // in case NumberOfEntries= not found ! } else if (strncmp(line_data,"Too many requests.",18) == 0 ){ ! mvpw_set_text_str(fb_name, line_data); ! ContentType = CONTENT_ERROR; ! break; } } else if (strncmp(line_data,"File",4)==0 && line_data[5]=='=') { *************** *** 1553,1562 **** NumberOfEntries = 1; } - // free(current); - // current = strdup(&line_data[6]); snprintf(url[curNumberOfEntries],MAX_URL_LEN,"%s",&line_data[6]); curNumberOfEntries++; stateGet = HTTP_RETRY; ! if (curNumberOfEntries == NumberOfEntries ) { // no need for any more break; --- 1597,1604 ---- NumberOfEntries = 1; } snprintf(url[curNumberOfEntries],MAX_URL_LEN,"%s",&line_data[6]); curNumberOfEntries++; stateGet = HTTP_RETRY; ! if (curNumberOfEntries == NumberOfEntries || curNumberOfEntries == MAX_PLAYLIST ) { // no need for any more break; *************** *** 1568,1574 **** } else if (strncasecmp(line_data,"NumberOfEntries=",16)==0) { if (curNumberOfEntries == -1 ) { ! // only read the first entry NumberOfEntries= atoi(&line_data[16]); ! curNumberOfEntries=0; } } else if (playlistType == PLAYLIST_M3U && strncasecmp(line_data,"http://",7) == 0 && strlen(line_data) < MAX_URL_LEN) { --- 1610,1621 ---- } else if (strncasecmp(line_data,"NumberOfEntries=",16)==0) { if (curNumberOfEntries == -1 ) { ! // only read the first NumberOfEntries NumberOfEntries= atoi(&line_data[16]); ! if (NumberOfEntries==0) { ! mvpw_set_text_str(fb_name, "Empty playlist"); ! ContentType = CONTENT_ERROR; ! break; ! } ! curNumberOfEntries = 0; } } else if (playlistType == PLAYLIST_M3U && strncasecmp(line_data,"http://",7) == 0 && strlen(line_data) < MAX_URL_LEN) { *************** *** 1580,1585 **** } - // free(current); - // current = strdup(line_data); snprintf(url[curNumberOfEntries],MAX_URL_LEN,"%s",line_data); curNumberOfEntries++; --- 1627,1630 ---- *************** *** 1591,1620 **** } } ! } else if (playlistType == PLAYLIST_PODCAST && (ptr=strstr(line_data,".mp3")) != NULL && strstr(line_data,"url") != NULL && (ptr1=strstr(line_data,"http://")) != NULL ) { ! if (curNumberOfEntries <= MAX_PLAYLIST ) { ! if (ptr1 < ptr && ((ptr - ptr1 + 4) < MAX_URL_LEN) ){ ! if (curNumberOfEntries == -1 ) { ! // assume 1 before number of entries ! curNumberOfEntries = 0; ! NumberOfEntries = 0; ! } ! *(ptr+4)=0; ! // free(current); ! // current = strdup(ptr1); ! snprintf(url[curNumberOfEntries],MAX_URL_LEN,"%s",ptr1); ! curNumberOfEntries++; ! NumberOfEntries++; ! stateGet = HTTP_RETRY; ! break; } ! } ! } } } // printf("%d %d %d %d %d %d\n",line_data[0],ContentType,stateGet,retcode,statusGet,curNumberOfEntries); ! if ( ferror(instream) ) { retcode = -2; } else { --- 1636,1674 ---- } } ! } else if (playlistType == PLAYLIST_PODCAST) { ! if ( (ptr=strstr(line_data,".mp3")) != NULL && strstr(line_data,"url") != NULL && (ptr1=strstr(line_data,"http://")) != NULL ) { ! if (curNumberOfEntries <= MAX_PLAYLIST ) { ! if (ptr1 < ptr && ((ptr - ptr1 + 4) < MAX_URL_LEN) ){ ! if (curNumberOfEntries == -1 ) { ! // assume 1 before number of entries ! curNumberOfEntries = 0; ! NumberOfEntries = 0; ! ! } ! *(ptr+4)=0; ! snprintf(url[curNumberOfEntries],MAX_URL_LEN,"%s",ptr1); ! curNumberOfEntries++; ! NumberOfEntries++; ! stateGet = HTTP_RETRY; ! break; } ! } ! } else if ((ptr=strstr(line_data,"<title>")) != NULL && (ptr1=strstr(line_data,"</title>")) != NULL ) { ! if ( ptr < ptr1 ) { ! ptr+= 7; ! *ptr1 = 0; ! snprintf(shoutcastDisplay,40,ptr); ! } ! } ! } } } + // printf("%d %d %d %d %d %d\n",line_data[0],ContentType,stateGet,retcode,statusGet,curNumberOfEntries); ! if (ContentType!= CONTENT_ERROR && ferror(instream) ) { ! mvpw_set_text_str(fb_name, "Server connection ended"); retcode = -2; } else { *************** *** 1662,1666 **** curNumberOfEntries = 1; printf("Retry %d %s\n",curNumberOfEntries,url[curNumberOfEntries-1]); - stateGet = HTTP_UNKNOWN; close(httpsock); retcode = 1; --- 1716,1719 ---- *************** *** 1670,1683 **** break; case CONTENT_UNKNOWN: default: ! mvpw_set_text_str(fb_name, "No valid content"); retcode = -2; break; - } } } else { - printf("host_name %s not found %d\n",host_name,errno); mvpw_set_text_str(fb_name, "DNS Trouble Check /etc/resolv.conf"); retcode = -1; --- 1723,1751 ---- break; case CONTENT_UNKNOWN: + case CONTENT_UNSUPPORTED: + mvpw_set_text_str(fb_name, "No supported content found"); + retcode = -2; + audio_stop = 1; + break; + case CONTENT_TRYHOST: + if (curNumberOfEntries < NumberOfEntries) { + // try next + curNumberOfEntries++; + close(httpsock); + printf("Host Retry %d %s\n",curNumberOfEntries,url[curNumberOfEntries-1]); + } else { + retcode = -2; + } + break; + case CONTENT_ERROR: default: ! // allow message above; retcode = -2; + audio_stop = 1; break; } } } else { mvpw_set_text_str(fb_name, "DNS Trouble Check /etc/resolv.conf"); retcode = -1; *************** *** 1878,1882 **** metaRead = metaRead - (message_len-metaStart); } else { ! // printf("meta int 0\n"); } --- 1946,1950 ---- metaRead = metaRead - (message_len-metaStart); } else { ! // printf("meta int 0\n"); } *************** *** 1911,1915 **** metaIgnored = message_len-metaRead; metaStart -= message_len; ! // printf("ignore %d %d\n",metaStart,metaIgnored); metaRead = metaInt + metaStart; } --- 1979,1983 ---- metaIgnored = message_len-metaRead; metaStart -= message_len; ! // printf("ignore %d %d\n",metaStart,metaIgnored); metaRead = metaInt + metaStart; } *************** *** 1950,1953 **** --- 2018,2022 ---- } } else { + dataFlag++; message_len = recv (httpsock, peekBuffer, STREAM_PACKET_SIZE,MSG_PEEK); usleep(10000); |
From: Rick S. <st...@us...> - 2006-02-10 15:19:38
|
Update of /cvsroot/mvpmc/mvpmc/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5814/mvpmc/src Modified Files: display.c gui.c Log Message: Stop resetting if "-d" option for local display is used when "--startup" is used. The process that handles the local display does not start in time to handle messages indicating what feature is in use. Instead of resetting, MVPMC now prints out "problem" messages. Later we might find a better solution. Index: gui.c =================================================================== RCS file: /cvsroot/mvpmc/mvpmc/src/gui.c,v retrieving revision 1.98 retrieving revision 1.99 diff -C2 -d -r1.98 -r1.99 *** gui.c 10 Feb 2006 13:46:00 -0000 1.98 --- gui.c 10 Feb 2006 15:19:21 -0000 1.99 *************** *** 5726,5729 **** --- 5726,5732 ---- mvpw_menu_hilite_item(main_menu, (void*)startup_this_feature); + snprintf(display_message, sizeof(display_message), + "File:%s\n", "MythTV"); + main_select_callback(NULL, NULL, (void *)startup_this_feature); } *************** *** 5742,5745 **** --- 5745,5751 ---- mvpw_menu_hilite_item(main_menu, (void*)startup_this_feature); + snprintf(display_message, sizeof(display_message), + "File:%s\n", "ReplayTV"); + main_select_callback(NULL, NULL, (void *)startup_this_feature); } *************** *** 5758,5761 **** --- 5764,5770 ---- mvpw_menu_hilite_item(main_menu, (void*)startup_this_feature); + snprintf(display_message, sizeof(display_message), + "File:%s\n", "File System"); + main_select_callback(NULL, NULL, (void *)startup_this_feature); } *************** *** 5774,5777 **** --- 5783,5789 ---- mvpw_menu_hilite_item(main_menu, (void*)startup_this_feature); + snprintf(display_message, sizeof(display_message), + "File:%s\n", "Settings"); + main_select_callback(NULL, NULL, (void *)startup_this_feature); } *************** *** 5790,5793 **** --- 5802,5808 ---- mvpw_menu_hilite_item(main_menu, (void*)startup_this_feature); + snprintf(display_message, sizeof(display_message), + "File:%s\n", "About"); + main_select_callback(NULL, NULL, (void *)startup_this_feature); break; *************** *** 5805,5808 **** --- 5820,5826 ---- mvpw_menu_hilite_item(main_menu, (void*)startup_this_feature); + snprintf(display_message, sizeof(display_message), + "File:%s\n", "Music Client"); + main_select_callback(NULL, NULL, (void *)startup_this_feature); } *************** *** 5821,5824 **** --- 5839,5845 ---- mvpw_menu_hilite_item(main_menu, (void*)startup_this_feature); + snprintf(display_message, sizeof(display_message), + "File:%s\n", "VNC"); + main_select_callback(NULL, NULL, (void *)startup_this_feature); } *************** *** 5827,5828 **** --- 5848,5851 ---- return 0; } + + Index: display.c =================================================================== RCS file: /cvsroot/mvpmc/mvpmc/src/display.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** display.c 25 Oct 2005 06:09:17 -0000 1.4 --- display.c 10 Feb 2006 15:19:21 -0000 1.5 *************** *** 238,243 **** if((client_socket_descriptor = socket(AF_INET, SOCK_STREAM, 0)) < 0) { ! perror("client: socket"); ! exit(1); } --- 238,245 ---- if((client_socket_descriptor = socket(AF_INET, SOCK_STREAM, 0)) < 0) { ! ///### perror("client: socket"); ! ///### exit(1); ! printf("Problem:display:Unable to get client socket descriptor.\n"); ! return; } *************** *** 247,252 **** if(uname(&myname) < 0) { ! perror("uname: myname"); ! exit(1); } --- 249,256 ---- if(uname(&myname) < 0) { ! ///### perror("uname: myname"); ! ///### exit(1); ! printf("Problem:display:Unable to find my own name.\n"); ! return; } *************** *** 256,261 **** if((hptr = gethostbyname( myname.nodename )) == NULL) { ! perror("gethostbyname error"); ! exit(1); } --- 260,267 ---- if((hptr = gethostbyname( myname.nodename )) == NULL) { ! ///### perror("gethostbyname error"); ! ///### exit(1); ! printf("Problem:display:Unable to get host info.\n"); ! return; } *************** *** 283,288 **** if(connect(client_socket_descriptor, (struct sockaddr *)&client_sain, sizeof(client_sain)) < 0) { ! perror("client: connect"); ! exit(1); } --- 289,296 ---- if(connect(client_socket_descriptor, (struct sockaddr *)&client_sain, sizeof(client_sain)) < 0) { ! ///### perror("client: connect"); ! ///### exit(1); ! printf("Problem:display:Unable to connect to the display process.\n"); ! return; } |
From: Rick S. <st...@us...> - 2006-02-10 13:49:55
|
Update of /cvsroot/mvpmc/build/dongle In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32046/dongle Modified Files: dongle_build.sh Log Message: Restoring dongle/dongle_build.sh. Index: dongle_build.sh =================================================================== RCS file: /cvsroot/mvpmc/build/dongle/dongle_build.sh,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** dongle_build.sh 10 Feb 2006 13:32:53 -0000 1.5 --- dongle_build.sh 10 Feb 2006 13:49:47 -0000 1.6 *************** *** 106,110 **** let RAMDISK_SIZE=$RAMDISK_SIZE+300 if [ $RAMDISK_SIZE -gt 4096 ] ; then ! echo "ramdisk too big" fi --- 106,110 ---- let RAMDISK_SIZE=$RAMDISK_SIZE+300 if [ $RAMDISK_SIZE -gt 4096 ] ; then ! error "ramdisk too big" fi |
From: Rick S. <st...@us...> - 2006-02-10 13:46:14
|
Update of /cvsroot/mvpmc/mvpmc/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29994/mvpmc/src Modified Files: config.c config.h gui.c main.c mvpmc.h Log Message: This time for real! >Added "--startup <feature>" to command line and to settings menu. >Example: >/bin/mvpmc -c 192.168.0.10 --startup mclient >...will boot into mclient. Index: config.h =================================================================== RCS file: /cvsroot/mvpmc/mvpmc/src/config.h,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** config.h 15 Jan 2006 23:29:24 -0000 1.10 --- config.h 10 Feb 2006 13:46:00 -0000 1.11 *************** *** 59,62 **** --- 59,63 ---- #define CONFIG_MYTHTV_PROGRAMS 0x00400000 #define CONFIG_MYTHTV_RECGROUP 0x00800000 + #define CONFIG_STARTUP_SELECT 0x01000000 #define MYTHTV_RG_MAX 32 *************** *** 97,100 **** --- 98,102 ---- show_sort_t mythtv_programs; config_mythtv_rg_t mythtv_recgroup[MYTHTV_RG_MAX]; + int startup_selection; } config_t; Index: gui.c =================================================================== RCS file: /cvsroot/mvpmc/mvpmc/src/gui.c,v retrieving revision 1.97 retrieving revision 1.98 diff -C2 -d -r1.97 -r1.98 *** gui.c 7 Feb 2006 04:25:02 -0000 1.97 --- gui.c 10 Feb 2006 13:46:00 -0000 1.98 *************** *** 809,812 **** --- 809,813 ---- static mvp_widget_t *settings_playback; static mvp_widget_t *settings_help; + static mvp_widget_t *settings_startup; static mvp_widget_t *sub_settings; static mvp_widget_t *screensaver_dialog; *************** *** 930,944 **** enum { - MM_EXIT, - MM_MYTHTV, - MM_FILESYSTEM, - MM_ABOUT, - MM_VNC, - MM_SETTINGS, - MM_REPLAYTV, - MM_MCLIENT, - }; - - enum { SETTINGS_MODE, SETTINGS_OUTPUT, --- 931,934 ---- *************** *** 961,964 **** --- 951,955 ---- SETTINGS_MAIN_SAVE, SETTINGS_MAIN_VIEWPORT, + SETTINGS_MAIN_STARTUP, } settings_main_t; *************** *** 979,982 **** --- 970,984 ---- } settings_mythtv_t; + typedef enum { + SETTINGS_STARTUP_MYTHTV= 1, + SETTINGS_STARTUP_FILESYSTEM, + SETTINGS_STARTUP_ABOUT, + SETTINGS_STARTUP_VNC, + SETTINGS_STARTUP_SETTINGS, + SETTINGS_STARTUP_REPLAYTV, + SETTINGS_STARTUP_MCLIENT, + SETTINGS_STARTUP_ENDOFLIST, + } settings_startup_t; + enum { SETTINGS_OSD_BRIGHTNESS = 1, *************** *** 1027,1030 **** --- 1029,1037 ---- }; + /* + * Holds startup application selection for OSD menu. + */ + int startup_selection = 0; + void add_osd_widget(mvp_widget_t *widget, int type, int visible, *************** *** 1378,1381 **** --- 1385,1419 ---- static void + settings_startup_key_callback(mvp_widget_t *widget, char key) + { + switch (key) { + case MVPW_KEY_EXIT: + mvpw_hide(widget); + mvpw_show(settings); + mvpw_focus(settings); + break; + case MVPW_KEY_UP: + case MVPW_KEY_RIGHT: + startup_selection--; + break; + case MVPW_KEY_DOWN: + case MVPW_KEY_LEFT: + startup_selection++; + break; + case MVPW_KEY_OK: + break; + } + + /* + * To keep the "OSD cursor" and our "place" in sync with each + * other we need to stay within range of our available options. + */ + if (startup_selection < 0) + startup_selection = (SETTINGS_STARTUP_ENDOFLIST - 2); + if (startup_selection > (SETTINGS_STARTUP_ENDOFLIST - 2)) + startup_selection = 0; + } + + static void settings_pause_key_callback(mvp_widget_t *widget, char key) { *************** *** 2945,2948 **** --- 2983,2990 ---- mvpw_focus(settings_playback); break; + case SETTINGS_MAIN_STARTUP: + mvpw_show(settings_startup); + mvpw_focus(settings_startup); + break; } } *************** *** 3051,3054 **** --- 3093,3117 ---- static void + startup_select_callback(mvp_widget_t *widget, char *item, void *key) + { + startup_selection = (int)key; + + mvpw_check_menu_item(widget, (void*)SETTINGS_STARTUP_MYTHTV - 1, 0); + mvpw_check_menu_item(widget, (void*)SETTINGS_STARTUP_FILESYSTEM - 1, 0); + mvpw_check_menu_item(widget, (void*)SETTINGS_STARTUP_ABOUT - 1, 0); + mvpw_check_menu_item(widget, (void*)SETTINGS_STARTUP_VNC - 1, 0); + mvpw_check_menu_item(widget, (void*)SETTINGS_STARTUP_SETTINGS - 1, 0); + mvpw_check_menu_item(widget, (void*)SETTINGS_STARTUP_REPLAYTV - 1, 0); + mvpw_check_menu_item(widget, (void*)SETTINGS_STARTUP_MCLIENT - 1, 0); + + mvpw_check_menu_item(widget, (void*)(startup_selection), 1); + + if (config->startup_selection != startup_selection) { + config->startup_selection = startup_selection; + config->bitmask |= CONFIG_STARTUP_SELECT; + } + } + + static void mclient_select_callback(mvp_widget_t *widget, char *item, void *key) { *************** *** 3370,3373 **** --- 3433,3438 ---- mvpw_add_menu_item(settings, "Themes", (void*)SETTINGS_MAIN_THEMES, &settings_item_attr); + mvpw_add_menu_item(settings, "Startup Specific Application", + (void*)SETTINGS_MAIN_STARTUP, &settings_item_attr); if (config_file) mvpw_add_menu_item(settings, "Viewport", *************** *** 3576,3579 **** --- 3641,3703 ---- mvpw_check_menu_item(settings_playback_pause, (void*)pause_osd, 1); + + + + + + /* + * startup settings menu + */ + settings_startup = mvpw_create_menu(NULL, x, y, w, h, + settings_attr.bg, + settings_attr.border, + settings_attr.border_size); + settings_attr.checkboxes = 1; + mvpw_set_menu_attr(settings_startup, &settings_attr); + mvpw_set_menu_title(settings_startup, "Startup Settings"); + mvpw_set_key(settings_startup, settings_startup_key_callback); + + settings_item_attr.hilite = NULL; + settings_item_attr.select = startup_select_callback; + + mvpw_add_menu_item(settings_startup, + "Startup MythTV", + (void*)0, &settings_item_attr); + mvpw_add_menu_item(settings_startup, + "Startup Filesystem", + (void*)1, &settings_item_attr); + mvpw_add_menu_item(settings_startup, + "Startup About", + (void*)2, &settings_item_attr); + mvpw_add_menu_item(settings_startup, + "Startup VNC", + (void*)3, &settings_item_attr); + mvpw_add_menu_item(settings_startup, + "Startup Settings", + (void*)4, &settings_item_attr); + mvpw_add_menu_item(settings_startup, + "Startup ReplayTV", + (void*)5, &settings_item_attr); + mvpw_add_menu_item(settings_startup, + "Startup MClient", + (void*)6, &settings_item_attr); + /* + * If there was a "--startup <feature>" option present on the + * command line, this call will mark that feature when displayed + * in the Settings Menu. + * + * Don't call this function if exit is the option, this value + * was used as a default "null" value. + */ + if(startup_this_feature != MM_EXIT) + { + mvpw_check_menu_item(settings_startup, (void*)(startup_this_feature - 1), 1); + } + + + + + + /* * settings menu with checkboxes *************** *** 5522,5525 **** --- 5646,5651 ---- demux_attr_t *attr; + extern size_t strnlen(const char*, size_t); + snprintf(buf, sizeof(buf), "Initializing GUI"); mvpw_set_text_str(splash, buf); *************** *** 5575,5578 **** --- 5701,5828 ---- mvpw_keystroke_callback(key_callback); + /* + * If there was a "--startup <feature>" option present on the command + * line, setting the callback here will start the feature selected. + * + * Don't set the callback if exit is the option, this value + * was used as a default "null" value. + * + * Do not allow MVPMC to startup (boot into) an application that + * has not been configured. + */ + switch(startup_this_feature) + { + case MM_MYTHTV: + if (mythtv_server) + { + mvpw_hide(setup_image); + mvpw_hide(fb_image); + mvpw_hide(replaytv_image); + mvpw_hide(about_image); + mvpw_hide(exit_image); + + mvpw_show(mythtv_image); + + mvpw_menu_hilite_item(main_menu, (void*)startup_this_feature); + + main_select_callback(NULL, NULL, (void *)startup_this_feature); + } + break; + case MM_REPLAYTV: + if (replaytv_server) + { + mvpw_hide(setup_image); + mvpw_hide(fb_image); + mvpw_hide(mythtv_image); + mvpw_hide(about_image); + mvpw_hide(exit_image); + + mvpw_show(replaytv_image); + + mvpw_menu_hilite_item(main_menu, (void*)startup_this_feature); + + main_select_callback(NULL, NULL, (void *)startup_this_feature); + } + break; + case MM_FILESYSTEM: + if (!filebrowser_disable) + { + mvpw_hide(setup_image); + mvpw_hide(mythtv_image); + mvpw_hide(replaytv_image); + mvpw_hide(about_image); + mvpw_hide(exit_image); + + mvpw_show(fb_image); + + mvpw_menu_hilite_item(main_menu, (void*)startup_this_feature); + + main_select_callback(NULL, NULL, (void *)startup_this_feature); + } + break; + case MM_SETTINGS: + if (!settings_disable) + { + mvpw_hide(fb_image); + mvpw_hide(mythtv_image); + mvpw_hide(replaytv_image); + mvpw_hide(about_image); + mvpw_hide(exit_image); + + mvpw_show(setup_image); + + mvpw_menu_hilite_item(main_menu, (void*)startup_this_feature); + + main_select_callback(NULL, NULL, (void *)startup_this_feature); + } + break; + case MM_ABOUT: + mvpw_hide(setup_image); + mvpw_hide(fb_image); + mvpw_hide(mythtv_image); + mvpw_hide(replaytv_image); + mvpw_hide(exit_image); + + mvpw_show(about_image); + + mvpw_focus(main_menu); + + mvpw_menu_hilite_item(main_menu, (void*)startup_this_feature); + + main_select_callback(NULL, NULL, (void *)startup_this_feature); + break; + case MM_MCLIENT: + if (mclient_server) + { + mvpw_hide(setup_image); + mvpw_hide(mythtv_image); + mvpw_hide(replaytv_image); + mvpw_hide(about_image); + mvpw_hide(exit_image); + + mvpw_show(fb_image); + + mvpw_menu_hilite_item(main_menu, (void*)startup_this_feature); + + main_select_callback(NULL, NULL, (void *)startup_this_feature); + } + break; + case MM_VNC: + if (strnlen(vnc_server, 254)) + { + mvpw_hide(fb_image); + mvpw_hide(mythtv_image); + mvpw_hide(replaytv_image); + mvpw_hide(about_image); + mvpw_hide(exit_image); + + mvpw_show(setup_image); + + mvpw_menu_hilite_item(main_menu, (void*)startup_this_feature); + + main_select_callback(NULL, NULL, (void *)startup_this_feature); + } + break; + } return 0; } Index: config.c =================================================================== RCS file: /cvsroot/mvpmc/mvpmc/src/config.c,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** config.c 17 Jan 2006 02:07:06 -0000 1.10 --- config.c 10 Feb 2006 13:46:00 -0000 1.11 *************** *** 590,593 **** --- 590,595 ---- if (config->bitmask & CONFIG_MYTHTV_PROGRAMS) show_sort = config->mythtv_programs; + if (config->bitmask & CONFIG_STARTUP_SELECT) + startup_selection = config->startup_selection; } Index: main.c =================================================================== RCS file: /cvsroot/mvpmc/mvpmc/src/main.c,v retrieving revision 1.60 retrieving revision 1.61 diff -C2 -d -r1.60 -r1.61 *** main.c 29 Jan 2006 15:38:29 -0000 1.60 --- main.c 10 Feb 2006 13:46:00 -0000 1.61 *************** *** 64,67 **** --- 64,68 ---- { "no-settings", no_argument, 0, 0 }, { "theme", required_argument, 0, 't' }, + { "startup", required_argument, 0, 0}, { 0, 0, 0, 0 } }; *************** *** 70,73 **** --- 71,79 ---- int reboot_disable = 0; int filebrowser_disable = 0; + /* + * Let's use the "exit" option for "no startup + * option selected" as no one would choose this. + */ + int startup_this_feature = MM_EXIT; #define VNC_SERVERPORT (5900) /* Offset to VNC server for regular connections */ *************** *** 195,198 **** --- 201,205 ---- printf("\t--no-reboot\n"); printf("\t--no-settings\n"); + printf("\t--startup \t(replaytv, mythtv, mclient)\n"); } *************** *** 420,423 **** --- 427,461 ---- filebrowser_disable = 1; } + if (strcmp (opts[opt_index].name, "startup") == 0) + { + if (strcmp (optarg, "replaytv") == 0) + { + startup_this_feature = MM_REPLAYTV; + } + else if (strcmp (optarg, "mythtv") == 0) + { + startup_this_feature = MM_MYTHTV; + } + else if (strcmp (optarg, "mclient") == 0) + { + startup_this_feature = MM_MCLIENT; + } + else if (strcmp (optarg, "vnc") == 0) + { + startup_this_feature = MM_VNC; + } + else if (strcmp (optarg, "settings") == 0) + { + startup_this_feature = MM_SETTINGS; + } + else if (strcmp (optarg, "about") == 0) + { + startup_this_feature = MM_ABOUT; + } + else if (strcmp (optarg, "filesystem") == 0) + { + startup_this_feature = MM_FILESYSTEM; + } + } break; case 'a': Index: mvpmc.h =================================================================== RCS file: /cvsroot/mvpmc/mvpmc/src/mvpmc.h,v retrieving revision 1.74 retrieving revision 1.75 diff -C2 -d -r1.74 -r1.75 *** mvpmc.h 29 Jan 2006 15:38:29 -0000 1.74 --- mvpmc.h 10 Feb 2006 13:46:00 -0000 1.75 *************** *** 169,172 **** --- 169,174 ---- extern mvp_widget_t *volume_dialog; + extern mvp_widget_t *mclient_fullscreen; + extern void volume_key_callback(mvp_widget_t *widget, char key); *************** *** 445,448 **** --- 447,451 ---- extern int reboot_disable; extern int filebrowser_disable; + extern int startup_this_feature; extern unsigned short viewport_edges[4]; *************** *** 455,457 **** --- 458,474 ---- extern show_sort_t show_sort; + + enum { + MM_EXIT, + MM_MYTHTV, + MM_FILESYSTEM, + MM_ABOUT, + MM_VNC, + MM_SETTINGS, + MM_REPLAYTV, + MM_MCLIENT, + }; + + extern int startup_selection; + #endif /* MVPMC_H */ |
From: Rick S. <st...@us...> - 2006-02-10 13:33:04
|
Update of /cvsroot/mvpmc/build/dongle In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23487/dongle Modified Files: dongle_build.sh Log Message: Added "--startup <feature>" to command line and to settings menu. Example: /bin/mvpmc -c 192.168.0.10 --startup mclient ...will boot into mclient. Index: dongle_build.sh =================================================================== RCS file: /cvsroot/mvpmc/build/dongle/dongle_build.sh,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** dongle_build.sh 23 Oct 2005 23:35:54 -0000 1.4 --- dongle_build.sh 10 Feb 2006 13:32:53 -0000 1.5 *************** *** 106,110 **** let RAMDISK_SIZE=$RAMDISK_SIZE+300 if [ $RAMDISK_SIZE -gt 4096 ] ; then ! error "ramdisk too big" fi --- 106,110 ---- let RAMDISK_SIZE=$RAMDISK_SIZE+300 if [ $RAMDISK_SIZE -gt 4096 ] ; then ! echo "ramdisk too big" fi |
From: Jon G. <ge...@us...> - 2006-02-07 04:26:08
|
Update of /cvsroot/mvpmc/mvpmc/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28326/src Modified Files: playlist.c Log Message: Remove a debug printf so each item of a playlist is no longer printed to stdout. Index: playlist.c =================================================================== RCS file: /cvsroot/mvpmc/mvpmc/src/playlist.c,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** playlist.c 29 Jan 2006 15:38:29 -0000 1.14 --- playlist.c 7 Feb 2006 04:25:57 -0000 1.15 *************** *** 233,237 **** free(name); name = strdup(sep + 1); - printf("EXTINF: name '%s'\n", name); } } --- 233,236 ---- |
From: Jon G. <ge...@us...> - 2006-02-07 04:25:16
|
Update of /cvsroot/mvpmc/mvpmc/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28072/src Modified Files: gui.c Log Message: Update the about info. Index: gui.c =================================================================== RCS file: /cvsroot/mvpmc/mvpmc/src/gui.c,v retrieving revision 1.96 retrieving revision 1.97 diff -C2 -d -r1.96 -r1.97 *** gui.c 2 Feb 2006 05:14:42 -0000 1.96 --- gui.c 7 Feb 2006 04:25:02 -0000 1.97 *************** *** 4638,4642 **** "Video: mpeg1, mpeg2\n" "Images: bmp, gif, png, jpeg\n" ! "Servers: MythTV, ReplayTV, NFS, CIFS, VNC, SlimServer\n"; splash_update("Creating about dialog"); --- 4638,4643 ---- "Video: mpeg1, mpeg2\n" "Images: bmp, gif, png, jpeg\n" ! "Servers: MythTV, ReplayTV, NFS, CIFS, VNC, SlimServer, " ! "HTTP\n"; splash_update("Creating about dialog"); |
From: Jon G. <ge...@us...> - 2006-02-07 04:23:16
|
Update of /cvsroot/mvpmc/mvplib/libav In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26311/libav Modified Files: init.c Log Message: Change libav init to use default values if the TV mode and aspect ratio cannot be read out of flash. Index: init.c =================================================================== RCS file: /cvsroot/mvpmc/mvplib/libav/init.c,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** init.c 18 Dec 2005 04:47:03 -0000 1.12 --- init.c 7 Feb 2006 04:23:03 -0000 1.13 *************** *** 1,4 **** /* ! * Copyright (C) 2004, Jon Gettler * http://mvpmc.sourceforge.net/ * --- 1,4 ---- /* ! * Copyright (C) 2004, 2005, 2006, Jon Gettler * http://mvpmc.sourceforge.net/ * *************** *** 36,41 **** int muted = 0; int ffwd = 0; ! av_mode_t vid_mode; ! av_aspect_t aspect; /* --- 36,41 ---- int muted = 0; int ffwd = 0; ! av_mode_t vid_mode = AV_MODE_NTSC; ! av_aspect_t aspect = AV_ASPECT_4x3; /* *************** *** 53,58 **** int video_mode = 0, audio_mode = 2; ! if (init_mtd1() < 0) ! return -1; if (fd_video < 0 ) --- 53,57 ---- int video_mode = 0, audio_mode = 2; ! init_mtd1(); if (fd_video < 0 ) |
From: Jon G. <ge...@us...> - 2006-02-03 06:03:06
|
Update of /cvsroot/mvpmc/mvpmc/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13077/src Modified Files: audio.c Log Message: Fix video mpeg playback via http. Index: audio.c =================================================================== RCS file: /cvsroot/mvpmc/mvpmc/src/audio.c,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** audio.c 29 Jan 2006 15:38:29 -0000 1.20 --- audio.c 3 Feb 2006 06:02:57 -0000 1.21 *************** *** 1017,1021 **** screensaver_disable(); mvpw_set_timer(root, video_play, 50); ! break; } else { audio_type = AUDIO_FILE_UNKNOWN; --- 1017,1021 ---- screensaver_disable(); mvpw_set_timer(root, video_play, 50); ! continue; } else { audio_type = AUDIO_FILE_UNKNOWN; |
From: Jon G. <ge...@us...> - 2006-02-02 05:31:55
|
Update of /cvsroot/mvpmc/mvpmc/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28827/src Modified Files: mythtv.c Log Message: Change mythtv_size() so that it only sends repeated size requests to the backend for in-progress recordings. Index: mythtv.c =================================================================== RCS file: /cvsroot/mvpmc/mvpmc/src/mythtv.c,v retrieving revision 1.93 retrieving revision 1.94 diff -C2 -d -r1.93 -r1.94 *** mythtv.c 29 Jan 2006 02:32:53 -0000 1.93 --- mythtv.c 2 Feb 2006 05:31:46 -0000 1.94 *************** *** 2329,2332 **** --- 2329,2334 ---- mythtv_size(void) { + static int unchanged = 0; + static long long size = 0; static struct timeval last = { 0, 0 }; static cmyth_proginfo_t prog = NULL; *************** *** 2337,2342 **** cmyth_conn_t ctrl = cmyth_hold(control); - cmyth_dbg(CMYTH_DBG_DEBUG, "%s [%s:%d]: (trace) {\n", - __FUNCTION__, __FILE__, __LINE__); gettimeofday(&now, NULL); --- 2339,2342 ---- *************** *** 2350,2353 **** --- 2350,2367 ---- goto out; } + /* + * If the size value is not changing, then the recording is not + * still in-progress, and we can simply believe the current value. + */ + if ((prog == loc_prog) && unchanged) { + ret = cmyth_proginfo_length(loc_prog); + goto out; + } + if (prog != loc_prog) { + size = 0; + unchanged = 0; + } + cmyth_dbg(CMYTH_DBG_DEBUG, "%s [%s:%d]: (trace) {\n", + __FUNCTION__, __FILE__, __LINE__); pthread_mutex_lock(&myth_mutex); *************** *** 2371,2374 **** --- 2385,2394 ---- ret = cmyth_proginfo_length(new_prog); + if (ret == size) { + unchanged = 1; + } else { + size = ret; + } + memcpy(&last, &now, sizeof(last)); CHANGE_GLOBAL_REF(current_prog, new_prog); *************** *** 2377,2387 **** unlock: pthread_mutex_unlock(&myth_mutex); - cmyth_release(ctrl); - cmyth_release(loc_prog); - cmyth_release(new_prog); - out: cmyth_dbg(CMYTH_DBG_DEBUG, "%s [%s:%d]: (trace) %lld}\n", __FUNCTION__, __FILE__, __LINE__, ret); return ret; } --- 2397,2409 ---- unlock: pthread_mutex_unlock(&myth_mutex); cmyth_dbg(CMYTH_DBG_DEBUG, "%s [%s:%d]: (trace) %lld}\n", __FUNCTION__, __FILE__, __LINE__, ret); + + out: + cmyth_release(new_prog); + cmyth_release(loc_prog); + cmyth_release(ctrl); + return ret; } |
From: Jon G. <ge...@us...> - 2006-02-02 05:16:13
|
Update of /cvsroot/mvpmc/mvpmc/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24900/src Modified Files: fb.c Log Message: Allow .ts files (mpeg transport streams) to be seen in the file browser. Index: fb.c =================================================================== RCS file: /cvsroot/mvpmc/mvpmc/src/fb.c,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** fb.c 20 Jan 2006 06:01:15 -0000 1.26 --- fb.c 2 Feb 2006 05:16:04 -0000 1.27 *************** *** 408,415 **** char *wc[] = { "*.mpg", "*.mpeg", "*.mp3", "*.nuv", "*.vob", "*.gif", "*.bmp", "*.m3u", "*.jpg", "*.jpeg", "*.png", "*.wav", ! "*.ac3", "*.ogg", NULL }; char *WC[] = { "*.MPG", "*.MPEG", "*.MP3", "*.NUV", "*.VOB", "*.GIF", "*.BMP", "*.M3U", "*.JPG", "*.JPEG", "*.PNG", "*.WAV", ! "*.AC3", "*.OGG", NULL }; item_attr.select = select_callback; --- 408,415 ---- char *wc[] = { "*.mpg", "*.mpeg", "*.mp3", "*.nuv", "*.vob", "*.gif", "*.bmp", "*.m3u", "*.jpg", "*.jpeg", "*.png", "*.wav", ! "*.ac3", "*.ogg", "*.ts", NULL }; char *WC[] = { "*.MPG", "*.MPEG", "*.MP3", "*.NUV", "*.VOB", "*.GIF", "*.BMP", "*.M3U", "*.JPG", "*.JPEG", "*.PNG", "*.WAV", ! "*.AC3", "*.OGG", "*.TS", NULL }; item_attr.select = select_callback; |
From: Jon G. <ge...@us...> - 2006-02-02 05:14:50
|
Update of /cvsroot/mvpmc/mvpmc/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23688/src Modified Files: gui.c Log Message: Stop destroying the image widget each time the image viewer widget is hidden. Index: gui.c =================================================================== RCS file: /cvsroot/mvpmc/mvpmc/src/gui.c,v retrieving revision 1.95 retrieving revision 1.96 diff -C2 -d -r1.95 -r1.96 *** gui.c 29 Jan 2006 15:38:29 -0000 1.95 --- gui.c 2 Feb 2006 05:14:42 -0000 1.96 *************** *** 1187,1191 **** { mvpw_hide(widget); - mvpw_image_destroy(widget); mvpw_show(file_browser); mvpw_focus(file_browser); --- 1187,1190 ---- |
From: Jon G. <ge...@us...> - 2006-02-02 05:10:42
|
Update of /cvsroot/mvpmc/mvplib/libwidget In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22451/libwidget Modified Files: image.c Log Message: Stop recreating the drawing surface each time a new image is drawn into an image widget. Index: image.c =================================================================== RCS file: /cvsroot/mvpmc/mvplib/libwidget/image.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** image.c 6 Jul 2005 03:41:15 -0000 1.4 --- image.c 2 Feb 2006 05:10:34 -0000 1.5 *************** *** 60,108 **** { GR_GC_ID gc; - GR_IMAGE_ID iid; - GR_IMAGE_INFO iif; GR_WINDOW_ID pid; GR_WINDOW_ID wid; GR_WM_PROPERTIES props; - GR_SCREEN_INFO si; int width, height; ! if (widget->data.image.pid) ! GrDestroyWindow(widget->data.image.pid); ! if (widget->data.image.wid) ! GrDestroyWindow(widget->data.image.wid); ! widget->data.image.wid = 0; ! widget->data.image.pid = 0; ! ! if ((iid=GrLoadImageFromFile(file, 0)) == 0) ! return -1; ! GrGetImageInfo(iid, &iif); ! GrGetScreenInfo(&si); ! if (iif.width > si.cols) ! width = si.cols; ! else ! width = iif.width; ! if (iif.height > si.cols) ! height = si.rows; ! else ! height = iif.height; ! pid = GrNewPixmap(width, height, NULL); gc = GrNewGC(); ! GrDrawImageToFit(pid, gc, 0, 0, width, height, iid); GrDestroyGC(gc); - GrFreeImage(iid); ! wid = GrNewWindowEx(GR_WM_PROPS_APPWINDOW|GR_WM_PROPS_NOAUTOMOVE, NULL, ! widget->wid, 0, 0, width, height, ! 0xff00ff00); ! GrSetBackgroundPixmap(wid, pid, GR_BACKGROUND_CENTER); ! props.flags = GR_WM_FLAGS_PROPS; ! props.props = GR_WM_PROPS_NODECORATE; ! GrSetWMProperties(wid, &props); ! GrMapWindow(wid); widget->data.image.wid = wid; --- 60,93 ---- { GR_GC_ID gc; GR_WINDOW_ID pid; GR_WINDOW_ID wid; GR_WM_PROPERTIES props; int width, height; ! wid = widget->data.image.wid; ! pid = widget->data.image.pid; ! width = widget->width; ! height = widget->height; ! if (pid == 0) ! pid = GrNewPixmap(width, height, NULL); gc = GrNewGC(); ! GrDrawImageFromFile(pid, gc, 0, 0, width, height, file, 0); GrDestroyGC(gc); ! if (wid == 0) { ! wid = GrNewWindowEx(GR_WM_PROPS_APPWINDOW| ! GR_WM_PROPS_NOAUTOMOVE, ! NULL, widget->wid, 0, 0, width, height, ! 0xff00ff00); ! GrSetBackgroundPixmap(wid, pid, GR_BACKGROUND_CENTER); ! props.flags = GR_WM_FLAGS_PROPS; ! props.props = GR_WM_PROPS_NODECORATE; ! GrSetWMProperties(wid, &props); ! GrMapWindow(wid); ! } widget->data.image.wid = wid; |