Solution
This error occurs when the AVI Refnum representing your AVI file session is either incorrect or not a refnum. There are a number of causes for this, but in general the following steps will help you narrow down the issue.
- Make sure that the reference is not being closed elsewhere while you are still trying to use it.
- Use probes and breakpoints to check the value of the refnum as your application is being used. The refnum may be getting replaced or modified somewhere.
- Ensure that any structures using your refnum pass the refnum through in all cases. Make sure no output tunnels are using default values, which would overwrite the refnum with an invalid value.
In the case of reading an AVI file, this issue is caused by an incompatible codec.
- Ensure that the AVI you're trying to read is in the correct codec.
- If the AVI is the product of a conversion from a different format ensure you select a compatible codec when converting the file to AVI.