The issue is that, when the main packet data buffer is changed, streamcopy
uses a temporary new packet to store that buffer, frees the old packet, and
replace it with the new packet.
However, in doing so, it forgets about the side data, which gets freed, but
is still needed and referenced. Then, when the packet gets freed again in
the normal code path, it attempts to free its side data which has already
been freed.
Therefore, simply avoid the first free on side data by removing that side
data from the packet.
Fixes ticket #3773.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Commit fc9c857c introduced deadlock regression when processing too many inputs:
ffmpeg $(seq -f " -f lavfi -i aevalsrc=0:d=%.0f" 70) -vf concat=n=70:v=0:a=1 -f null -
Happens for different number of inputs, depending on available memory size,
overcommit settings, ulimits, etc. Easily noticeable for 32-bit builds,
that exhaust address space allocating 8-10 MB stack for each thread.
Earlier ffmpeg versions exited with unhelpful "Conversion failed!" message.
This patch fixes both problems: it frees the queue to prevent deadlock
and adds a meaningful error message if pthread_create() fails.
Reviewed-by: Nicolas George <george@nsup.org>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
With threads the decoder has a delay and will thus have multiple
frames at EOF left in its buffers which will be returned when flushing
the decoder. The code that extracts such frames from the decoder at the
end does not pull frames from the filtergraph, thus when one of these
frames causes the filtergraph to be reinited, the frames still inside
the graph at that point re lost
This commit changes the flushing to be more similar to normal decoding
and 1 frame at a time
Fixes hqx fate with threads
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
We cannot use avpriv_request_sample() as this is private to the libs
or rather it would be a bad usage example
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
It seems working without this now for the files i tested it with, if this causes
a regression, dont hesitate to put the line back or open a ticket or fix (if possible)
the parser
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
The demuxer needs this value to generate correct timestamps in some corner cases
Ideally the parser would always set this correctly, but some parsers lac support
for extracting this value, also its not trivial.
This fixes a regression
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Fixes 1 frame error in the duration and derived values,
introduced by not using AVStream.pts in the previous commit
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
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>