Commit Graph

11012 Commits

Author SHA1 Message Date
Jacek Jendrzej
9b1c091114 http: Reset compressed header flag when starting to read a request
This fixes redirects, where the original redirect response indicated
support for compression, while the actual redirected content didn't.

Signed-off-by: Martin Storsjö <martin@martin.st>
2017-09-26 13:36:21 +03:00
Michael Niedermayer
ec683ed527 smacker: fix integer overflow with pts_inc
Bug-Id: 1073

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Sean McGovern <gseanmcg@gmail.com>
2017-09-24 12:58:42 +02:00
Sean McGovern
9e36102278 smacker: return meaningful error codes on failure 2017-09-24 12:57:54 +02:00
James Almer
ac6691ab99 avio: update avio_alloc_context() doxy
It must be freed using avio_context_free() starting with commit
99684f3ae7.

Signed-off-by: James Almer <jamrial@gmail.com>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2017-09-14 09:53:31 +02:00
Martin Storsjö
585dc1aece flvdec: Check the avio_seek return value after reading a metadata packet
If the metadata packet is corrupted, flv_read_metabody can accidentally
read past the start of the next packet. If the start of the next packet
had been flushed out of the IO buffer, we would be unable to seek to
the right position (on a nonseekable stream).

Prefer to clearly error out instead of silently trying to read from a
desynced stream which will only be interpreted as garbage.

Signed-off-by: Martin Storsjö <martin@martin.st>
2017-09-04 09:42:51 +03:00
Martin Storsjö
e41daa6246 Remove support for building for mingw32ce (Windows CE)
The toolchain for this target is unmaintained since many years.

While it has been continuously build tested on fate, it hasn't
actually been tested at runtime since many, many years (and back
then, only a few codecs in libavcodec were tested).

So far, keeping support for it has been mostly effortless, but
the compiler does seem to have issues with dllimported data symbols,
ending up as internal compiler errors in some cases. Instead of
jumping through further hoops to work around that, just remove the
target.

Signed-off-by: Martin Storsjö <martin@martin.st>
2017-08-31 14:21:08 +03:00
wm4
173b56218f lavf: make avio_read_partial() public
Main use-case is proxying avio through a foreign I/O layer and a custom
AVIO context, without losing latency and performance characteristics.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2017-08-30 14:29:14 +02:00
Mark Thompson
b88da98b34 hevc: Improve stream constraint values in common header
Add comments to describe the sources of the constraint values expressed here,
and add some more related values which will be used in following patches.

Fix the incorrect values for SPS and PPS count (they are not the same as those
used for H.264), and remove HEVC_MAX_CU_SIZE because it is not used anywhere.
2017-08-05 23:54:35 +01:00
Sean McGovern
defe307fb2 mov: move stsd finalization to an appropriate place
mov_finalize_stsd_codec() parses stream information from the ALAC extradata,
so run it after the extradata processing is completed in mov_read_stsd().

Fixes playback of 96kHz ALAC streams muxed by qaac or the reference alac encoder.

Adapted from an FFmpeg patch by Hendrik Leppkes <h.leppkes@gmail.com>

Bug-Id: 1072
2017-07-31 17:41:01 -04:00
Sean McGovern
3050dabaa9 mov: Do not set stsd_count if mov_read_stsd() fails
Based on an FFmpeg patch by Michael Niedermayer <michael@niedermayer.cc>
2017-07-31 17:41:01 -04:00
Sean McGovern
d7bdab1ad7 mov: log and return early on non-positive stsd entry counts
Based on an FFmpeg patch by Michael Niedermayer <michael@niedermayer.cc>
2017-07-30 10:51:12 -04:00
Sean McGovern
80e919b174 rmdec: add missing brackets to compound statement
Accidentally left out of 95ce02b35d.
2017-07-25 19:19:20 -04:00
wm4
2b1324bd16 lavf: allow avformat_close_input() with NULL
This is consistent with how other destructors behave.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2017-07-22 09:30:56 +02:00
Anton Khirnov
48a5c35346 caf: add an Opus tag
CC: libav-stable@libav.org
2017-07-22 09:30:56 +02:00
Sean McGovern
95ce02b35d rmdec: don't ignore the return value of av_get_packet() 2017-07-17 07:08:13 -04:00
Diego Biurrun
825e463a17 build: Add feature test macros for glibc 2.19+
glibc introduced _DEFAULT_SOURCE in version 2.19 to replace _BSD_SOURCE and
_SVID_SOURCE, which were deprecated in version 2.20. Add _DEFAULT_SOURCE
where the latter two are used to be forwards-compatible and avoid warnings
about the use of deprecated definitions.
2017-07-10 10:22:56 +02:00
Martin Storsjö
4d330da006 os_support: Use HAVE_UWP instead of manually checking WINAPI_FAMILY
Signed-off-by: Martin Storsjö <martin@martin.st>
2017-07-05 13:55:12 +03:00
Martin Storsjö
61f589e31e lavf: Remove codec_tag from dashenc and smoothstreamingenc
Currently, the tags enforced and set on the segmenter muxer level
mismatch what the mp4/ismv muxer uses (since 713efb2c0d).

