Commit Graph

7240 Commits

Author SHA1 Message Date
Baptiste Coudurier 304e983dc7 movenc: fix yuv range in avid atoms used by dnxhd.
yuv range: full 1 / normal 2

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2011-05-12 13:07:21 +02:00
Alex Converse 7fe3207e25 movenc: fix adpcm mono muxing.
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2011-05-12 13:05:30 +02:00
Baptiste Coudurier 6ae38aa3ce mpegts: do not output known sized packet if an unbounded packet is already queued.
Fix issue #2624.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2011-05-12 13:04:58 +02:00
Diego Biurrun 046f081b46 configure: Do not unconditionally add -D_POSIX_C_SOURCE to CPPFLAGS.
Adding _POSIX_C_SOURCE to CPPFLAGS globally produces all sorts of problems
since it causes certain system functions to be hidden on some (BSD) systems.
The solution is to only add the flag on systems that really require it, i.e.
glibc-based ones.

This change makes BSD systems compile out-of-the-box without the need for
adding specific flags manually.  It also allows dropping a number of flags
set manually on a file-per-file basis, but were only present to work around
breakage introduced by the presence of _POSIX_C_SOURCE.

Also add _XOPEN_SOURCE to CPPFLAGS for glibc systems.  We use XSI extensions
in several places already, so it is preferable to define it globally instead
of littering source files with individual #defines only needed for glibc.
2011-05-12 11:41:59 +02:00
Thierry Foucu 45faf7fcd3 nsv: Fix misdetection of MP3 files as NSV.
If an MP3 file contains the string NSVs, the NSV probe will confuse it for an
NSV file. Check for 0xBEEF after a Video/Audio chunk to achieve more accuracy.

Signed-off-by: Diego Biurrun <diego@biurrun.de>
2011-05-12 11:32:39 +02:00
Clément Bœsch b3bbc6fdc5 oggdec: use explicit AVInputFormat struct initializers
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2011-05-12 11:32:26 +02:00
Clément Bœsch f95257d27c oggdec: simplify ogg_probe
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2011-05-12 11:32:26 +02:00
Baptiste Coudurier 9aa91043f3 Port SMPTE S302M audio decoder from FFmbc 0.3. 2011-05-11 17:25:06 +02:00
Martin Storsjö 0b4949b518 rtsp: Only do keepalive using GET_PARAMETER if the server supports it
This is more like what VLC does. If the server doesn't mention
supporting GET_PARAMETER in response to an OPTIONS request,
VLC doesn't send any keepalive requests at all. After this patch,
libavformat will still send OPTIONS keepalives if GET_PARAMETER
isn't explicitly said to be supported.

Some RTSP cameras don't support GET_PARAMETER, and will
close the connection if this is sent as keepalive request
(but support OPTIONS just fine, but probably don't need any
keepalive at all). Some other cameras don't support using
OPTIONS as keepalive, but require GET_PARAMETER instead.

Signed-off-by: Martin Storsjö <martin@martin.st>
2011-05-11 10:42:34 +03:00
Anton Khirnov b66752790a AVOptions: make default_val a union, as proposed in AVOption2.
This breaks API and ABI.
2011-05-10 20:22:06 +02:00
Vitor Sessak ecc297308f lavf/utils: fix ff_interleave_compare_dts corner case.
This should fix behavior introduced by commit
96573c0d76. Av_rescale_rnd() is not
lossless so if two timestamps are equal after being rescaled they are
not always actually identical. This patch use av_compare_ts() to get
always a correct result.

Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2011-05-10 07:53:19 -04:00
Martin Storsjö ed87375dd5 mpegtsenc: Clear st->priv_data when freeing it
If not cleared, the caller might try to free it.

Signed-off-by: Martin Storsjö <martin@martin.st>
2011-05-09 19:14:40 +03:00
Martin Storsjö a7ea5e3d35 udp: Fix receiving RTP data over multicast
Earlier, AVIO_RDWR was handled as READ, and all the checks
for the AVIO_WRONLY flag explicitly meant the write-only case.
When changed from old AVIO/URL contants to AVIO_FLAG in
59d96941f0, these comparisons were updated incorrectly, by
mapping checks for AVIO_WRONLY to checks for AVIO_FLAG_WRITE.

When receiving RTP over UDP, the urlcontext is opened with
READ_WRITE flags.

This patch updates the flag comparisons to check for the same
conditions as the code did prior to 59d96941f0.

