avplay: Always free find_stream_info options

CC: libav-stable@libav.org
Bug-Id: CID 1238794
avplay: Always free opts

CC: libav-stable@libav.org
Bug-Id: CID 733793
avprobe: Remove a pointless check

The element is always valid.

CC: libav-stable@libav.org
Bug-Id: CID 732276
avconv: fix leak in filter error

CC: libav-stable@libav.org
Bug-Id: CID 1005311
avconv: check return value

CC: libav-stable@libav.org
Bug-Id: CID 1224275
avformat: Make avformat_free_context handle NULL

Work as the other free()-like functions.

Bug-Id: CID 1087081
CC: libav-stable@libav.org
cmdutils: Use the correct guard

The OptionDef arrays are terminated with a { NULL } element not NULL.

CC: libav-stable@libav.org
Bug-Id: CID 703769
rtmpproto: Add function to read a number response

Packets that contain a number as a result to a rtmp function call are
structured the same way (String, Number, Null, Number). This new method
also includes more bounds checks to better handle packets that are not
structured as expected.

Signed-off-by: Martin Storsjö <martin@martin.st>
rtmpproto: Add getStreamLength call to query duration

In (non-live) streams with no metadata, the duration of a stream can
be retrieved by calling the RTMP function getStreamLength with the
playpath. The server will return a positive duration upon the request if
the duration is known, otherwise either no response or a duration of 0
will be returned.

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

* commit 'cf83c0173917a44b89a25ea2b435429bbf9ee767':
  avplay: Always free find_stream_info options

Conflicts:
	ffplay.c

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

* commit 'e58a140cf91d1a9cdfa3115d73c923dab0e9e7dc':
  avplay: Always free opts

Conflicts:
	ffplay.c

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

* commit 'aeb23fc4549a25ef32ff085d2a76227f90caf403':
  avprobe: Remove a pointless check

Conflicts:
	avprobe.c

No change as the code does not exist in ffprobe

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

* commit 'c802a2e718fb3619291f310f851f1a1cdcf4f581':
  avconv: fix leak in filter error

Conflicts:
	ffmpeg_filter.c

See: 14369f59c5ad1fb817fb4d94073f31cccf12b556
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Merge commit 'c92965dbfbb7e2b49df14db2fd0e23a29295730a'

* commit 'c92965dbfbb7e2b49df14db2fd0e23a29295730a':
  avconv: check return value

Conflicts:
	ffmpeg.c

See: 4930cd13d634d5f4e284de3a955d5c6a84fd65e2
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Merge commit '0db6bbb24c1a9f6b5527f460361a5a4132248eee'

* commit '0db6bbb24c1a9f6b5527f460361a5a4132248eee':
  avformat: Make avformat_free_context handle NULL

See: ee23dcf534801931c13f9f534586b56e231d3085
Merged-by: Michael Niedermayer <michaelni@gmx.at>
libfdk-aacdec: Enable Decoder Downmix including Downmix Metadata Support

The FDK decoder is capable of producing mono and stereo downmix from
multichannel streams. These streams may contain metadata that control
the downmix process. The decoder requires an Ancillary Buffer in order to
correctly apply downmix in streams containing downmix Metadata. The
decoder does not have an API interface to inform of the presence of
Metadata in the stream, and therefore the Ancillary Buffer is always
allocated whenever a downmix is requested.

When downmixing multichannel streams, the decoder requires the output
buffer in aacDecoder_DecodeFrame call to be of fixed size in order to
hold the actual number of channels contained in the stream. For example,
for a 5.1ch to stereo downmix, the decoder requires that the output buffer
is allocated for 6 channels, regardless of the fact that the output is in
fact two channels.

Due to this requirement, the output buffer is allocated for the maximum
output buffer size in case a downmix is requested (and also during
decoder init). When a downmix is requested, the buffer used for output
during init will also be used for the entire duration the decoder is open.
Otherwise, the initial decoder output buffer is freed and the decoder
decodes straight into the output AVFrame.

Signed-off-by: Martin Storsjö <martin@martin.st>
libfdk-aacdec: Enable Dynamic Range Control Metadata Support

For streams which contain DRC metadata, the FDK decoder is able to
control rendering of the decoded output. The rendering parameters
are detailed in fdk_aac_dec_options [].

The default behavior is left up to the decoder.

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

* commit '47e3e1097e09da7f973908e09df15e3bb7c5e1f4':
  cmdutils: Use the correct guard

Conflicts:
	cmdutils.c

See: 35daf3ca8173f80f200860e06a410ced31a8b360
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Merge commit '324b23dde1bc8638959eb32419c95a93906db272'

* commit '324b23dde1bc8638959eb32419c95a93906db272':
  rtmpproto: Add function to read a number response

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

* commit 'e65c776d18dc14df8a279e017760862f9fc8763b':
  rtmpproto: Add getStreamLength call to query duration

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