Provide necessary codec structure for compatibility with ffmpeg.
file: Do not recycle the AVStream codec context

This the correct pattern since Libav 0.6.
file: Set the time_base to the AVStream, not the codec

The latter discouraged since Libav 0.8 and deprecated since Libav11.