Signed-off-by: Martin Storsjö <martin@martin.st>
2011-05-09 19:14:38 +03:00
Martin Storsjö f9a6cfdd04 rtpproto: Remove an unused variable
Signed-off-by: Martin Storsjö <martin@martin.st>
2011-05-09 19:14:37 +03:00
Yusuke Nakamura 45a811b512 mov: fix composition timestamps on movie fragments.
This fixes, for instance, the case that there is a track that has some samples with composition time offset and has a track run without sample-composition-time-offsets-present.
2011-05-05 22:07:54 -07:00
Diego Biurrun 8799541a0a Fix standalone compilation of pipe protocol.
file_check() is not only used by the file protocol, adjust #ifdef accordingly.
2011-05-04 21:12:42 +02:00
Diego Biurrun 61165a1bba Fix standalone compilation of WTV demuxer. 2011-05-04 21:12:40 +02:00
Mans Rullgard eddd580b74 matroskaenc: fix memory leak
This fixes a memory leak occurring when no cue points are defined
since commit 91819763.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2011-05-04 18:06:45 +01:00
Alex Converse 1a5e4fd8c5 Replace strncpy() with av_strlcpy(). 2011-05-03 21:20:13 -07:00
Uoti Urpala 0bd433a916 asfdec: fix assert failure on invalid files
Add an extra size validity check in asf_read_frame_header(). Without
this asf->packet_size_left may become negative, which triggers an
assertion failure later.

Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2011-05-03 22:36:08 -04:00
Ronald S. Bultje 7643265505 nutenc: check malloc return values. 2011-05-03 22:29:19 -04:00
Ronald S. Bultje 25588d3b8a nutenc: don't av_malloc(0). 2011-05-03 22:29:08 -04:00
Ronald S. Bultje f8b1245922 asfdec: fix parsing of packets that overrun into padding.
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2011-05-03 22:14:04 -04:00
Luca Barbato e3b540b424 Make ffmpeg support generic data stream
The patch is the first step to support -dcodec copy
2011-05-03 11:51:55 +02:00
Stefano Sabatini 975a1447f7 Replace deprecated FF_*_TYPE symbols with AV_PICTURE_TYPE_*.
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2011-05-02 12:18:44 +02:00
Anssi Hannula 7c152a458d lavf: inspect more frames for fps when container time base is coarse
As per issue2629, most 23.976fps matroska H.264 files are incorrectly
detected as 24fps, as the matroska timestamps usually have only
millisecond precision.

Fix that by doubling the amount of timestamps inspected for frame rate
for streams that have coarse time base. This also fixes 29.970 detection
in matroska.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 78431098f9)

Tested with mplayer based on this report
http://thread.gmane.org/gmane.comp.video.mplayer.user/66043/focus=66063

