From a420994fe53199747e6d0ba0af473ecc4f940258 Mon Sep 17 00:00:00 2001 From: deva Date: Thu, 28 Apr 2005 18:11:58 +0000 Subject: Moved mutex into queue (made it thread safe), to avoid mutex locking in player, encoder and decoder. --- src/player.cc | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) (limited to 'src/player.cc') diff --git a/src/player.cc b/src/player.cc index d57f831..963f6e7 100644 --- a/src/player.cc +++ b/src/player.cc @@ -129,9 +129,7 @@ void Player::player() break; case SDL_USEREVENT: - pthread_mutex_lock(mutex); frame = queue->pop(); - pthread_mutex_unlock(mutex); if(!frame) break; if(first) { @@ -139,8 +137,6 @@ void Player::player() pitches[1] = overlay->pitches[1]; pitches[2] = overlay->pitches[2]; - // fprintf(stderr, "pitch[0]: %d - pitch[1]: %d - pitch[2]: %d\n", pitches[0], pitches[1], pitches[2]); fflush(stderr); - dv_parse_header(decoder, frame->data); //dv_parse_packs(decoder, frame->data); // Not needed anyway! @@ -151,8 +147,6 @@ void Player::player() first = false; } - fprintf(stderr, "[%d]", dv_is_PAL(decoder)); fflush(stderr); - SDL_LockYUVOverlay(overlay); // libdv img decode to yuv @@ -184,10 +178,8 @@ void Player::player() ts.tv_nsec = 100000000L; // 100ms nanosleep(&ts, NULL); - pthread_mutex_lock(mutex); frame = queue->pop(); - pthread_mutex_unlock(mutex); - // if(frame) delete frame; + if(frame) delete frame; } void Player::run() -- cgit v1.2.3