mpegvideo: Use the current_picture pts

The picture slot can be recycled by select_input_picture and
only current_picture is populated with the valid pts.

Unbreak timestamps when in cbr mode.

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

* commit '1c7b71a5bdb88ebb69734100405bbb5441b871e8':
  mpegvideo: Use the current_picture pts

See: c354576457c8ae0906d6f4f20c80816f3e3bb55d
Merged-by: Michael Niedermayer <michaelni@gmx.at>
avutil/internal: add FF_ALLOC_ARRAY_OR_GOTO & FF_ALLOCZ_ARRAY_OR_GOTO

These are similar to the existing FF_ALLOCZ_OR_GOTO & FF_ALLOC_OR_GOTO

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
avcodec/snow: use FF_ALLOC(Z)_ARRAY_OR_GOTO

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
avcodec/cngenc: Use av_malloc_array()

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
avcodec/libxavs: Use av_mallocz_array()

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
avfilter/pthread: Use av_mallocz_array()

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
avcodec/wma: use av_malloc_array()

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
MAINTAINERS: Add myself as FIC maintainer

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
avformat/avidec: Speed up keyframe detection code

Fixes Ticket3531

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
txd: do not set the codec timebase.

It is not supposed to be changed from outside of lavc.
Set the stream timebase and average framerate instead.
lavc: improve AVCodecContext.delay doxy
avconv: always reset packet pts after decoding an audio frame

Currently, if a decoder sets AVFrame.pts, we'd send the same timestamp
to it twice, which is wrong.
lavf: do not use the parser duration for video

The parser has no way of knowing video duration, and therefore no video
parsers set it.
Merge commit 'a4ed995cabf220029f1d0e185a6fb45eed7b4091'

* commit 'a4ed995cabf220029f1d0e185a6fb45eed7b4091':
  txd: do not set the codec timebase.

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

* commit 'b19a5e51981be5b69cf550a3bc17fe5300d0dbc9':
  lavc: improve AVCodecContext.delay doxy

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

* commit '1ae8198bca749a0cff205196cc83d35b9962849b':
  avconv: always reset packet pts after decoding an audio frame

Conflicts:
	ffmpeg.c

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

* commit 'f9157463dbcd2db8fe9504197c0c04d0d7d04f31':
  lavf: do not use the parser duration for video

Merged-by: Michael Niedermayer <michaelni@gmx.at>
vc1dsp: fix build without inline asm

Reviewed-by: Christophe Gisquet <christophe.gisquet@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
avformat/mpegtsenc: Changed Video PES packet length to 0.

The rational for this is another issue that plex has exposed.  When it is
conducting a transcode of video to HLS for streaming, my father noticed
artifacts when played on his GoogleTV (NSZ-GT1).  He sent me a test file
and I reproduced it on my device of the same model.  It is important to
note that the artifacts were not present when streaming to VLC or QuickTime
Player.  I copied the command-line that plex used, and conducted all of the
following tests using FFmpeg git.

Transcode to HLS: artifacts on playback
Transcode to TS: playback is fine
Cat HLS segments into a single TS: playback is fine
Segment single TS file to segments: artifacts on playback
Segment single TS file to segments using Apple's HLS segmenter: playback is
fine

At this point I carefully examined the differences between Apple's HLS
segmenter output and FFmpeg's.  Among the considerable differences, I
noticed that the video PES packets always had a 0 length.  So I continued:

Transcode to HLS using FFmpeg with 0 length PES packets: playback is fine.
Segment single TS to segments with 0 length PES packets: playback is fine.

All failures mentioned are only on the GTV since it is the only player on
which I could reproduce artifacts.  I only tested the GTV, VLC, and
QuickTime Player though, so my test case is limited.  I do not know if
other players exhibit this issue.

Since it was useful last time, I have uploaded the test file as
hls_pes_packet_length.m4v along with its associated txt file which contains
the transcode command-line that was used.

Reviewed-by: Kieran Kunhya <kierank@obe.tv>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>