avcodec: remove fallbacks for AVCodec.encode() in avcodec_encode_audio2()

We no longer have any audio encoders using AVCodec.encode().
avcodec: refactor avcodec_encode_audio2() to merge common branches
avcodec: for audio encoding, reset output packet when it is not valid
avcodec: do not needlessly set packet size to 0 in avcodec_encode_audio2()

It is already set to 0 by av_free_packet()
avplay: properly close/reopen AVAudioResampleContext on channel layout change

fixes Bug#280
qdm2: clip array indices returned by qdm2_get_vlc().

Prevents subsequent overreads when these numbers are used as indices
in arrays.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org

Signed-off-by: Justin Ruggles <justin.ruggles@gmail.com>
fate: Add oneline comparison method

Signed-off-by: Alex Converse <alex.converse@gmail.com>
Add probe fate tests to test for regressions in detecting media types.

Signed-off-by: Alex Converse <alex.converse@gmail.com>
fate: Add avprobe as a make dependency
fate: Change the probe-format refs to match the final text format committed.
mov: Remove write-only variable in mov_read_chan().

libavformat/mov.c:597:25: warning: variable ‘cflags’ set but not used
flvenc: use AVFormatContext, not AVCodecContext for logging.

Encoder tag being used for muxer messages is confusing.
dv: Split profile handling code into a separate file.
Support decoding unaligned rgb24 lagarith.

Signed-off-by: Kostya Shishkov <kostya.shishkov@gmail.com>
lagarith: add YUY2 decoding support

Unlike other variants, for YUY2 we need to use different prediction:
* on line 0 for luma we should left predict starting from the second pixel
* on line 1 we should left predict first 4 pixels for luma and 2 for chroma
* median prediction employed here is taken directly from HuffYUV
av_samples_fill_array: Mark unmodified function argument as const.

libavcodec/utils.c:274: warning: passing argument 3 of ‘av_samples_fill_arrays’ discards qualifiers from pointer target type
./libavutil/samplefmt.h:151: note: expected ‘uint8_t *’ but argument is of type ‘const uint8_t *’
rtmp: Support 'rtmp_live', an option which specifies if the media is a live stream.

Signed-off-by: Martin Storsjö <martin@martin.st>
Merge remote-tracking branch 'qatar/master'

* qatar/master:
  rtmp: Support 'rtmp_live', an option which specifies if the media is a live stream.
  av_samples_fill_array: Mark unmodified function argument as const.
  lagarith: add YUY2 decoding support
  Support decoding unaligned rgb24 lagarith.
  dv: Split profile handling code into a separate file.
  flvenc: use AVFormatContext, not AVCodecContext for logging.
  mov: Remove write-only variable in mov_read_chan().
  fate: Change the probe-format refs to match the final text format committed.
  fate: Add avprobe as a make dependency
  Add probe fate tests to test for regressions in detecting media types.
  fate: Add oneline comparison method
  qdm2: clip array indices returned by qdm2_get_vlc().
  avplay: properly close/reopen AVAudioResampleContext on channel layout change
  avcodec: do not needlessly set packet size to 0 in avcodec_encode_audio2()
  avcodec: for audio encoding, reset output packet when it is not valid
  avcodec: refactor avcodec_encode_audio2() to merge common branches
  avcodec: remove fallbacks for AVCodec.encode() in avcodec_encode_audio2()

Conflicts:
	ffplay.c
	libavcodec/Makefile
	libavcodec/dvdata.c
	libavcodec/dvdata.h
	libavcodec/qdm2.c
	libavcodec/utils.c
	libavformat/flvenc.c
	libavformat/mov.c
	tests/Makefile

Merged-by: Michael Niedermayer <michaelni@gmx.at>
g723_1: change to encode2()

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
CSCD: must use reget_buffer.

Using release_buffer and get_buffer as currently might
not prefer the previous frame contents which the
decoder relies on.
This leads to horrible playback in players using direct
rendering like MPlayer.

Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>