From cbe7247fff0a395f804b35d2047c3994fa0fd675 Mon Sep 17 00:00:00 2001 From: deva Date: Tue, 26 Apr 2005 09:40:36 +0000 Subject: Removed frame memoryleak --- src/decoder.cc | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'src/decoder.cc') 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 -- cgit v1.2.3