cosmetics: Clean up the tiffenc pix_fmts declaration to match the style of others

Signed-off-by: Martin Storsjö <martin@martin.st>
asfdec: Add an option for not searching for the packet markers

Some streams don't contain these.

Signed-off-by: Martin Storsjö <martin@martin.st>
rtpdec_asf: Set the no_resync_search option for the chained asf demuxer

Searching for packet markers doesn't make sense for this use case,
where packets are fed one at a time to the demuxer.

This fixes playing back streams that have packets not starting
with the 0x82, 0x00, 0x00 marker.

Signed-off-by: Martin Storsjö <martin@martin.st>
rtsp: Don't expose the MS-RTSP RTX data stream to the caller

This avoids exposing a dummy AVStream which won't get any data
and which will make avformat_find_stream_info wait for info about
this stream.

Signed-off-by: Martin Storsjö <martin@martin.st>
cosmetics: Fix indentation

Signed-off-by: Martin Storsjö <martin@martin.st>
hwaccel: mpeg2: decode first field, if requested.

If user opted to present fields as they come, then the first field
picture needs to be submitted to the HW for decoding. In particular,
this fixes MPEG-2 decoding of interlaced streams.

Tested on Intel Cedar Trail, Sandy Bridge and Ivy Bridge platforms.
Someone reported on the ffmpeg-devel@ list this also works on DXVA
(Windows) and other Linux platforms (NVIDIA, through the VA wrapper).

This also means a similar patch to non-hwaccel VDPAU may be necessary.

Note: I believe the SLICE_FLAG_ALLOW_FIELD is useless since the first
field shall always be submitted to the HW anyway. Nobody uses HW accels
(dxva, vaapi, vdpau, etc.) without that flag though.

Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
Signed-off-by: Martin Storsjö <martin@martin.st>
vaapi: mpeg2: fix slice_vertical_position calculation.

VASliceParameterBufferMPEG2.slice_vertical_position shall express
the slice vertical position from the original bitstream. The HW
decoder will correctly decode to the right line computed from the
appropriate top_field_first and is_first_field flags.

This patch aligns with DXVA's definition, which is what most HW and
drivers expect. In particular, Intel PowerVR (Cedarview et al.) and
NVIDIA (through VA-to-VDPAU layer). Since it looks more complex to fix
binary drivers, I aligned the Intel Gen driver (Sandy Bridge et al.)
to this behaviour, while maintaining compatibility with codec layers
not providing this patch yet.

Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
Signed-off-by: Martin Storsjö <martin@martin.st>
rtsp: Don't use uninitialized data if there are no streams

Signed-off-by: Martin Storsjö <martin@martin.st>
rtsp: Don't use av_malloc(0) if there are no streams

Signed-off-by: Martin Storsjö <martin@martin.st>
avutil: add av_get_packed_sample_fmt() and av_get_planar_sample_fmt()

Based on a patch by Clément Bœsch <ubitux@gmail.com>
audioconvert: make av_get_channel_layout accept composite names.

Signed-off-by: Nicolas George <nicolas.george@normalesup.org>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Justin Ruggles <justin.ruggles@gmail.com>
avcodec: validate the channel layout vs. channel count for decoders

Set avctx->channel_layout to 0 if the channel count does not match
avctx->channels.
avconv: only set SAR once on the decoded frame.

No point in repeating the assignment for each output stream.
avconv: remove OutputStream.picref.

It's only used inside transcode_video() and there's no point in
preserving it between subsequent calls. So use a local variable instead.
avutil: allow NULL linesize in av_samples_fill_arrays() and av_samples_alloc()
avutil: use align == 0 for default alignment in audio sample buffer functions
avcodec: use align == 0 for default alignment in avcodec_fill_audio_frame()

Use default alignment in audio_get_buffer()
avconv: use default alignment for audio buffer
avconv: allow '-async -1' to disable timestamp sync for audio encoding

This will allow a workaround for cases where input timestamps are invalid or
when decoder delay of 1 packet or more confuses avconv into using the wrong
timestamps as a sync reference.
ppc: Add/remove a number of const qualifiers to fix related warnings.