ffplay: increase AV_SYNC_THRESHOLD_MIN to 0.04

Less than 0.04 sec delays should not be noticable, and it helps us with 50fps
content where some timing errors can cause a frame dup where it is not really
necessary.

Signed-off-by: Marton Balint <cus@passwd.hu>
ffplay: fix compilation with Visual Studio

Based on a patch by achristensen from trac.ffmpeg.org.

Partially fixes ticket #3580.

Signed-off-by: Marton Balint <cus@passwd.hu>
cmdutils: replace usages of "#ifdef __MINGW32__" with "#ifdef _WIN32" because MSVC only defines _WIN32

With the previous patch, this should fix ticket #3580 as well.

Signed-off-by: John Peebles <johnpeeb@gmail.com>
ffplay: try multiple sample rates if audio open fails

Should fix ticket #3509.

Signed-off-by: Marton Balint <cus@passwd.hu>
ffplay: fix typo in docs

Signed-off-by: Marton Balint <cus@passwd.hu>
ffplay: add support for toggling between multiple video filters with the w key

Signed-off-by: Marton Balint <cus@passwd.hu>
avfilter/edgedetect: reuse already defined ctx.
Merge remote-tracking branch 'cus/stable'

* cus/stable:
  ffplay: add support for toggling between multiple video filters with the w key
  ffplay: fix typo in docs
  ffplay: try multiple sample rates if audio open fails
  cmdutils: replace usages of "#ifdef __MINGW32__" with "#ifdef _WIN32" because MSVC only defines _WIN32
  ffplay: fix compilation with Visual Studio
  ffplay: increase AV_SYNC_THRESHOLD_MIN to 0.04

Merged-by: Michael Niedermayer <michaelni@gmx.at>
Merge remote-tracking branch 'cehoyos/master'

* cehoyos/master:
  Fix compilation of libavcodec/x86/hevc_deblock.asm with nasm.

Merged-by: Michael Niedermayer <michaelni@gmx.at>
riff: Pass block_align to estimate frame duration

Fix incorrect wSamplesPerBlock(=0) written for ADPCM_IMA_WAV

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
lavu: add av_gettime_relative()

These functions are using the POSIX clock_gettime() function with the
CLOCK_MONOTONIC clock id. If these are not present on the targeted
platform, the new functions will fallback on using the original realtime functions
av_gettime() and av_usleep().

Monotonic support can be added on other platforms with their
equivalent native system API eventually if possible.

Whenever time is requested to measure relative time, the monotonic clock,
when available, is superior to the system realtime clock because it is
not affected by discontinuous jumps in the system time

In a future step, offering the flexibility to let the user choose between
rt and monotonic clock for avdevices packets will be investigated.

It is very easy to experience the issues that this patch attempt to address
by rewinding back in the past the system time while ffmpeg is running.

this is breaking the ffmpeg report printing (ffmepg.c:print_report()) and
the the rate emulator functionality (-re) without the patch.

Signed-off-by: Olivier Langlois <olivier@trillion01.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
lavc: Use av_gettime_relative()

Whenever av_gettime() is used to measure relative period of time,
av_gettime_relative() is prefered as it guarantee monotonic time
on supported platforms.

Signed-off-by: Olivier Langlois <olivier@trillion01.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
tools: Use av_gettime_relative()

Whenever av_gettime() is used to measure relative period of time,
av_gettime_relative() is prefered as it guarantee monotonic time
on supported platforms.

Signed-off-by: Olivier Langlois <olivier@trillion01.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
configure: make sure pkg-config flags are populated in FT test.
configure: make vp9 decoder select the parser.

The parser is needed. FATE breaks if not present.
lavf: Use av_gettime_relative()

Whenever av_gettime() is used to measure relative period of time,
av_gettime_relative() is prefered as it guarantee monotonic time
on supported platforms.

Signed-off-by: Olivier Langlois <olivier@trillion01.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Merge commit '584f88409062f7a134e7391887899e8e723ab6ff'

* commit '584f88409062f7a134e7391887899e8e723ab6ff':
  riff: Pass block_align to estimate frame duration

Merged-by: Michael Niedermayer <michaelni@gmx.at>
ffplay: Use av_gettime_relative()

Whenever av_gettime() is used to measure relative period of time,
av_gettime_relative() is prefered as it guarantee monotonic time
on supported platforms.

Signed-off-by: Olivier Langlois <olivier@trillion01.com>
Reviewed-by: Marton Balint <cus@passwd.hu>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
avformat/aviobuf/ff_get_line: also accept \r as end of line character

Fixes Ticket3108

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
avformat/rtpenc: switch to AVFMT_FLAG_BITEXACT

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