Commit Graph

10526 Commits

Author SHA1 Message Date
Vittorio Giovara a1e2caa93e mov: Log format rather than fourcc in stsd in trace mode
This will fix remaining format warnings.
2015-07-01 00:13:58 +01:00
Vittorio Giovara 2eef75fd7e mov: Adjust variable types to fix format warnings 2015-07-01 00:13:58 +01:00
Vittorio Giovara df22e30172 dump: Use the correct abs() version
Fix warning from clang "absolute value function 'abs' given an argument
of type 'long long' but has parameter of type 'int' which may cause
truncation of value [-Wabsolute-value]".
2015-07-01 00:13:58 +01:00
Luca Barbato e95c7a6185 mov: Preserve the metadata even when bit-exactness is requested
Make sure to not write the custom `encoder` string in that case.

Bug-Id: 845
CC: libav-stable@libav.org
2015-06-30 15:34:38 +02:00
John Högberg 42bc768e52 mpegts: Add jpeg2000 stream type
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2015-06-30 10:08:16 +02:00
Luca Barbato 1b4c468477 riff: Validate the wav header size before trying to parse it 2015-06-28 17:32:40 +02:00
Luca Barbato 5bdfc17189 asf: Do not skip data streams 2015-06-28 17:10:54 +02:00
Luca Barbato 8a26ae5f94 mpjpeg: Check stream allocation
Bug-Id: CID 1308152
2015-06-28 10:27:19 +02:00
Alexandra Hájková b08569a239 lavf: Replace the ASF demuxer
The old one is the result of the reverse engineering and guesswork.
The new one has been written following the now-available specification.

This work is part of Outreach Program for Women Summer 2014 activities
for the Libav project.

The fate references had to be changed because the old demuxer truncates
the last frame in some cases, the new one handles it properly.
The seek-test reference is changed because seeking works differently
in the new demuxer. When seeking, the packet is not read from the stream
directly, but it is rather constructed by the demuxer. That is why
position is -1 now in the reference.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2015-06-28 10:16:40 +02:00
Paul B Mahol ded5957d75 segafilm: Remove deplanarization hack
Signed-off-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2015-06-24 14:45:09 +01:00
Paul B Mahol 5a79bf0284 PCM signed 16-bit big-endian planar decoder
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2015-06-24 14:45:00 +01:00
Vittorio Giovara 5c018ee188 DirectDraw Surface image decoder
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2015-06-22 15:23:08 +01:00
Vittorio Giovara 7ca3e5203f Hap decoder and encoder
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2015-06-22 15:23:08 +01:00
Luca Barbato 61dc9d647c udp: Fix local_port management
The default value for unset is -1, not 0.

Problem introduced in 66028b7ba6
2015-06-22 10:47:29 +03:00
nu774 6ec688e1bc mp3: enable packed main_data decoding in MP4
14496-3 suggests packing main_data of MP3 that is usually scattered
into multiple frames due to bit reservoir.

However, after packing main_data into a access unit, bitrate index
in the MPEG audio frame header doesn't match with actual frame size.

In order to accept this, this patch removes unnecessary frame size
checking on mp3 decoder.

Also, mov demuxer was changed to use MP3 parser only on special cases
(QT MOV with specific sample description) to avoid re-packetizing.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2015-06-20 12:18:01 +03:00
Luca Barbato 24ad3ac6a3 nut: Drop doxygen markers 2015-06-15 13:39:07 +02:00
Vittorio Giovara 07b2db81d0 riff: Add MNM4 FourCC as mpeg4 2015-06-15 12:29:25 +01:00
wm4 74ea1167d9 tls_gnutls: fix hang on disconnection
GNUTLS_SHUT_RDWR means GnuTLS will keep waiting for the server's
termination reply. But since we don't shutdown the TCP connection at
this point yet, GnuTLS will just keep skipping actual data from the
server, which basically is perceived as hang.

Use GNUTLS_SHUT_WR instead, which doesn't have this problem.

Signed-off-by: Martin Storsjö <martin@martin.st>
2015-06-14 19:50:03 +03:00
Vittorio Giovara a7ac1a7b94 flv: Name an enum and use its type 2015-06-12 17:02:49 +01:00
Vittorio Giovara 8a78ae2d21 segment: Check open_null_ctx() return value
Reported-By: infer
2015-06-12 17:02:48 +01:00
Janne Grunau 529c05698e movenc: fixes a questionable valgrind uninitialized value warning
display_matrix_size is only initialized when av_stream_get_side_data()
returns a side data pointer. The code is safe since the only effect this
has is setting the display_matrix pointer to NULL which it was already
anyway.
2015-06-10 14:32:11 +02:00
Luca Barbato b14086ca38 mkv: Correctly report the latest packet had been flushed
Bug-Id: 865
CC: libav-stable@libav.org
2015-06-09 14:27:54 +02:00
James Almer b380337020 mpjpegdec: don't try to alloc an AVIOContext when probe is guaranteed to fail
The first check is done without the AVIOContext, so alloc it only if said check succeeds

