summaryrefslogtreecommitdiff
path: root/src/decoder.cc
diff options
context:
space:
mode:
authordeva <deva>2005-04-26 09:40:36 +0000
committerdeva <deva>2005-04-26 09:40:36 +0000
commitcbe7247fff0a395f804b35d2047c3994fa0fd675 (patch)
treea0663a2981a47fc9ec3dca6a2db8bb4f56525bfd /src/decoder.cc
parentd2458728cd226a2651005acfd3241e1a5f77782c (diff)
Removed frame memoryleak
Diffstat (limited to 'src/decoder.cc')
-rw-r--r--src/decoder.cc11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/decoder.cc b/src/decoder.cc
index 9798b03..cd5806f 100644
--- a/src/decoder.cc
+++ b/src/decoder.cc
@@ -69,11 +69,13 @@ void Decoder::decode()
// Read a dvframe
ptr = dv_stream.readFrame();
if(!ptr) return; // No frame read. (Due to firewire error)
- Frame *frame = new Frame(ptr, DVPACKAGE_SIZE);
+ Frame *eframe = new Frame(ptr, DVPACKAGE_SIZE);
+ Frame *pframe = new Frame(ptr, DVPACKAGE_SIZE);
+ free(ptr);
pthread_mutex_lock(mutex);
- encode_queue->push(frame);
- player_queue->push(frame);
+ encode_queue->push(eframe);
+ player_queue->push(pframe);
pthread_mutex_unlock(mutex);
sem_post(encode_sem);
@@ -84,9 +86,6 @@ void Decoder::decode()
user_event.user.data1 = NULL;
user_event.user.data2 = NULL;
SDL_PushEvent(&user_event);
-
- // Free framedata.
- // free(ptr);
}
// Kick the others so they wake up with empty queues