Cyberia
16th June 2004, 02:27
I am writing an app to query an avi file and determine it's FourCC code and I'm having some trouble correctly getting XVIDs FourCC code. There are (at least) two API calls that return this value:
AVISTREAMINFO (via the .fccHandler field)
and
AVIREADFORMAT (via the .biCompression field)
In every test I have made, XVID does not return a value to the .biCompression field. XVID does always successfully return the correct value to the .fccHandler field however.
Also, it appears that the AVIREADFORMAT call tries to return a structure of 108 bytes when performed on an XVID file. But EVERY other avi (with a variety of fourCCs) returns a structure of the expected size of 40 bytes.
I have a workaround: Try .biCompression first and if it fails, try .fccHandler. But can anyone explain why .biCompression fails with XVID?
AVISTREAMINFO (via the .fccHandler field)
and
AVIREADFORMAT (via the .biCompression field)
In every test I have made, XVID does not return a value to the .biCompression field. XVID does always successfully return the correct value to the .fccHandler field however.
Also, it appears that the AVIREADFORMAT call tries to return a structure of 108 bytes when performed on an XVID file. But EVERY other avi (with a variety of fourCCs) returns a structure of the expected size of 40 bytes.
I have a workaround: Try .biCompression first and if it fails, try .fccHandler. But can anyone explain why .biCompression fails with XVID?