[Mplayerplug-in-cvs] mplayerplug-in/Source plugin-setup.h,1.53,1.54 plugin-threads.cpp,1.222,1.223 p
Brought to you by:
kdekorte
From: Kevin D. <kde...@us...> - 2006-04-10 15:06:42
|
Update of /cvsroot/mplayerplug-in/mplayerplug-in/Source In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6177/Source Modified Files: plugin-setup.h plugin-threads.cpp plugin.cpp Log Message: Fix problem with stopping playback of a list of mms streams Index: plugin-threads.cpp =================================================================== RCS file: /cvsroot/mplayerplug-in/mplayerplug-in/Source/plugin-threads.cpp,v retrieving revision 1.222 retrieving revision 1.223 diff -C2 -d -r1.222 -r1.223 *** plugin-threads.cpp 4 Apr 2006 22:15:46 -0000 1.222 --- plugin-threads.cpp 10 Apr 2006 15:06:37 -0000 1.223 *************** *** 1204,1207 **** --- 1204,1208 ---- local_td->instance->js_state = JS_STATE_UNDEFINED; result->tryagain = TRYAGAIN_FALSE; + result->errorcode = ERROR_QUIT; break; } *************** *** 1910,1915 **** // also prevents us from playing it again pthread_mutex_lock(&(local_td->instance->playlist_mutex)); ! if (!(result->retval)) { ! local_list->played = 1; } pthread_mutex_unlock(& --- 1911,1920 ---- // also prevents us from playing it again pthread_mutex_lock(&(local_td->instance->playlist_mutex)); ! if (result->retval == FALSE) { // FALSE retval is a complete play ! if (local_list->mmsstream && result->errorcode == ERROR_QUIT) { ! local_list->played = 0; ! } else { ! local_list->played = 1; ! } } pthread_mutex_unlock(& *************** *** 1964,1967 **** --- 1969,1982 ---- } while (result->retval); + // if we are in a list of mmsstreams, then we need to stop + + if (DEBUG) + printf("mmsstream = %i errorcode = %i \n",local_list->mmsstream, result->errorcode); + + if (local_list->mmsstream && (result->errorcode == ERROR_QUIT)) { + if (DEBUG) + printf("breaking out of next item loop\n"); + break; + } local_td->instance->currentnode = NULL; Index: plugin-setup.h =================================================================== RCS file: /cvsroot/mplayerplug-in/mplayerplug-in/Source/plugin-setup.h,v retrieving revision 1.53 retrieving revision 1.54 diff -C2 -d -r1.53 -r1.54 *** plugin-setup.h 17 Feb 2006 14:20:31 -0000 1.53 --- plugin-setup.h 10 Apr 2006 15:06:37 -0000 1.54 *************** *** 89,92 **** --- 89,93 ---- #define ERROR_FILE_NOT_FOUND ERROR_NO_STREAM << 6 #define ERROR_PLAYLIST_EMPTY ERROR_NO_STREAM << 7 + #define ERROR_QUIT ERROR_NO_STREAM << 8 #define TRYAGAIN_FALSE 0 Index: plugin.cpp =================================================================== RCS file: /cvsroot/mplayerplug-in/mplayerplug-in/Source/plugin.cpp,v retrieving revision 1.296 retrieving revision 1.297 diff -C2 -d -r1.296 -r1.297 *** plugin.cpp 23 Mar 2006 19:17:41 -0000 1.296 --- plugin.cpp 10 Apr 2006 15:06:37 -0000 1.297 *************** *** 2020,2027 **** --- 2020,2029 ---- { Node *n; + int clearlist = 1; if (DEBUG > 1) { printf("*****Play Called\n"); } + // when js_state == JS_STATE_UNDEFINED, this means that the playlist // has been completely processed and the window is clear with the controls *************** *** 2034,2043 **** pthread_mutex_lock(&playlist_mutex); // manipulating the playlist, so lock it n = list; while (n != NULL) { ! if (n->played == 1) ! n->played = 0; // reset played flag ! n = n->next; } pthread_mutex_unlock(&playlist_mutex); // unlock the playlist } --- 2036,2055 ---- pthread_mutex_lock(&playlist_mutex); // manipulating the playlist, so lock it + n = list; while (n != NULL) { ! if (n->played == 0 && n->play == 1) { ! clearlist = 0; ! } ! n = n->next; } + if (clearlist) { + n = list; + while (n != NULL) { + if (n->played == 1) + n->played = 0; // reset played flag + n = n->next; + } + } pthread_mutex_unlock(&playlist_mutex); // unlock the playlist } |