Hi, these two values can be stored in the stream info metadata block as well as in the header of each frame. This leads to some questions. - Are these values supposed to change during playback, e.g. first comes a frame with 2 channels, then with four and the next switches the bit count from 16 to 8 and so on? - There are methods to retrieve these values from the stream decoder. Unfortunately these only work, when a frame was already read. Is this by design? Currently I check, whether a frame was read and if so use the FLAC__stream_decoder_get_??? methods to retrieve the sample rate, channel count and sample size, and if not I just return the values stored in the stream info metadata block. Thanks in advance, Ingo
> I don't know if this will help, but when libFLAC calls your > write callback, it will pass you a whole FLAC__Frame, from > which you can get that info. or is that too late also?I need that information mostly, for seeking purposes. The only problem might arise, when there is a seekable file on input and these properties change during playback, because then the seek controls (like position slider, etc) might show wrong values. For a streaming situation this can be ignored, because you can't seek then anyway (when using the other standard DirectShow filters). I just wanted to know, whether I have to forward changes sample rate, etc.. downstream or notify an error to the player. Regards, Ingo
--- Ingo Ralf Blum <ingoralfblum@gmx.de> wrote:> Hi, > > these two values can be stored in the stream info metadata block as > well as > in the header of each frame. This leads to some questions. > > - Are these values supposed to change during playback, e.g. first > comes a > frame with 2 channels, then with four and the next switches the bit > count > from 16 to 8 and so on?they are allowed to change, but that doesn't mean it has to be supported in every app. even in 'flac' changes are currently ignored (I guess it should print an error). the only place this really makes sense to support is in a streaming situation.> - There are methods to retrieve these values from the stream decoder. > Unfortunately these only work, when a frame was already read. Is this > by > design? Currently I check, whether a frame was read and if so use the > FLAC__stream_decoder_get_??? methods to retrieve the sample rate, > channel > count and sample size, and if not I just return the values stored in > the > stream info metadata block.I don't know if this will help, but when libFLAC calls your write callback, it will pass you a whole FLAC__Frame, from which you can get that info. or is that too late also? Josh __________________________________________________ Do You Yahoo!? Got something to say? Say it better with Yahoo! Video Mail http://mail.yahoo.com