Diego Biurrun [Thu, 14 Aug 2014 12:40:19 +0000 (14:40 +0200)]
w32pthreads: Mark functions in compatibility wrapper as av_unused
This avoids annoying warnings about unused functions. The compatibility
wrapper is designed to provide a complete (stub) API, so some functions
being unused by some files is natural and no reason for a warning.
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>
* cigaes/master:
lavfi/avf_showspectrum: check RDFT context init.
lavfi/avf_showspectrum: add full frame sliding mode.
lavfi/avf_showspectrum: use automatic framing.
lavfi/avf_showspectrum: do not push the frame at EOF.
lavfi/avf_showspectrum: fix output pts computation.
lavfi/avf_showspectrum: set output frame rate.
The encoder produces files that are no longer compatible with previous
versions of the decoder, and may actually cause decoding issues for other
software, so indicate that change to allow decoder quirks.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Fixes out of array read Fixes: yuv111_no_compr_crash.avi Found-by: Piotr Bandurski <ami_stuff@o2.pl> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Nicolas George [Sun, 3 Aug 2014 14:40:54 +0000 (16:40 +0200)]
lavfi/avf_showspectrum: do not push the frame at EOF.
It is always identical to the last pushed frame.
The samples in the last incomplete window were ignored,
this is unchanged.
Possible enhancement: pad the last incomplete window with
silence.
Anton Khirnov [Mon, 28 Jul 2014 13:27:57 +0000 (13:27 +0000)]
lavf: eliminate ff_get_audio_frame_size()
It is basically a wrapper around av_get_audio_frame_duration(), with a
fallback to AVCodecContext.frame_size. However, that field is set only
when the stream codec context is actually used for encoding or decoding,
which is discouraged.
For muxing, it is generally the responsibility of the caller to set the
packet duration.
For demuxing, if the duration is not stored at the container level, it
should be set by the parser.
Anton Khirnov [Mon, 28 Jul 2014 13:27:57 +0000 (13:27 +0000)]
lavf: eliminate ff_get_audio_frame_size()
It is basically a wrapper around av_get_audio_frame_duration(), with a
fallback to AVCodecContext.frame_size. However, that field is set only
when the stream codec context is actually used for encoding or decoding,
which is discouraged.
For muxing, it is generally the responsibility of the caller to set the
packet duration.
For demuxing, if the duration is not stored at the container level, it
should be set by the parser.
Therefore, removing the frame_size fallback should not break any
important case.
The cur_*auth_type variables were set before the http_connect call
prior to 6a463e7fb - their sole purpose is to record the
authentication type used to do the latest request, since parsing
the http response sets the new type in the auth state.
CC: libav-stable@libav.org Signed-off-by: Martin Storsjö <martin@martin.st>
Andrew Stone [Tue, 12 Aug 2014 21:03:55 +0000 (17:03 -0400)]
ogg: update event_flags with STREAM_/METADATA_UPDATED whenever metadata changes.
Originally, AVFormatContext and a metadata dict were provided to ff_vorbis_comment(),
but this presented issues if an AVStream was being updated or the metadata on
AVFormatContext wasn't actually being updated. To remedy this, ff_vorbis_stream_comment()
explicitly updates a stream's metadata and sets any necessary flags.
ff_vorbis_comment() does not modify any flags, and any calls to it that update
AVFormatContext's metadata (just a single call) must also update
AVFormatContext.event_flags after detecting any metadata changes to the provided
dictionary, as signaled by a positive return value.
Andrew Stone [Mon, 11 Aug 2014 17:35:09 +0000 (13:35 -0400)]
Expose metadata found in onCuePoint events in .flv files.
Currently, only onMetaData is used, but some providers (wrongly)
put metadata into onCuePoint events, and it's still nice to be
able to use that data.
onCuePoint events also present metadata slightly differently than
onMetaData events: all metadata is found inside an object called
"parameters". In order to extract this metadata, it's easiest to
recurse through the object tree and pull out anything found in
child objects and put it in the top-level metadata.
Andrew Stone [Fri, 8 Aug 2014 17:09:23 +0000 (13:09 -0400)]
lavf: add AVFormatContext/AVStream fields for signaling to the user when events happen.
The only flags, for now, indicate if metadata was updated and are set after each call to
av_read_frame(). This comes with the caveat that, on stream start, it might not be set properly
as packets might be buffered in AVFormatContext.packet_buffer before being given to the user
in av_read_frame().
Martin Storsjö [Mon, 11 Aug 2014 12:02:28 +0000 (15:02 +0300)]
configure: Check for nanosleep in headers as well, not only in libs
On mingw64 with c++11 support, the link libraries do contain a
nanosleep function, while it isn't exposed via the headers. Using
check_func_headers instead of a plain check_func fixes this
misdetection.
Martin Storsjö [Wed, 6 Aug 2014 06:52:38 +0000 (09:52 +0300)]
w32threads: Use newer thread synchronization functions when targeting Vista
When explicitly targeting Vista or newer (which only happens if the
caller explicitly sets _WIN32_WINNT to a high enough value via the
extra cflags option - otherwise configure script sets
-D_WIN32_WINNT=0x0502), we already unconditionally link to the
ConditionVariable functions, since 4622f11f9.
Similarly use the newer -Ex versions of CreateEvent, CreateSemaphore,
InitializeCriticalSection and WaitForSingleObject, that all appeared
in Vista. When building Windows Store applications, the older versions
of these functions aren't available, only the -Ex functions. When
doing such a build, the user can set -D_WIN32_WINNT=0x0600 to
forcibly use the newer functions instead.
Martin Storsjö [Mon, 11 Aug 2014 07:18:28 +0000 (10:18 +0300)]
http: Stop reading after receiving the whole file for non-chunked transfers
Previously this logic was only used if the server didn't
respond with Connection: close, but use it even for that case,
if the server response is non-chunked.
Originally the http code has relied on Connection: close to close
the socket when the file/stream is received - the http protocol
code just kept reading from the socket until the socket was closed.
In f240ed18 we added a check for the file size, because some
http servers didn't respond with Connection: close (and wouldn't
close the socket) even though we requested it, which meant that the
http protocol blocked for a long time at the end of files, waiting
for a socket level timeout.
When reading over tls, trying to read at the end of the connection,
when the peer has closed the connection, can produce spurious (but
harmless) warnings. Therefore always voluntarily stop reading when
the specified file size has been received, if not using a chunked
transfer encoding. (For chunked transfers, we already return 0
as soon as we get the chunk header indicating end of stream.)