Signed-off-by: Reinhard Tartler <siretart@tauware.de>
2011-04-29 22:46:13 +02:00
Diego Biurrun 2e15305b70 Remove some disabled printf debug cruft. 2011-04-29 20:00:53 +02:00
Diego Biurrun 045dd4b928 Replace some commented-out debug printf() / av_log() messages with av_dlog(). 2011-04-29 17:27:01 +02:00
Martin Storsjö 5b81e29593 avio: Fix the deprecated fallback URL-prefixed open flags
While deprecated, they're totally useless as long as their values
are different from the AVIO_FLAG values that are used internally.
Currently, this leads to old libav applications still compiling
correctly (since we haven't removed the fallback wrappers), but
failing since the functions internally compare to the new AVIO_FLAG
values.

These should be removed at some point, but they aren't removed yet.
The intent is to be able to recompile an old application against
the new ABI without modifying the code, and this doesn't work
currently.

Signed-off-by: Martin Storsjö <martin@martin.st>
2011-04-28 23:28:17 +03:00
Gil Pedersen f2c85458c4 network: Check POLLERR and POLLHUP in ff_network_wait_fd
Previously, the function would lead to an infinite wait (by
returning AVERROR(EAGAIN)) on sockets indicating an error
via either of these poll flags.

Signed-off-by: Martin Storsjö <martin@martin.st>
2011-04-28 10:28:51 +03:00
Anton Khirnov f8fec05052 mpegtsenc: make PMT PID really start on pmt_start_pid 2011-04-28 07:26:40 +02:00
Peter Ross f9fb574dee nut format: support PIX_FMT_BGR48LE and PIX_FMT_BGR48BE
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2011-04-28 07:25:28 +02:00
Diego Biurrun e6ff064845 Eliminate pointless '#if 1' statements without matching '#else'. 2011-04-26 20:18:27 +02:00
Kostya Shishkov 23f40a0788 read AVI palette from the end of extradata
Official AVI specification says that stream header in case of video contains
BITMAPINFO, which is equal to BITMAPINFOHEADER and optional palette. Currently
lavf AVI demuxer thinks otherwise which produces garbage on codecs that have
both palette and extradata (luckily, there are not so many such codecs).

An example of such file is:
http://samples.multimedia.cx/V-codecs/KMVC/baseball1.avi
(IIRC, MSS1 or MSS2 also had such situation but they are still not supported
by lavc).

As a side note, passing palette in extradata as it's been done previously is
not quite correct since proper _extra_ data is surplus bytes in
BITMAPINFOHEADER, not including palette.

Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2011-04-24 23:26:45 -07:00
Martin Storsjö 5f85d49b68 applehttp: Don't export variant_bitrate if it isn't known
If there are no variants, the total bitrate of the single
stream isn't known, and exporting variant_bitrate = 0 does
look weird, since there really aren't any variants.

Signed-off-by: Martin Storsjö <martin@martin.st>
2011-04-24 21:30:03 +03:00
Martin Storsjö ac9cf2e5c4 crypto: Use av_freep instead of av_free
Using av_freep is generally good practice.

Signed-off-by: Martin Storsjö <martin@martin.st>
2011-04-24 21:30:03 +03:00
Clément Bœsch dc713546d4 oggdec: reindent after 8f3eebd6
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2011-04-24 16:45:45 +02:00
Kirill Gavrilov b1ac139d89 Handle unicode file names on windows
All file names should be in UTF-8 within libavformat.

This is handled by mapping the open() function to an internal one
in os_support.h for windows.

fopen() could be overridden in the same way, but if that would be
used from ffmpeg.c, it would add a dependency on an ff prefixed
internal lavf function.

Signed-off-by: Martin Storsjö <martin@martin.st>
2011-04-24 00:05:38 +03:00
Martin Storsjö 9261e6cf3f rtp: Rename the open/close functions to alloc/free
This avoids clashes if we internally want to override the global
open function.

Signed-off-by: Martin Storsjö <martin@martin.st>
2011-04-24 00:05:37 +03:00
Alex Converse 3583d7cffe Fix mov debug (u)int64_t format strings. 2011-04-22 20:36:12 -07:00
Martin Storsjö 84465f2180 applehttp: Handle AES-128 encrypted streams
This should hopefully fix roundup issue 2586.

This commit only implements it in the demuxer, not in the
protocol handler. If desired, some of the code could be
refactored to be shared by both implementations.

Signed-off-by: Martin Storsjö <martin@martin.st>
2011-04-23 00:27:21 +03:00
Martin Storsjö 6e4f70a8de Add a protocol handler for AES CBC decryption with PKCS7 padding
This can later be extended to support other AES bit sizes,
encryption, other crypto algorithms, reading the key from a URL, etc.

In order to use it, the key and initialization vector has to be
passed via AVOptions. Since such options can't be passed to
protocols from the command line, the protocol is currently
only for libavformat internal use.

Signed-off-by: Martin Storsjö <martin@martin.st>
2011-04-23 00:27:10 +03:00
Diego Biurrun d9dee728b8 Use av_log_ask_for_sample() to request samples from users. 2011-04-22 20:12:39 +02:00
Martin Storsjö fe8e039460 applehttp: Expose the stream bitrate via metadata
This helps callers to intelligently switch between bitrate
variants.

Signed-off-by: Martin Storsjö <martin@martin.st>
2011-04-21 14:13:09 +03:00
Stefano Sabatini 79157f400b error: remove AVERROR_NUMEXPECTED
AVERROR_NUMEXPECTED is used only in the image muxer and demuxer, and
has a too much specific meaning, which is better explained through a
log message. Thus it can be replaced by AVERROR(EINVAL).

This breaks API.

Signed-off-by: Stefano Sabatini <stefano.sabatini-lala@poste.it>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2011-04-21 07:10:16 +02:00
Michael Niedermayer 52512d0a43 oggdec: use av_freep() instead of av_free()
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2011-04-20 17:37:16 +02:00
Martin Storsjö 26f6b8c571 avio: Fix sanity checks in ffurl_read*
This fixes e.g. reading data over HTTP, where the underlying
socket is set to read/write.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2011-04-20 17:00:11 +02:00
Martin Storsjö 7bbb67d580 libavformat: Free AVFormatContext->streams
After switching this from a statically allocated array to a
dynamically allocated one in the major bump, this needs explicit
freeing.

Signed-off-by: Martin Storsjö <martin@martin.st>
2011-04-20 15:42:55 +03:00
Martin Storsjö c60112f268 libavformat: Make protocols pass URLContext as log context where available
Since the libavformat major bump, URLContext contains an AVClass,
making it a usable log context.

Signed-off-by: Martin Storsjö <martin@martin.st>
2011-04-20 14:59:45 +03:00
Vladimir Pantelic 8408e1d7d6 asf: remove commented out code in asf_read_seek
Signed-off-by: Mans Rullgard <mans@mansr.com>
2011-04-20 12:47:13 +01:00