lavf: deobfuscate read_frame_internal().

Split off packet parsing into a separate function. Parse full packets at
once and store them in a queue, eliminating the need for tracking
parsing state in AVStream.

The horrible unreadable loop in read_frame_internal() now isn't weirdly
ordered and doesn't contain evil gotos, so it should be much easier to
understand.

compute_pkt_fields() now invents slightly different timestamps for two
raw vc1 tests, due to has_b_frames being set a bit later. They shouldn't
be more wrong (or right) than previous ones.
avcodec: add av_get_exact_bits_per_sample() function

This only returns bits per sample when it is exactly correct. That is, the
codec contains only raw samples with no frame headers or padding. This applies
to basically all PCM codecs and a small subset of ADPCM codecs.
avcodec: add av_get_audio_frame_duration() function.

This is a utility function for the user to get the frame duration based on
the codec id, frame size in bytes, and various AVCodecContext parameters.
riffenc: use av_get_audio_frame_duration()

For encoding, frame_size is not a reliable indicator of packet duration.
Also, we don't want to have to force the demuxer to find frame_size for
stream copy to work.
rtpenc: use av_get_audio_frame_duration() for max_frames_per_packet

It is more reliable than AVCodecContext.frame_size for codecs with constant
packet duration.
swfenc: use av_get_audio_frame_duration() instead of AVCodecContext.frame_size

This way we can do stream copy without having the demuxer wait until
frame_size has been set.
avformat: do not require frame_size in avformat_find_stream_info() for AAC

We already will get the needed info because of CODEC_CAP_CHANNEL_CONF
avformat: do not require frame_size in avformat_find_stream_info() for MP1/2/3

It was only needed to avoid a bad time base (and thus non-monotone timestamps)
for stream copy to avi.
avformat: do not require frame_size in avformat_find_stream_info() for CELT

In Ogg/CELT, frame_size is found in the same place as the sample_rate and
channels, so we do not need to force the frame_size to be parsed.
rdt: remove workaround for infinite loop with aac

avformat_find_stream_info() no longer hangs while waiting for AAC frame_size
ape: do not set AVCodecContext.frame_size.

prevents lavf from setting incorrect packet durations.
mov: do not set AVCodecContext.frame_size

It is not necessary.
aiffdec: do not set AVCodecContext.frame_size

It is unnecessary. Also, for some codecs we're reading more than 1 frame per
packet. Instead we use a private context variable to calculate the bit rate,
stream duration, and packet durations.

Updated FATE seek test, which has slightly different timestamps due to a
more accurate bit rate calculation.
amr demuxer: do not set AVCodecContext.frame_size.

it is not necessary.
siff: do not set AVCodecContext.frame_size

also, properly set AVCodecContext.bits_per_coded_sample, AVStreasm.start_time,
and AVPacket.duration.
alsdec: do not set AVCodecContext.frame_size

It is not necessary
libopencore-amr: do not set AVCodecContext.frame_size

It is not necessary
libspeexdec: do not set AVCodecContext.frame_size

It is not necessary
dca_parser: parse the sample rate and frame durations
lavf: Use av_get_audio_frame_duration() in get_audio_frame_size()

Also, do not give AVCodecContext.frame_size priority for muxing.

Updated 2 FATE references:
dxa-feeble - adds 1 audio frame that is still within 2 seconds as specified
             by -t 2 in the FATE test
wmv8-drm-nodec - durations are not needed. previously they were estimated
                 using the packet size and average bit rate.