Age | Commit message (Collapse) | Author |
|
|
|
|
|
It has been unused since 37045e422903695e610cca6ecb753df643ab9380.
|
|
pthread_wait_cond can wake up unexpectedly (Wikipedia: Spurious_wakeup).
The FF_THREAD_SLICE thread mechanism could spontaneously execute
jobs or allow the caller of avctx->execute to return before all
jobs were complete.
Test both cases to ensure the wakeup is real.
Signed-off-by: Ben Jackson <ben@ben.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
|
|
Sometimes, if pthread_create() failed, then pthread_cond_wait() could
accidentally be called in the worker threads after the uninit function
had already called pthread_cond_broadcast(), leading to a deadlock.
Don't call pthread_cond_wait() if c->done is set.
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
|
|
|
|
The AIX threads library exposes a function with the same name.
Signed-off-by: Martin Storsjö <martin@martin.st>
|
|
It will be useful in lavfi, and could conceivably be useful to the user
applications as well.
|
|
It will be used in other places than lavc.
|
|
|
|
Those were useful when avcodec_thread_init() was a public functions. It
was deprecated and removed some time ago, so those checks are not needed
anymore.
|
|
Intra codecs do not need an update_thread_context() function and never
call ff_thread_finish_setup(). They rely on ff_thread_get_buffer()
calling it. So call it even if the get_buffer2 function pointer is
avcodec_default_get_buffer2 and it has not been called before.
|
|
Allows use of AVHWAccel based decoders with frame based multithreading.
The decoders will be forced into an non-concurrent mode by delaying
ff_thread_finish_setup() calls after decoding of the current frame
is finished.
This wastes memory by unnecessarily using multiple threads and thus
copies of the decoder context but allows seamless switching between
hardware accelerated and frame threaded software decoding when the
hardware decoder does not support the stream.
|
|
Signed-off-by: Anton Khirnov <anton@khirnov.net>
|
|
Fixes memleaks when frame mt is used and the decoder is not flushed at
the end.
|
|
|
|
|
|
I.e. don't do anything on already released frames.
|
|
It will be useful in the upcoming transition to refcounted AVFrames.
|
|
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
|
|
Signed-off-by: Mans Rullgard <mans@mansr.com>
|
|
Signed-off-by: Martin Storsjö <martin@martin.st>
|
|
We generally do not declare variables within for statements and
there are compilers that choke on such constructs.
|
|
Signed-off-by: Diego Biurrun <diego@biurrun.de>
|
|
This removes all references to AVCodecContext.dsp_mask and marks
it for eviction at the next version bump. It has been superseded
by av_set_cpu_flag_mask() which, unlike this field, works everywhere.
Signed-off-by: Mans Rullgard <mans@mansr.com>
|
|
Reproducible with test case and ffplay -threads 2. Stack trace:
http://pastebin.com/PexZ4Uc0
Test case:
http://commondatastorage.googleapis.com/dalecurtis-shared/crash.ogm
Signed-off-by: Dale Curtis <dalecurtis@chromium.org>
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
|
|
Before this, they were only added to the delayed release queue and not
freed until later. This could lead to unnecessary memory use or buffer
exhaustion.
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
|
|
Else we run out of progress variables after a few failed buffer
allocations.
Signed-off-by: Anton Khirnov <anton@khirnov.net>
|
|
Signed-off-by: Anton Khirnov <anton@khirnov.net>
|
|
Calling avcodec_flush_buffers() and then avcodec_decode_video2() with
a 0-sized packet (to get remaining buffered frames) could incorrectly
return an old frame from before the avcodec_flush_buffers() call. Add
a loop in ff_thread_flush() to zero the got_frame field of each thread
to ensure the old frames will not be returned.
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
|
|
In most places where it's used, it's as a pointless write-only field.
Only rv10 decoder actually reads from it, but it stores some internal
version info in it. There is no reason for it to be in a public field.
|
|
Put related fields together, move the important ones closer to the
beginning, try to eliminate holes.
|
|
They are used to signal the number of slices and offsets of each slice
out of band to the decoder.
|
|
|
|
Signed-off-by: Janne Grunau <janne-libav@jannau.net>
|
|
The extra thread added in {frame_}*thread_init was not taken into
account. Explicitly sets thread_count to 1 if only one CPU core was
detected. Also fixes two typos in comments.
|
|
Some external codecs have their own code to determine the best number
of threads. This number is not necessary the number of cpu cores.
Thread_count will be only 0 if the codec has CODEC_CAP_AUTO_THREADS.
|
|
Can act as fallback and should work on a couple of Unix systems.
|
|
Since the conditions for the actual usage are more specific a less
preferred method can be used. This would cause compilation errors
because necessary headers are not included.
|
|
|
|
The format is a per-frame property, having it in AVFrame simplify the
operation of extraction of that information, since avoids the need to
access the codec/stream context.
|
|
width and height are per-frame properties, setting these values in
AVFrame simplify the operation of extraction of that information,
since avoids the need to check the codec/stream context.
|
|
The sample aspect ratio is a per-frame property, so it makes sense to
define it in AVFrame rather than in the codec/stream context.
Simplify application-level sample aspect ratio information extraction,
and allow further simplifications.
|
|
|
|
Fixes compilation on FreeBSD with clang 3.
|
|
|
|
|
|
Use sched_getaffinity to determine the number of logical CPUs.
Limits the number of threads to 16 since slice threading of H.264
seems to be buggy with more than 16 threads.
|
|
|
|
This was intended as an optimisation for skipped blocks in MPEG2
P-frames and never used elsewhere. Removing this "optimisation"
speeds up MPEG2 decoding by 1-2% (ARM Cortex-A9).
Signed-off-by: Mans Rullgard <mans@mansr.com>
|