QUOTE(shaohao @ Jun 3 2007, 15:31)

Here is two pieces of my code
...
P.S. My "mediareader" only support read, seek, getlength, getcurpostion routines. I think it is not important for a decoder to support write function.
That's ok. From the SDK documentation of tak_SSD_Create_FromStream:
CODE
Currently, the SSD uses the following functions of the interface:
CanRead
CanWrite
CanSeek
Read
Seek
GetLength
Most of your code looks ok. Two remarks for the Seek funtion:
QUOTE(shaohao @ Jun 3 2007, 15:31)

and the Seek function
CODE
int QDecoder::Seek(int ms)
{
TtakResult ret;
TtakInt64 spos;
if ( tak_True != tak_SSD_Valid( m_Decoder))
return 0;
spos = (TtakInt64)(ms/1000.0 * m_StreamInfo.Audio.SampleRate);
ret = tak_SSD_Seek( m_Decoder, spos);
if ( tak_True != tak_SSD_Valid( m_Decoder))
return 0;
_pos = spos * m_StreamInfo.Audio.SampleRate * 1000.0;
return 1;
}
1) You don't have to check the validity of the decoder before calling tak_SSD_Seek(). If it was invalid before the call, the function will immediately return with an error code and your next call to tak_SSD_Valid() will return false. More info about error handling can be found in "Function results and error handling".
2) I am not sure, if your code guarantees, that the "spos" - parameter will always stay within the allowed range. From the SDK:
"ASamplePos must be a value between 0 and (stream length - 1)."
Unfortunately you haven't answered my other questions: Are you sure that your files are valid? Does at least sequential playback work with your plugin?
From my experience i would recommend to check your implementation of the TtakStreamIoInterface - interface. Here it's easy to make subtle errors...
Thomas