- The `fmt` class member, which was of type AVFormat*, was really
just an unnecessary copy of `(AVFormatContext*)oc->oformat`.
But we were ASSIGNING into its members, which we were definitely
not supposed to be doing. (And in recent FFmpegs, now that
`AVFormat` has been `const`d, we can't.) It's gone; now we just
use `oc->oformat` anywhere we used to access `fmt`.
- The preprocessor macro to allocate a new _stream_ was a mess of
cross purposes: It did allocate a stream, but then it also
allocated a new AvCodecCtx on newer FFmpeg releases. Worse (and
always galling to me), it proceeded to assign to a variable
that WASN'T passed in to the macro, just taking it on faith that
it would only be used where that variable was defined. That's
just... ugh. So I broke it apart into two steps (stream creation
and context allocation), realized the stream creation code was
the same for all ffmpeg versions and didn't need to be a macro
at all, and now a 4-parameter, 6-line magical macro has been
replaced with a simple, zero-side-effect one-liner.
- I also cleaned up the add_video_stream() code to be more like
the add_audio_stream() code, since they were bad-different for
no discernible reason.
- Tweaking GetSmallestFrame to not use an additional mutex.
- Replace 2 mutex on Timeline::GetFrame with 1 mutex.
- Remove mutex from Timeline::ClearAllCache.
- Slow down loop on video cache thread.
- Protect audioThread::Seek() if missing a source.
- Rearrange StopPlayback to always stop the videoCache thread first.