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>
* commit 'bb95334c34d0d9abccea370ae25c4765d7764ab8':
qt-faststart: Check offset_count before reading from the moov_atom buffer
Conflicts:
tools/qt-faststart.c
See: 0ea4742341
Merged-by: Michael Niedermayer <michaelni@gmx.at>
* commit 'ea15a9a5d8fa6a71af3101b2af18c4dcac07987f':
qt-faststart: Simplify code by using a MIN() macro
Conflicts:
tools/qt-faststart.c
See: 59003fe7c0
Merged-by: Michael Niedermayer <michaelni@gmx.at>
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>
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 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>
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>
in case av_interleaved_write_uncoded_frame fails it seems
frame is freed for the second time in fail section.
Signed-off-by: Lukasz Marek <lukasz.m.luki@gmail.com>
Reviewed-by: Nicolas George <george@nsup.org>
This commit also removes 1 trailing whitespace as otherwise the push hook rejects it
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* commit '87acd33c092ab9e7d73686627e9105d99c1e4928':
aviocat: Add support for specifying the input duration
Merged-by: Michael Niedermayer <michaelni@gmx.at>
* commit '03f2de5856ec8571fcf5f4cf6dccc713294af545':
aviocat: Check the argv array length before reading element i+1
Merged-by: Michael Niedermayer <michaelni@gmx.at>
This avoids the caller having to calculate the byte rate if wanting
to push a file in a rate resembling realtime.
Signed-off-by: Martin Storsjö <martin@martin.st>
* commit '583a287f6f48f263859df142e6f90993e4217c72':
ismindex: Calculate the file duration among the included tracks
Merged-by: Michael Niedermayer <michaelni@gmx.at>
* commit 'd347a7b248d4ffdc278373fecf033b0ade030343':
ismindex: Use the individual stream duration instead of the global one
Merged-by: Michael Niedermayer <michaelni@gmx.at>
If the input file contains other tracks (non video/audio) that
aren't included in ismindex, the global file duration as returned
by libavformat might not be equal to the maximum of the duration
of the actual included tracks.
Signed-off-by: Martin Storsjö <martin@martin.st>
The stream duration is used for calculating the duration of the
last fragment easily without manually parsing anything else than
the mfra/tfra atoms. When the global file duration was used
previously, the duration of the last fragment could end up wrong
if the streams weren't equally long.
Signed-off-by: Martin Storsjö <martin@martin.st>
This fixes compilation with MSVC and ICL, and makes ffhash consistent
with how the rest of the codebase uses read().
Reviewed-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
The benchmark tests the speed of the following algorithms:
MD5, SHA-1, SHA-256, SHA-512, RIPEMD-160, AES-128.
It can optionally be built to perform the same benchmark on
other crypto libraries, for comparison purposes.
The supported libraries are:
- crypto: OpenSSL's libcrypto;
- gcrypt: GnuTLS's libgcrypt;
- tomcrypt: LibTomCrypt
To enable them, use this syntax:
make VERSUS=crypto+gcrypt+tomcrypt tools/crypto_bench
They do not need to have been enabled in configure.