build: Let the ffvhuff decoder/encoder depend on the huffyuv decoder/encoder

Almost all of the code is shared so there is little point in
enabling one decoder/encoder without the other.
configure: Set the thread type after resolving dependencies

A threading type might be detected originally, but later disabled
if one of its dependencies is unavailable.

This makes sure that the threading support item in the configure
output is right for setups where w32threads are available but
native atomics aren't.

Signed-off-by: Martin Storsjö <martin@martin.st>
af_compand: replace strtok_r() with av_get_token()
pthread_frame: flush all threads on flush, not just the first one

avcodec_flush_buffers() must release all internally held references
according to its documentation, for which all the threads need to be
flushed.

CC:libav-stable@libav.org
Bug-Id: vlc/9665
qt-faststart: Increase the copy buffer size to 64 KB

Copying data in chunks of 1 KB is a little wasteful.

64 KB should still easily fit on the stack, so there's no need
to allocate it dynamically.

Signed-off-by: Martin Storsjö <martin@martin.st>
qt-faststart: Simplify code by using a MIN() macro

qt-faststart doesn't use the normal libav headers at all since
it's supposed to be a completely standalone tool, so we implement
the macro locally in this file.

Signed-off-by: Martin Storsjö <martin@martin.st>
qt-faststart: Check fseeko() return codes

Signed-off-by: Martin Storsjö <martin@martin.st>
qt-faststart: Fix the signedness of variables keeping the ftello return values

These variables are assigned the return values of ftello, which
returns an off_t, which is a signed type. On errors, ftello returns
-1, thus make sure this error return value can be stored properly.

Signed-off-by: Martin Storsjö <martin@martin.st>
qt-faststart: Check the ftello() return codes

This silences a warning in the coverity static analyzer.

Signed-off-by: Martin Storsjö <martin@martin.st>
qt-faststart: Check offset_count before reading from the moov_atom buffer

CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
qt-faststart: Avoid unintentionally sign extending BE_32

Without this cast, the BE_32() expression is sign extended when
assigned to an uint64_t, since the uint8_t|uint8_t expression
is promoted to an int.

Also avoid undefined behaviour when left shifting an uint8_t
by 24 by casting it to an uint32_t explicitly before shifting.

Based on a patch by Michael Niedermayer.

Signed-off-by: Martin Storsjö <martin@martin.st>
qt-faststart: Add a note about the -movflags +faststart feature

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

* commit '2f02bbcca050936686482453078e83dc25493da0':
  build: Let the ffvhuff decoder/encoder depend on the huffyuv decoder/encoder

Conflicts:
	configure
	libavcodec/Makefile

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

* commit 'fb3b2f5d923a6e19d80f21eb4e081674bceec810':
  configure: Set the thread type after resolving dependencies

Conflicts:
	configure

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

* commit 'bc6461c2861b7d482a037d3b3e2b44ad48805fa0':
  af_compand: replace strtok_r() with av_get_token()

Conflicts:
	configure
	libavfilter/af_compand.c

Not merged as requested by ubitux
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Merge commit 'd1f9563d502037239185c11578cc614bdf0c5870'

* commit 'd1f9563d502037239185c11578cc614bdf0c5870':
  pthread_frame: flush all threads on flush, not just the first one

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

* commit '3cbc7ef3d60b6af3617079f24a4f401d83353003':
  qt-faststart: Increase the copy buffer size to 64 KB

Conflicts:
	tools/qt-faststart.c

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

* commit 'ea15a9a5d8fa6a71af3101b2af18c4dcac07987f':
  qt-faststart: Simplify code by using a MIN() macro

Conflicts:
	tools/qt-faststart.c

See: 59003fe7c064e98359cce83b1b727fb1026bdf12
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Merge commit '5612244351b2eb3cb4e6225861a0f55aa5d0c475'

* commit '5612244351b2eb3cb4e6225861a0f55aa5d0c475':
  qt-faststart: Check fseeko() return codes

Conflicts:
	tools/qt-faststart.c

See: 0de41ead6f9034e0a834abe51028a02aee094990
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Merge commit '03c2a66fcff9707f71ffef7e61ce5e3973220d4b'

* commit '03c2a66fcff9707f71ffef7e61ce5e3973220d4b':
  qt-faststart: Fix the signedness of variables keeping the ftello return values

Conflicts:
	tools/qt-faststart.c

See: 1838961357e38402be64c0c82a2f08e4e85a0c01
Merged-by: Michael Niedermayer <michaelni@gmx.at>