angler-fishThe Vulnerability History Project

Switch to AVIO instead of a custom FFmpeg URLProtocol handler.

      FFmpegGlue is a filthy den of sin:
- Singleton.
- Unchecked initialization.
- Mixed signed, unsigned usage.
- Requires custom FFmpeg patches.
- Hacks IO through http://0xDEADBEEF

Switching to AVIO will absolve FFmpegGlue of its sins and has the added bonus
of allowing us to tweak the buffer sizes used for read requests over the wire.

AVIO works through a special AVIOContext created through avio_alloc_context()
which is attached to the AVFormatContext used for demuxing. The AVIO context
is initialized with read and seek methods identical to the existing URLProtocol
structures.

During avformat_open_input() we tell FFmpeg to use our AVIO context by
passing NULL in for the filename parameter. FFmpeg will now redirect all reads
and seeks through our AVIO context.

The new FFmpegGlue also handles all destruction cases which can occur after
an OpenContext(), allowing us to unify the slightly disparate shutdown paths
used by FFmpegDemuxer and AudioFileReader.
 
BUG=118986, 146529
TEST=unit tests under tooling. layout tests. manual playback pass.

Review URL: https://chromiumcodereview.appspot.com/10912080

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@165502 0039d316-1c4b-4281-b951-d872f2087c98
    
commit b3d4d8f0c45266ac1b5b46e3baa568348b4233c3
+26
+4
+36 -21
+5 -6
+1 -1
+1 -1
+40 -17
+5 -3
+6 -6
+92 -86
+64 -35
+206 -126
+2 -1
+1 -1
+2 -2
+1 -2
+29 -17
expand_less