Make AVIO_FLAG_ access constants work as flags, and in particular fix
the behavior of functions (such as avio_check()) which expect them to
be flags rather than modes.
This breaks API.
current code wouldn't always error out on errors.
Based on patch by Stephen d'Angelo <sdangelo evertz com>.
Originally committed as revision 25260 to svn://svn.ffmpeg.org/ffmpeg/trunk
Therefore, init it with NULL to prevent a crash on invalid streams.
Patch by Zhentan Feng <spyfeng gmail com>.
Originally committed as revision 24960 to svn://svn.ffmpeg.org/ffmpeg/trunk
Zhentan Feng <spyfeng gmail com> as part of Google's Summer of Code program.
Originally committed as revision 24861 to svn://svn.ffmpeg.org/ffmpeg/trunk