void player_put_packet(seq_t seqno, uint32_t timestamp, uint8_t *data, int len) {
+ // ignore a request to flush that has been made before the first packet...
+ if (packet_count==0) {
+ pthread_mutex_lock(&flush_mutex);
+ flush_requested = 0;
+ flush_rtp_timestamp = 0;
+ pthread_mutex_unlock(&flush_mutex);
+ }
+
pthread_mutex_lock(&ab_mutex);
packet_count++;
time_of_last_audio_packet = get_absolute_time_in_fp();
// determine if we are the currently playing thread
static inline int rtsp_playing(void) {
if (pthread_mutex_trylock(&playing_mutex)) {
+ // if playing_mutex is locked...
+ // return 0 if the threads are different, non-zero if the threads are the same
return pthread_equal(playing_thread, pthread_self());
} else {
+ // you actually acquired the playing_mutex, implying that there is no currently playing thread
+ // so unlock it return 0, implying you are not playing
pthread_mutex_unlock(&playing_mutex);
return 0;
}
rtp_shutdown();
pthread_mutex_unlock(&play_lock);
pthread_mutex_unlock(&playing_mutex);
+ // usleep(1000000);
} // else {
//debug(1, "This RTSP conversation thread doesn't think it's playing for a "
// "close RTSP connection.");