Skip the codec_tag altogether here, to let the user (try to) set
whichever codec/tag is preferred; the individual chained muxer will
reject invalid codecs anyway.

Signed-off-by: Martin Storsjö <martin@martin.st>
2017-07-02 22:42:26 +03:00
Martin Storsjö
eb061ad6fd tls_gnutls: Readd support for nonblocking operation
The rtmp protocol uses nonblocking reads, to poll for incoming
messages from the server while publishing a stream.

Prior to 94599a6de3 and
d13b124eaf, the tls protocol
handled the nonblocking flag, mostly as a side effect from not
using custom IO callbacks for reading from the socket. When custom
IO callbacks were taken into use in
d15eec4d6b, the handling of a nonblocking
socket wasn't necessary for the default blocking mode any longer.

The code was simplified, since it was overlooked that other code
within libavformat actually used the tls protocol in nonblocking mode.

This fixes publishing over rtmps, with the gnutls backend.

Signed-off-by: Martin Storsjö <martin@martin.st>
2017-06-20 23:55:52 +03:00
Martin Storsjö
0671eb2346 tls_openssl: Readd support for nonblocking operation
The rtmp protocol uses nonblocking reads, to poll for incoming
messages from the server while publishing a stream.

Prior to 94599a6de3 and
d13b124eaf, the tls protocol
handled the nonblocking flag, mostly as a side effect from not
using custom IO callbacks for reading from the socket. When custom
IO callbacks were taken into use in
d15eec4d6b, the handling of a nonblocking
socket wasn't necessary for the default blocking mode any longer.

The code was simplified, since it was overlooked that other code
within libavformat actually used the tls protocol in nonblocking mode.

This fixes publishing over rtmps, with the openssl backend.

Signed-off-by: Martin Storsjö <martin@martin.st>
2017-06-20 23:55:52 +03:00
John Stebbins
84ab1cc437 movenc: allow alternative hvc1 h.265 codec tag
If AVCodecParameters.codec_tag is 'hvc1' use it instead of 'hev1' for
h.265 streams. QuickTime (and other Apple software) requires 'hvc1'.
2017-06-20 08:08:38 -07:00
John Stebbins
1ea9b7fdf9 movenc: write correct format hvcc when tag is hvc1 2017-06-20 08:08:38 -07:00
John Stebbins
1c64bae648 movenc: move tags definitions to where they are used 2017-06-20 08:08:38 -07:00
John Stebbins
f6f86f432f movenc: simplify codec_tag lookup
mux.c init_muxer() already sets codec_tag correctly in the cases
simplified here.

This also adds the capability to support alternative tags for the
same codec_id.
2017-06-20 08:08:38 -07:00
John Stebbins
713efb2c0d movenc: use correct tag list for AVOutputFormat.codec_tag
ff_mp4_obj_type contains the wrong type of tags for
AVOutputFormat.codec_tag. AVOutputFormat.codec_tag is used to
validate AVCodecParameters.codec_tag so needs to be the same
type of tag.

Creates new tag lists for mp4 and ismv.  New tag lists support
same list of codecs found in ff_mp4_obj_type. psp uses the same
tag list as mp4 since these both use mp4_get_codec_tag to look up tags.
2017-06-20 08:08:38 -07:00
Diego Biurrun
61cec5adaa tls: Hide backend implementation details from users
TLS is currently implemented over either OpenSSL or GnuTLS, with more
backends likely to appear in the future. Currently, those backend libraries
are part of the protocol names used during e.g. the configure stage of a
build. Hide those details behind a generically-named declaration for the
TLS protocol to avoid leaking those details into the configuration stage.
2017-06-02 10:41:52 +02:00
Martin Storsjö
2ca759657b os_support: Remove the dynamic loading of getaddrinfo from the fallback getaddrinfo
If we for some unexplicable reason didn't pick up getaddrinfo
at configure, the default, IPv4-only, fallback should be good enough.

This effectively reverts 6023d84a2b.

Signed-off-by: Martin Storsjö <martin@martin.st>
2017-06-01 13:29:55 +03:00
Luca Barbato
16cb06bb30 hlsenc: Support recovery from an already present playlist
Parse the playlist to recover the start sequence and previously
generated segments and continue muxing from there.

Mainly useful for near-seamless recovery in live scenarios.
2017-05-31 14:22:52 +02:00
Martin Storsjö
7c35bee025 movenc-test: Add tests for negative cts offsets
Signed-off-by: Martin Storsjö <martin@martin.st>
2017-05-15 14:08:53 +03:00
Martin Storsjö
c415c8104c movenc: Don't write any edit list if the start offset is zero
In these cases, the CTTS flag is set, but no edit list is necessary.