Signed-off-by: James Almer <jamrial@gmail.com>
Signed-off-by: Janne Grunau <janne-libav@jannau.net>
2015-06-09 10:07:11 +02:00
Vittorio Giovara 4733a12dd1 rtpdec_asf: Check memory allocation and free memory on error
CC: libav-stable@libav.org
Bug-Id: CID 1257774
2015-06-08 13:04:29 +01:00
Vittorio Giovara 6308cd4868 mov: Check memory allocation
CC: libav-stable@libav.org
Bug-Id: CID 1292518
2015-06-08 13:03:39 +01:00
Vittorio Giovara f7e9324733 audiointerleave: Always initialize new_pkt
CC: libav-stable@libav.org
Bug-Id: CID 609333
2015-06-08 13:03:10 +01:00
Vittorio Giovara 8ef98855d2 sctp: Always initialize outmsg struct
CC: libav-stable@libav.org
Bug-Id: CID 1302711
2015-06-08 13:01:33 +01:00
Janne Grunau caf7be30b1 mpjpgdec: free AVIOContext leak on early probe fail 2015-06-08 13:55:26 +02:00
Luca Barbato 252d6200c3 avio: Add avio_put_str16be 2015-06-07 10:14:45 +02:00
Luca Barbato 9b56ac74b1 mpjpeg: Initial implementation
Support only streams with Content-Length.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2015-06-07 10:14:45 +02:00
Martin Storsjö 63ce9fd23c rtmpdh: Use GMP functions directly, instead of nettle wrappers
mpz_import and mpz_export were added in GMP 4.1, in 2002.

This simplifies the DH code by clarifying that it only uses pure
bignum functions, no other parts of nettle/hogweed.

Signed-off-by: Martin Storsjö <martin@martin.st>
2015-06-01 10:38:54 +03:00
Martin Storsjö 84c5ff911f rtmpdh: Fix the indentation in a struct
Signed-off-by: Martin Storsjö <martin@martin.st>
2015-06-01 10:38:54 +03:00
Andreas Cadhalpun 5c720657c2 mov: always check avio_read return value
If avio_read fails, the buffer can contain uninitialized data.

This fixes 'Conditional jump or move depends on uninitialised value(s)'
valgrind warnings, and addresses a few memleaks.

Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2015-05-31 13:05:13 +02:00
Vittorio Giovara bff0349d9d avio: Add avio_read wrapper to simplify error checking
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2015-05-31 13:05:13 +02:00
Andreas Cadhalpun cffb9ea81b mov: reject zero bytes_per_frame with non-zero samples_per_frame
In this case the mov demuxer can return a large number of empty packets.

Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2015-05-31 13:05:12 +02:00
Andreas Cadhalpun 8e9c39e81f mov: abort on EOF in ff_mov_read_chan
Otherwise the loop can take a lot of time if num_descr is very large.

Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2015-05-31 13:05:12 +02:00
Luca Barbato a8a90906fb mov: Correctly allocate ctts_data
It can be reallocated.

CC: libav-stable@libav.org
2015-05-31 13:05:12 +02:00
Andreas Cadhalpun f261a55d72 mov: Fix two memleaks
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>

CC: libav-stable@libav.org
2015-05-31 13:05:12 +02:00
wm4 881b80b329 network: prevent SIGPIPE on OSX
OSX does not know MSG_NOSIGNAL. BSD (which OSX is based on) has got
the socket option SO_NOSIGPIPE (even if modern BSDs also support
MSG_NOSIGNAL).

Signed-off-by: Martin Storsjö <martin@martin.st>
2015-05-31 10:10:16 +03:00
Martin Storsjö b2f0f37d24 rtmpdh: Generate the whole private exponent using av_get_random_seed() with nettle/gmp
Don't use a PRNG for generating it; that defies the intended use
within the cryptograhic handshake.

Signed-off-by: Martin Storsjö <martin@martin.st>
2015-05-29 23:33:03 +03:00
Martin Storsjö e9e86d9ef6 rtmpdh: Create sufficiently long private keys for gcrypt/nettle
There was a misunderstanding betewen bits and bytes for the parameter
value for generating random big numbers.

Signed-off-by: Martin Storsjö <martin@martin.st>
2015-05-29 09:42:41 +03:00
Martin Storsjö 8016a1bd3b rtmpdh: Remove an unnecessary check in the gcrypt/nettle dh_compute_key
Signed-off-by: Martin Storsjö <martin@martin.st>
2015-05-29 09:42:38 +03:00
Martin Storsjö 063f7467e4 rtmpdh: Add fate test for the DH handshake routine
This helps if these functions need to be implemented using another
crypto API.

Signed-off-by: Martin Storsjö <martin@martin.st>
2015-05-29 09:42:35 +03:00
Martin Storsjö 0508faaa11 rtmpdh: Pass the actual buffer size of the output secret key
Signed-off-by: Martin Storsjö <martin@martin.st>
2015-05-29 09:42:32 +03:00
Martin Storsjö 9f1b3050d9 rtmpdh: Check the output buffer size in the openssl version of dh_compute_key
Signed-off-by: Martin Storsjö <martin@martin.st>
2015-05-29 09:42:30 +03:00
Martin Storsjö 127d813bcb rtmpdh: Fix a local variable name in the nettle/gcrypt codepath
Signed-off-by: Martin Storsjö <martin@martin.st>
2015-05-29 09:42:28 +03:00
Martin Storsjö 78efc69e7c rtmpdh: Make sure ret is initialized in the nettle version of bn_hex2bn
Signed-off-by: Martin Storsjö <martin@martin.st>
2015-05-29 09:42:24 +03:00
Martin Storsjö d4d90504a6 tls_gnutls: Add missing includes for the gcrypt thread safety callbacks
This fixes building with gcrypt-backed gnutls versions, broken
in 57cde2b180.

Signed-off-by: Martin Storsjö <martin@martin.st>
2015-05-28 15:05:52 +03:00
wm4 57cde2b180 lavf: move TLS-related ifdeffery to library specific files
There is no need to have this mess in network.c.

Signed-off-by: Martin Storsjö <martin@martin.st>
2015-05-26 21:48:51 +03:00
wm4 d8ffb2055f lavf: split tls.c
Move the OpenSSL and GnuTLS implementations to their own files. Other
than the connection code (including options) and some boilerplate, no
code is actually shared.

Signed-off-by: Martin Storsjö <martin@martin.st>
2015-05-26 21:48:32 +03:00