If AV codec context doesn't match the context for which it was first opened, close/re-open it.

There's something suspiciously wrong about the way we handle change of streams. This is at best a work-around.

Fixes #11519