Signed-off-by: Martin Storsjö <martin@martin.st>
2017-05-15 14:08:48 +03:00
Martin Storsjö
c380a0d7f7 movenc: Add an option for enabling negative CTS offsets
This reduces the need for an edit list; streams that start with
e.g. dts=-1, pts=0 can be encoded as dts=0, pts=0 (which is valid
in mov/mp4) by shifting the dts values of all packets forward.
This avoids the need for edit lists for such streams (while they
still are needed for audio streams with encoder delay).

This eases conformance with the DASH-IF interoperability guidelines.

Signed-off-by: Martin Storsjö <martin@martin.st>
2017-05-15 14:08:36 +03:00
Martin Storsjö
6ccf76aec7 mpjpeg: Use proper CR/LF in multipart headers
This is more correct.

Signed-off-by: Martin Storsjö <martin@martin.st>
2017-05-11 11:05:42 +03:00
Diego Biurrun
b5f19f7478 aac: Split function to parse ADTS header data into public and private part
This makes the currently semi-public avpriv_aac_parse_header() function
private to libavcodec and adds a proper public API function to return
the parts of the ADTS header required in libavformat.
2017-05-02 18:50:34 +02:00
Anton Khirnov
831018b0bb mpeg4audio: Make avpriv_copy_pce_data() inline
The function currently accepts a PutBitContext and a GetBitContext,
which hardcodes their sizes into the lavc ABI. Since the function is
quite small and only called in a few places, the simplest solution is
making it inline, thus avoiding a runtime dependency completely.

Signed-off-by: Diego Biurrun <diego@biurrun.de>
2017-04-28 13:47:20 +02:00
James Almer
498864fe80 dump: use av_spherical_projection_name() to print spherical projection names
Signed-off-by: James Almer <jamrial@gmail.com>
2017-04-27 09:59:54 -04:00
James Almer
bee89ed3ec matroskaenc: don't warn about unknown spherical metadata when there isn't any
The same warning is issued when actual unknown spherical metadata is
found further down in the function.

Signed-off-by: James Almer <jamrial@gmail.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2017-04-26 09:12:47 +02:00
Kostya Shishkov
189157c3fc Add ClearVideo decoder
Only I-frames are decoded for now.

Signed-off-by: Diego Biurrun <diego@biurrun.de>
2017-04-25 15:39:10 +02:00
Luca Barbato
1731c3530b mm: Skip unexpected audio packets
Bug-Id: 1046
CC: libav-stable@libav.org
2017-04-20 15:39:18 +00:00
Luca Barbato
279e3aaa14 flv: Validate the packet size
Size can be negative at that point.

Bug-Id: 1041
CC: libav-stable@libav.org
2017-04-20 15:39:18 +00:00
Paul B Mahol
4f33d9d41a utvideodec: Support ULY4 and ULH4
Signed-off-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2017-04-15 15:37:18 +02:00
Paul B Mahol
a93faf30d6 utvideodec: Support UQRA and UQRG 2017-04-15 15:37:18 +02:00
Paul B Mahol
c523095564 utvideodec: Support UQY2
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2017-04-13 14:09:07 +02:00
Luca Barbato
9e4a5eb51b avformat: Free the internal codec context at the end
Avoid a use after free in avformat_find_stream_info.

CC: libav-stable@libav.org
2017-04-13 13:37:10 +02:00
Paul B Mahol
95a8a03a19 Add FM Screen Capture Codec decoder
Signed-off-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2017-04-13 12:35:35 +02:00
Anton Khirnov
50a1c66cf6 ac3_parser: add a public function for parsing the data required by the demuxer
Make the current semi-public avpriv_ac3_parse_header() private to lavc.

Signed-off-by: Diego Biurrun <diego@biurrun.de>
2017-04-12 15:39:00 +02:00
Luca Barbato
d32d59bc97 matroska: Read only the data written in the scratch buffer
The private buffer is 20bytes but depending on the type only 12 bytes
are actually filled.
2017-04-10 10:16:40 +02:00
Diego Biurrun
604fbb3132 mov: Move code shared with CAF to a separate file 2017-04-03 13:50:00 +02:00
Diego Biurrun
163cc67beb takdec: Use ISO C printf conversion specifiers where appropriate
libavformat/takdec.c:144:20: warning: format '%X' expects argument of type 'unsigned int', but argument 4 has type 'uint32_t'
2017-03-31 18:41:58 +02:00
Sean McGovern
fe6eea99ef nsvdec: don't ignore the return value of av_get_packet()
Fixes invalid reads with corrupted files.

CC: libav-stable@libav.org
Bug-Id: 1039
2017-03-26 12:43:57 -04:00
Ricardo Constantino
d4f3c26b70 rtmpproto: send swfverify value as swfurl if latter is unused
Replicates lavf/librtmp.c behavior in L145-152 and rtmpdump's
behavior with "--swfVfy <url>" passing the url to swfUrl.

Fixes bug 943.

Signed-off-by: Martin Storsjö <martin@martin.st>
2017-03-26 13:29:56 +03:00