proresenc_ks: use chroma sampling in autoselection

If the chroma planes aren't subsampled, automatically select
the 4:4:4:4 profile.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
ffmpeg_opt: abort if -to <= -ss

Makes ffmpeg abort instead of continuing when stop_time <= start_time.

Closes ticket #4015.

Signed-off-by: Simon Thelen <ffmpeg-dev@c-14.de>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
avcodec/eamad: use av_freep(), do not leave stale pointers in memory

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
avcodec/dirac_parser: use av_freep(), do not leave stale pointers in memory

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
avcodec/dct: use av_freep(), do not leave stale pointers in memory

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
vf_drawtext: add missing clear of pointers after av_expr_free()

Fixes segfault when using sendcmd with drawtext.

Since LIBAVFILTER_VERSION_MAJOR 5 FF_API_DRAWTEXT_OLD_TIMELINE
evaluates to 0.

Signed-off-by: Karl Kiniger <karl.kiniger@med.ge.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
avcodec/mjpegdec: sanity check bits

Fixes undefined shift
Fixes: asan_heap-oob_16668e9_2_asan_heap-oob_16668e9_346_miss_congeniality_pegasus_mjpg.avi

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
lavf: Don't drop both pts and dts if timestamps are invalid

In these cases, only drop dts. Because if we drop both we have no
timestamps at all for some files.

This improves playback of HLS streams from GoPro cameras.

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

* commit 'bd239c9a2e151c0aeeb653a571f130aae7320894':
  lavf: Don't drop both pts and dts if timestamps are invalid

Conflicts:
	libavformat/utils.c
	tests/ref/fate/vc1-ism

See: cd6851c5ef281e44af7028e08597c4dfb73d880f
Merged-by: Michael Niedermayer <michaelni@gmx.at>
avcodec/error_resilience: avoid pointer arithmetic with NULL

move the code after the existing NULL check
Fixes: signal_sigsegv_844d59_10_signal_sigsegv_a17bb7_366_mpegts_mpeg2video_mp2_dvbsub_topfield.rec

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
avcodec/eatqi: use av_freep(), do not leave stale pointers in memory

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
avcodec/eatgv: use av_freep(), do not leave stale pointers in memory

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
smoothstreamingenc: Simplify code by removing a redundant variable

Signed-off-by: Martin Storsjö <martin@martin.st>
movenc: Adjust edit lists to trim out parts of tracks with negative pts

This makes sure that audio preroll for e.g. AAC is signaled correctly.

Previously we only wrote the edit list correctly if we had negative
dts but started with pts == 0 (e.g. for video with B-frames).

Signed-off-by: Martin Storsjö <martin@martin.st>
movenc: Add some comments explaining subtle details in writing the edit lists

Signed-off-by: Martin Storsjö <martin@martin.st>
movenc: Write edit lists for fragmented files as well, if necessary

This is necessary to get the right timestamp offset for content
that starts with dts != 0.

This currently only helps when writing fragmented files with a non-empty
moov atom. When writing an empty moov atom, we don't have any packets
yet, so we don't know the starting dts for the tracks.

Signed-off-by: Martin Storsjö <martin@martin.st>
movenc: Print a warning for an unhandled case of nonzero start dts with empty_moov

Signed-off-by: Martin Storsjö <martin@martin.st>
movenc: Simplify code by using an existing local pointer

Signed-off-by: Martin Storsjö <martin@martin.st>
icecast: Do not use chunked post

Icecast uses HTTP 1.0 while Libav uses HTTP 1.1 and enables by
default chunked post.

Icecast actually forwards the HTTP chunk headers to the listener
as part of the media stream (without the chunk encoding HTTP headers)
causing the players to lose sync.

Disabling the option is enough to feed icecast properly.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
avfilter: remove obsolete FF_API_DRAWTEXT_OLD_TIMELINE cruft