Instead of returning an error when bytes are left over, just return
the number of actually used bytes as other decoders do.
Instead add a special case so an error will be returned when none
of the data looks valid to avoid making debugging a pain.
Signed-off-by: Janne Grunau <janne-ffmpeg@jannau.net>
Keep the original corner case behaviour, where reuse is enabled
for the case where no argument is given to the reuse url option.
Signed-off-by: Martin Storsjö <martin@martin.st>
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
The avcodec_thread_free() compatibility wrapper calls ff_thread_free(),
which is not defined when threading is disabled. Make this call
conditional.
Signed-off-by: Mans Rullgard <mans@mansr.com>
check AVCodecContext->sample_fmt against AVCodec->sample_fmts[] to ensure
that the encoder supports the specified sample format. Error out if it doesn't.
Previously, it would continue and output garbage. Fixes issue 2587.
Decode times for big_buck_bunny_720p_stereo:
1 thread:
real 1m14.227s
user 1m13.104s
sys 0m1.108s
2 threads: (33% faster)
real 0m49.329s
user 1m33.735s
sys 0m1.834s
3 threads: (44% faster)
real 0m41.593s
user 1m44.884s
sys 0m1.967s
As a side effect of the last commit, avcodec_open() now calls it automatically,
so there is no longer any need for clients to call it.
Instead they should set AVCodecContext.thread_count.
avcodec_thread_free() is deprecated, and will be removed from avcodec.h at the
next MAJOR libavcodec bump.
Rename the functions to ff_thread_init/free, since they are now internal.
Wrappers are provided to maintain API compatibility.
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
Due to being pants-on-head retarded, libavcodec defaults this to zero, which
results in broken output. This didn't affect ffmpeg.c, which sets it itself,
but caused problems for other calling apps using VBV.
Fix emu_edge_v_extend_15 to be <128 bytes on Win64, by being more strict
on the size of registers and which registers are being used for operations
where multiple are available. This fixes segfaults in emulated_edge()
function calls on Win64.
Currently (since the data_offset fix) the ogg demuxer assumes that
after the first non-header packets in any stream no more header packets
will follow.
This is not guaranteed, so change the code back again to wait until it
has finished the headers for all streams before returning from ogg_get_headers.
This fixes issue 2428.
Signed-off-by: Mans Rullgard <mans@mansr.com>
Haiku does not have a separate libm, so do not try to link to it.
Signed-off-by: François Revol <revol@free.fr>
Signed-off-by: Mans Rullgard <mans@mansr.com>
In all 3 cases, the decoding continues and thus a warning would be sufficient.
Helps application that catch them with own log handers to handle them
accordingly.
Signed-off-by: Mans Rullgard <mans@mansr.com>
In some places, dvbsubdec passes improper input buffer size to
bitstream reading functions, not accounting for reading pointer
updates.
Fixed by using buffer_end - buffer pointer instead of fixed buffer length.
Signed-off-by: Jindrich Makovicka <makovick@gmail.com>
Signed-off-by: Mans Rullgard <mans@mansr.com>
This validate the length of a mkv element directly after reading
it.
This has the advantage that it is easy to add new limits and makes
it less likely to forget to add checks and also avoids issues like
bits of the length value above the first 32 being ignored because
the parsing functions only takes an int.
Previously discussed in the "mkv 0-byte integer parsing" thread.
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
Change int64_t into a int, which caused this compiler warning:
libavformat/oggparseskeleton.c:64: warning: passing argument 2 of ‘av_reduce’ from incompatible pointer type
Use avio functions instead of bytestream ones (also drops dependency on
lavc and removes a bunch of warnings).
Drop custom version of avio_get_str16 and use that instead.
Tested on mewmew-ssa.avi sample.
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>