summaryrefslogtreecommitdiff
path: root/src/player.cc
diff options
context:
space:
mode:
authordeva <deva>2005-04-28 18:11:58 +0000
committerdeva <deva>2005-04-28 18:11:58 +0000
commita420994fe53199747e6d0ba0af473ecc4f940258 (patch)
treee00c5233f66e6dfc2964e203bc6529fea9374626 /src/player.cc
parent5c756301afdcad05d3b880544b3ea88e50986e21 (diff)
Moved mutex into queue (made it thread safe), to avoid mutex locking in player, encoder and decoder.
Diffstat (limited to 'src/player.cc')
-rw-r--r--src/player.cc10
1 files changed, 1 insertions, 9 deletions
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()