X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=vss.c;h=1ec0b5db8604415af3b90ad8cc93bbc892727173;hp=ee63d103d07bd4bd608871d17278e85811952e78;hb=5388ccac44e5342917ad50b091e9e4f906e3a4fc;hpb=4e2dd59e48f952e697e2dc5802c4564bbc0f11cf diff --git a/vss.c b/vss.c index ee63d103..1ec0b5db 100644 --- a/vss.c +++ b/vss.c @@ -198,13 +198,13 @@ static void vss_eof(void) mmd->afd.afhi.chunk_table = NULL; tmp = make_message("%s:\n%s:\n%s:\n", status_item_list[SI_AUDIO_INFO1], status_item_list[SI_AUDIO_INFO2], status_item_list[SI_AUDIO_INFO3]); - strcpy(mmd->afd.afhi.info_string, tmp); + strncpy(mmd->afd.afhi.info_string, tmp, sizeof(mmd->afd.afhi.info_string)); + mmd->afd.afhi.info_string[sizeof(mmd->afd.afhi.info_string) - 1] = '\0'; free(tmp); mmd->afd.path[0] = '\0'; mmd->afd.afsi.lyrics_id = 0; mmd->afd.afsi.image_id = 0; mmd->mtime = 0; - mmd->afd.attributes_string[0] = '\0'; mmd->size = 0; mmd->events++; } @@ -266,6 +266,10 @@ static enum afs_socket_status afsss; * This function gets called from para_server to determine the timeout value * for its main select loop. * + * \param rfds The set of file descriptors to be checked for reading. + * \param wfds The set of file descriptors to be checked for writing. + * \param max_fileno The highest-numbered file descriptor. + * * Before the timeout is computed, the current vss status flags are evaluated * and acted upon by calling appropriate functions from the lower layers. * Possible actions include @@ -316,7 +320,8 @@ struct timeval *vss_preselect(fd_set *rfds, fd_set *wfds, int *max_fileno) return tv; if (!map && vss_playing() && !(mmd->new_vss_status_flags & VSS_NOMORE)) { - if (afsss == AFS_SOCKET_READY) { + if (afsss == AFS_SOCKET_READY || + afsss == AFS_SOCKET_CHECK_FOR_WRITE) { PARA_DEBUG_LOG("ready and playing, but no audio file\n"); para_fd_set(afs_socket, wfds, max_fileno); afsss = AFS_SOCKET_CHECK_FOR_WRITE; @@ -392,7 +397,6 @@ static void recv_afs_result(void) map = para_mmap(mmd->size, PROT_READ, MAP_PRIVATE, passed_fd, 0); close(passed_fd); - mmd->afd.afhi.header_len = 0; /* default: no header */ mmd->chunks_sent = 0; mmd->current_chunk = 0; mmd->offset = 0;