Error GetDuration is XA_TIME_UNKNOWN!!!!

I used the code native-media in sample of andorid NDK, and i add function to get the current and duration time. Current time is OK, but duration time is always XA_TIME_UNKNOW, i tested many file video, and result is same.

What should I do for this error ?
Thanks so much for any reply soon

This may be an implementation specific error. Are you reading the file from a local file system or from a streaming source. If the source is streaming, then there may be no way for the implementation to know the duration and therefore it returns XA_TIME_UNKNOWN. If you are reading from a local file system, GetDuration() should return the actual duration of the content.