[Flac-dev] Can a libFLAC encoder be initialize and called from inside a libFLAC decoder callback?

2011-05-24 Thread David Troendle
I am getting large, corrupted native FLAC files when trying to call the encoder from inside the decoder. The metadata in the output file is OK. Is initializing and calling an encoder from inside a libFLAC decoder write callback supported? The encoder is initialized on the first write

Re: [Flac-dev] Can a libFLAC encoder be initialize and called from inside a libFLAC decoder callback?

2011-05-24 Thread Brian Willoughby
Have you tried decoding to memory, and encoding from that memory? This technique would avoid file I/O. If you are reluctant to allocate enough memory for the full file (and why not, with a 64-bit system?), then you could implement a FIFO. You would need a semaphore to keep track of the

Re: [Flac-dev] Can a libFLAC encoder be initialize and called from inside a libFLAC decoder callback?

2011-05-24 Thread Paul Davis
On Tue, May 24, 2011 at 3:11 PM, David Troendle da...@troendle.org wrote: Thanks for the tip, Brian.  I did have a version that does everything in memory, but only had enough memory to get six threads going.  (Although my system has 16GB, I have not taken the time to create 64-bit libraries for

Re: [Flac-dev] Can a libFLAC encoder be initialize and called from inside a libFLAC decoder callback?

2011-05-24 Thread Brian Willoughby
On May 24, 2011, at 12:11, David Troendle wrote: Thanks for the tip, Brian. I did have a version that does everything in memory, but only had enough memory to get six threads going. (Although my system has 16GB, I have not taken the time to create 64-bit libraries for wxWidgets,

Re: [Flac-dev] Can a libFLAC encoder be initialize and called from inside a libFLAC decoder callback?

2011-05-24 Thread David Troendle
Sorry for ambiguity. Each thread does a decode followed by the encode. The threads are driven by a queue of files for recoding, and synced with a critical section. When the queue is empty the threads exit. It is not all that bad of an approach, but the technique does use a lot of I/O and only