rtmpproto: Make sure to pass on the error code if read_connect failed

Previously, if read_connect failed, the ret variable was unmodified
and had the value 0, indicating success, which then was returned from
the rtmp_open function, even though it actually failed.

CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
rtmpproto: Handle RTMP chunk size packets before the connect packet

In all other cases where ff_rtmp_packet_read is used, the packet returned
is passed to rtmp_parse_result more or less immediately. In this single
case, the content of the packet was required to be a connect packet.

Some clients, e.g. Open Broadcaster Software, send a chunk size packet
before the connect packet. If the first packet is a chunk size packet,
handle it and read another one, requiring this to be a connect packet
instead.

Signed-off-by: Martin Storsjö <martin@martin.st>
dcadec: Delete redundant init_get_bits call

No initialization is needed in dca_decode_frame, because the next
thing it does is calling dca_parse_frame_header, which takes care of
the needed initialization.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
Merge commit '6477139721f559b26eafd415e23e13ea2b0c27e1'

* commit '6477139721f559b26eafd415e23e13ea2b0c27e1':
  rtmpproto: Make sure to pass on the error code if read_connect failed

Merged-by: Michael Niedermayer <michaelni@gmx.at>
avformat/rtmpproto: Added handling of an initial RTMP chunk size packet.

Fixes ticket #2911.

Reviewed-by: Nicolas George <george@nsup.org>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Merge commit '4d40e073dcdef335215c124d340ea156bc4bdf13'

* commit '4d40e073dcdef335215c124d340ea156bc4bdf13':
  rtmpproto: Handle RTMP chunk size packets before the connect packet

Conflicts:
	libavformat/rtmpproto.c

See: 36b9c27dae452e10b4fff3d10f836160a5b8fbbd
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Merge commit 'b3d905b702dcdda9e3ae2bcb7b5580ca77a96ab7'

* commit 'b3d905b702dcdda9e3ae2bcb7b5580ca77a96ab7':
  dcadec: Delete redundant init_get_bits call

Merged-by: Michael Niedermayer <michaelni@gmx.at>
Fix writing RGB 5:5:5 rawvideo into avi.

WMP expects bits per pixel to be set to 16 for RGB 5:5:5 rawvideo.
Set the bitrate when decoding speex.

The bitrate of the first frame is used as bitrate for the speex stream.
flac demuxer: improve seeking
fate: update seeking reference for flac
avcodec/x86/idct_sse2_xvid: fix non C99 inline function

Found-by: Matt Oliver <protogonoi@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Merge branch 'flac' of https://github.com/FernetMenta/FFmpeg

Merged-by: Michael Niedermayer <michaelni@gmx.at>
avformat/img2dec: fix typo

Found-by: Reimar
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
swscale/swscale: clear to/from convert pointers when they used.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
swscale: factor ff_sws_init_range_convert() out

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
swscale/utils: move handling of unscaled case to the end of init function

This way all context fields get initialized and can be used without needing to reinit the context

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
swscale/utils: fix changing src/dst range after initializing the context

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Merge remote-tracking branch 'upstream/master'