Re: [flac-dev] About Decode Streaming

2013-07-02 Thread Burak Orçun Özkablan
Yes, it works now. Thank you so much, Robert and Ben. ___ flac-dev mailing list flac-dev@xiph.org http://lists.xiph.org/mailman/listinfo/flac-dev

Re: [flac-dev] About Decode Streaming

2013-07-02 Thread Robert Kausch
Source and destination buffers are in the wrong order in your call to memcpy. Argument order must be dest, src, size instead of src, dest, size. Am 02.07.2013 17:24, schrieb Burak Orçun Özkablan: > *// copy buffer array to m_pile_array* > *if(input_pile_size > 0) {* > *memcpy(input_pile_array, bu

Re: [flac-dev] About Decode Streaming

2013-07-02 Thread Burak Orçun Özkablan
Thank you so much for polite help Martijn. Allison, My read callback function is just ; * /// \brief read callback function of decoder* * FLAC__StreamDecoderReadStatus decoderReadCallback( const FLAC__StreamDecoder *decoder, FLAC__byte buffer[], size_t *bytes, void *callback_param)* * {* * // mu

Re: [flac-dev] About Decode Streaming

2013-07-02 Thread Ben Allison
The read callback can take as long as it wants (it's blocking, after all). It's almost definitely something wrong with your read callback code. Without the full source, it's hard to know exactly what. A few guesses, in no particular order. 1) Maybe you are reading in a loop and forgetting to in

Re: [flac-dev] About Decode Streaming

2013-07-02 Thread Martijn van Beurden
On 02-07-13 16:13, Burak Orçun Özkablan wrote: > Yes, I have tried plain wav data with file and stream functions of > decoder and encoder. They work succesfully. Okay, so that's not the problem. Clear. > You're right about FLAC can't find the first block in stream, because > I didn't add any me

Re: [flac-dev] About Decode Streaming

2013-07-02 Thread Burak Orçun Özkablan
Yes, I have tried plain wav data with file and stream functions of decoder and encoder. They work succesfully. You're right about FLAC can't find the first block in stream, because I didn't add any metadata in stream. The documentation of FLAC says that metadata callback function is optional for st

Re: [flac-dev] About Decode Streaming

2013-07-02 Thread Martijn van Beurden
On 02-07-13 11:01, Burak Orçun Özkablan wrote: I don't use any metadata when encoding and decoding. When I call *FLAC__StreamDecoderStateString[FLAC__stream_decoder_get_state(m_decoder)] * * * it returns FLAC__STREAM_DECODER_SEARCH_FOR_METADATA enum value. Is it an error ? There is always

Re: [flac-dev] About Decode Streaming

2013-07-02 Thread Burak Orçun Özkablan
Martijn, I don't use any metadata when encoding and decoding. When I call *FLAC__StreamDecoderStateString[FLAC__stream_decoder_get_state(m_decoder)] * * * it returns FLAC__STREAM_DECODER_SEARCH_FOR_METADATA enum value. Is it an error ? 2013/7/2 Burak Orçun Özkablan > Hi again, > > I can not

Re: [flac-dev] About Decode Streaming

2013-07-02 Thread Burak Orçun Özkablan
Hi again, I can not solve problem. I want to mention my source code, so you may answer easily. This is decoder init stream function. *FLAC__stream_decoder_init_stream(m_decoder, decoderReadCallback, NULL, NULL, NULL, NULL, decoderWriteCallback, NULL, decoderErrorCallback, input_pile_array);* * *

Re: [flac-dev] About Decode Streaming

2013-07-01 Thread Burak Orçun Özkablan
Sorry, I am newbie. Sample codes are from https://github.com/oneman/libflac/tree/master/examples/cpp. I used FLAC__stream_decoder_process_single function but it still gives exception. Maybe I could not control read callback, you're right. I will check it and write result in this thread. Thanks fo

Re: [flac-dev] About Decode Streaming

2013-07-01 Thread Martijn van Beurden
I'll top-post this one because it wasn't sent to the mailinglist but to me. Please reply to list next time. I assume you mean the main.c files in the encode and decode directory under examples. I can't really determine the root cause of your problem with this information, but I think you're tr

Re: [flac-dev] About Decode Streaming

2013-07-01 Thread Martijn van Beurden
On 01-07-13 16:48, Burak Orçun Özkablan wrote: > [...] > > I run your sample codes, encode.c and decode.c, about file encode / > decode. Then, I run > streaming encode / decode with two different source codes but when I > use streaming encode / decode over network in real-time, code throws > LOS