avformat: simplify avformat_close_input

avio_close checks by itself for NULL condition.
avformat: refactor avformat_close_input

Do not crash if the input format is not allocated yet.
vorbisdec: ensure FASTDIV denominator is never 1

In both usages of FASTDIV the denominator might be 1.

Using a branch could make the function slower than using a normal
division.

Both denominator and numerator can be multiplied by 2 safely and
using shifts is faster than using a branch.
configure: x86: improve ebp availability check

Some compilers are extra strict about register usage in main(),
disallowing ebp in inline asm there while allowing it elsewhere.
This change makes the test better reflect actual usage.

Signed-off-by: Mans Rullgard <mans@mansr.com>
fate: ac3: add 4.0 and downmix tests

Signed-off-by: Mans Rullgard <mans@mansr.com>
lavf/compute_pkt_fields: only run pts by duration correction if reference ts is available

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
riff: Add SVQ3 fourcc

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
riff: Add SVQ3 fourcc

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
tools: move raw-test program to tools, with the name fourcc2pixfmt
lavfi/hue: add dynamic expression evaluation support

Signed-off-by: Stefano Sabatini <stefasab@gmail.com>
aacdec: add support for dual mono in Japanese DTV

Japanese DTV uses some non standard extensions in AAC audio.
One example is 'dual mono', which combines two independent
audio into one stereo stream, storing them in left and right channels
respectively.  Historically, dual mono audio has been used for
multi-lingual audio, one for local/native language, and another for english,
and usually the "main" (local language) channel should be output without
any user interactions.

The frames of those dual mono audio are allowed to set
ADTS channel_config field to 0, and just contain two SCE's *WITHOUT* PCE,
which is a non standard extension by Japanese DTV standard.
(ref. ARIB STD-B32 PartII 5.2.3)

This patch adds an AVPacket side data, AV_PKT_DATA_JP_DUALMONO,
which indicates that the AVPacket is likely to contain an audio frame
with the above dual mono extension, and has the parameter to specify
the desired channel selection in that case.
It also makes aacdec to detect dual mono and output just the desired
channel when this side data is attached.

Signed-off-by: Akihiro Tsukada <atsukada@users.sourceforge.net>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
bintext: mark hscroll() as unused

This fixes a warning about a unused function
Alternatively the function could be removed

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

* qatar/master:
  riff: Add SVQ3 fourcc
  fate: ac3: add 4.0 and downmix tests
  configure: x86: improve ebp availability check
  vorbisdec: ensure FASTDIV denominator is never 1
  avformat: refactor avformat_close_input
  avformat: simplify avformat_close_input

Conflicts:
	configure
	libavcodec/vorbisdec.c
	libavformat/utils.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec: remove av_destruct_packet_nofree()

This function was deprecated two major versions ago (2009).

Signed-off-by: Mans Rullgard <mans@mansr.com>
cmdutils: avoid setting data pointers to invalid values in alloc_buffer()

Fixes bug 352.
Enhance doc on asyncts audiofilter

Signed-off-by: Anton Khirnov <anton@khirnov.net>
ffmpeg: call sub2video_update for end packets.

Without that change, all subtitles will stay until the next one.
lavc: set AVSubtitle.pts if possible.

If the packet has a PTS and the corresponding time base is known,
set the pts field of the decoded subtitle structure before the
call to the decoder. The decoder is still allowed to change the
PTS if necessary.
lavc/pgssubdec: use the PTS from the presentation segment.

According to the sample for trac ticket #1722, PGS subtitles
are decoded from several packets at the same DTS and varying PTS.
The PTS from the presentation segment seem to be the valid one;
in particular, clear subtitles are too early with the other PTS.
ffmpeg: use PTS from the AVSubtitle structure.