tree.h: K&R formatting and typo cosmetics
tree-test: Refactor and plug memory leaks

With the most annoying memory leak found by Derek Buitenhuis.
avfilter: Add some missing FF_API_AVFILTERBUFFER ifdefs
rtpenc: Simplify code by introducing a macro for rescaling NTP timestamps

Signed-off-by: Martin Storsjö <martin@martin.st>
rtpproto: Support nonblocking reads

Signed-off-by: Martin Storsjö <martin@martin.st>
rtpproto: Remove a misplaced comment

The fdset is a pollfd array nowadays, and it is already populated
at this point.

Signed-off-by: Martin Storsjö <martin@martin.st>
rtpproto: Simplify the rtp_read function by looping over the fds

This avoids having duplicate code where only the fd parameter
differs.

Signed-off-by: Martin Storsjö <martin@martin.st>
rtpproto: Move rtpproto specific function declarations to a separate header

Mixing these with the rtp depacketizer functions in rtpdec.h is
no good.

Signed-off-by: Martin Storsjö <martin@martin.st>
avopt: Check whether the object actually has got an AVClass

AVIOContext has got an av_class member that only gets set if
opening the context using avio_open2, but not if allocating a
custom IO context. A caller that wants to read AVOptions from
an AVIOContext (recursively using AV_OPT_SEARCH_CHILDREN) may
not know if the AVIOContext actually has got a class set or not.

Signed-off-by: Martin Storsjö <martin@martin.st>
avconv: Call exit_program instead of exit in avconv_opt as well

This seems to have been missed in 636ced8e1dc.

Signed-off-by: Martin Storsjö <martin@martin.st>
avconv: add -n option to immediately exit when output files already exist

Signed-off-by: Martin Storsjö <martin@martin.st>
rtpproto: Check the size before reading buf[1]

I doubt that anyone ever would try to send a 1 byte packet
via the RTP protocol, but check just in case - it shouldn't
crash at least.

Signed-off-by: Martin Storsjö <martin@martin.st>
rtpproto: Allow specifying a separate rtcp port in ff_rtp_set_remote_url

A separate rtcp port can already be set when opening the rtp
protocol normally, but when doing port setup as in RTSP (where
we first need to open the local ports and pass them to the peer,
and only then receive the remote peer port numbers), we didn't
check the same url parameter as in the normal open routine.

Signed-off-by: Martin Storsjö <martin@martin.st>
avframe: have av_frame_get_side_data take const AVFrame*

Signed-off-by: Anton Khirnov <anton@khirnov.net>
Merge commit 'a9b04b2c43f95cc17c2291f83c27a3119471d986'

* commit 'a9b04b2c43f95cc17c2291f83c27a3119471d986':
  tree.h: K&R formatting and typo cosmetics

Merged-by: Michael Niedermayer <michaelni@gmx.at>
rtsp: Simplify code for forming the remote peer url

Signed-off-by: Martin Storsjö <martin@martin.st>
Merge commit 'c2e936de07d054bf476e60445b453bf6b4836820'

* commit 'c2e936de07d054bf476e60445b453bf6b4836820':
  tree-test: Refactor and plug memory leaks

Conflicts:
	libavutil/tree.c

Most of this commit is not merged due to bugs in it

Merged-by: Michael Niedermayer <michaelni@gmx.at>
avutil/tree: fix memleaks

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Merge commit '45dd1ae1b3c18331f3db2293a9135bc5851e553f'

* commit '45dd1ae1b3c18331f3db2293a9135bc5851e553f':
  avfilter: Add some missing FF_API_AVFILTERBUFFER ifdefs

Conflicts:
	libavfilter/buffer.c
	libavfilter/internal.h

Merged-by: Michael Niedermayer <michaelni@gmx.at>
Merge commit '2e814d0329aded98c811d0502839618f08642685'

* commit '2e814d0329aded98c811d0502839618f08642685':
  rtpenc: Simplify code by introducing a macro for rescaling NTP timestamps

Merged-by: Michael Niedermayer <michaelni@gmx.at>