diff options
author | deva <deva> | 2005-06-02 20:45:01 +0000 |
---|---|---|
committer | deva <deva> | 2005-06-02 20:45:01 +0000 |
commit | 64efd74ecfa761c83b70ec2374bf448b6e42e254 (patch) | |
tree | 607ccb672f904dd415a7b589bb80000753e76fe5 /src/decoder.cc | |
parent | a17e42c900e2709444b12a5db2847e850f3dd6cd (diff) |
Added clear button
Optimized the frame handling a little (very little!).
Diffstat (limited to 'src/decoder.cc')
-rw-r--r-- | src/decoder.cc | 33 |
1 files changed, 21 insertions, 12 deletions
diff --git a/src/decoder.cc b/src/decoder.cc index ec3f695..7b3dd97 100644 --- a/src/decoder.cc +++ b/src/decoder.cc @@ -39,6 +39,11 @@ /* * $Log$ + * Revision 1.31 2005/06/02 20:45:01 deva + * + * Added clear button + * Optimized the frame handling a little (very little!). + * * Revision 1.30 2005/06/02 15:03:23 deva * * Fixed crash in network.cc if socket not connected. @@ -171,21 +176,11 @@ void Decoder::decode() pthread_mutex_unlock(&shot_mutex); } - if(local_record | (local_record != old_record) | local_shoot | local_freeze) { - Frame *eframe = new Frame(ptr, DVPACKAGE_SIZE); - eframe->shoot = local_shoot; - eframe->freeze = local_freeze; - eframe->record = local_record; - - encode_queue->push(eframe); - - sem_post(encode_sem); - } - static int showframe = 1; if(skip_frames != 0) showframe = 1 - showframe; if(showframe) { Frame *pframe = new Frame(ptr, DVPACKAGE_SIZE); + pframe->shoot = local_shoot; pframe->freeze = local_freeze; pframe->record = local_record; @@ -200,7 +195,21 @@ void Decoder::decode() SDL_PushEvent(&user_event); } - free(ptr); + if(local_record | (local_record != old_record) | local_shoot | local_freeze) { + Frame *eframe = new Frame(NULL, 0); + eframe->data = ptr; + eframe->size = DVPACKAGE_SIZE; + + eframe->shoot = local_shoot; + eframe->freeze = local_freeze; + eframe->record = local_record; + + encode_queue->push(eframe); + + sem_post(encode_sem); + } else { + free(ptr); + } } // Kick the others so they wake up with empty queues |