Commit Graph

10678 Commits

Author SHA1 Message Date
Diego Biurrun
5049f6b772 rtpdec_jpeg: Coalesce redundant error checks 2015-12-26 10:26:29 +01:00
Stefan Pöschel
dbce017913 mpegtsenc: add flag to embed an AC-3 ES the DVB way
So far an AC-3 elementary stream is refered to in the PMT according to
System A (ATSC). However System B (DVB) has a different way to signal an AC-3
ES within the PMT. This different way can be enabled by a new flag. The flag is
more generally named 'system_b' as there are further differences between ATSC
and DVB (e.g. the signalling of E-AC-3) which should then also be covered by it
in the future.

Bug-Id: 73

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2015-12-14 15:16:33 +01:00
Anton Khirnov
5bc223b15d r3d: fix an invalid read introduced in 6bf4c1d 2015-12-14 12:12:42 +01:00
Martin Storsjö
64f8c439fd rtmpproto: Include the full path as app when "slist=" is found
This matches what librtmp does. This fixes automatic url parsing of
crunchyroll urls.

Signed-off-by: Martin Storsjö <martin@martin.st>
2015-12-13 23:23:06 +02:00
Anton Khirnov
9f0b6e6827 vocdec: do not create the stream in read_header()
The stream parameters are not known until we read a packet, so postpone
creating it until then.
2015-12-12 21:27:11 +01:00
Anton Khirnov
2d0432d918 vocdec: put the code not shared with other demuxers under appropriate ifdef 2015-12-12 21:26:55 +01:00
Anton Khirnov
09ae7b81ea flvdec: do not create any streams in read_header()
The current muxer behaviour is to create streams in read_header() based
on the audio/video presence flags, but fill in the stream parameters
later when we actually get some packets for them. This is rather shady,
since other demuxers set the stream parameters immediately when the
stream is created and do not touch the stream codec context after that.

Change the flv demuxer to behave in the same way as other similar
demuxers -- create the streams only when we get a packet for them.
2015-12-12 21:26:48 +01:00
Anton Khirnov
72d658766e mp3dec: replace avpriv_mpa_decode_header with avpriv_mpegaudio_decode_header
The latter does not require a full AVCodecContext and still provides all
the functionality needed here.
2015-12-12 21:26:00 +01:00
Anton Khirnov
955aec3c7c mpegaudiodecheader: check the header in avpriv_mpegaudio_decode_header
Almost all the places from which this function is called already check
the header manually and in the two that don't (the mp3 muxer) the check
should not cause any problems.
2015-12-12 21:25:42 +01:00
Anton Khirnov
6bf4c1d711 r3d: do not create the audio stream until we know the sample rate 2015-12-12 21:20:33 +01:00
Anton Khirnov
9f1eccb97b ff_parse_specific_params: do not use AVCodecContext.frame_size
It will not be set unless the muxing codec context is also the encoding
context, which is discouraged. When the frame size is not known from
av_get_audio_frame_duration(), the fallback should still be good enough.
2015-12-12 21:19:50 +01:00
Anton Khirnov
1f008f34d5 rmenc: do not use AVCodecContext.frame_size
It will not be set if the stream codec context is not the encoding
context. Use av_get_audio_frame_duration() instead, it should work for
all audio codecs supported by the muxer.
2015-12-12 21:19:08 +01:00
Aaron Colwell
febfb49a70 matroskadec: Fix sample_aspect_ratio for stereo matroska content
matroskaenc applies divisors to the display width/height when generating
stereo content. This patch adds the corresponding multipliers to matroskadec
so that the original sample aspect ratio can be recovered.

Signed-off-by: wm4 <nfxjfg@googlemail.com>
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2015-12-07 11:27:42 -05:00
Ganesh Ajjanagadde
d5f5c90be9 rtsp: free opts dictionary on failure of getnameinfo
Signed-off-by: Martin Storsjö <martin@martin.st>
2015-12-07 11:11:31 +02:00
Ganesh Ajjanagadde
8df8f0c70c movenc-test: add a missing va_end call
Signed-off-by: Martin Storsjö <martin@martin.st>
2015-12-07 11:11:30 +02:00
Anton Khirnov
b8b21dee0f mxfenc: always assume long gop
Checking the codec context parameters to find out this information is
far too unreliable to be useful, so it is safer to assume B-frames are
always present.
2015-12-06 10:28:36 +01:00
Anton Khirnov
e02de9df4b lavc: export Dirac parsing API used by the ogg demuxer as public
Also, stop using AVCodecContext for storing the stream parameters.
2015-12-06 10:28:04 +01:00
Anton Khirnov
8bcadaacc2 mpegenc: use the CPB props side data
Do not access the encoder options, since it makes no sense when the
AVStream codec context is not the encoding context.
2015-12-06 10:26:13 +01:00
Anton Khirnov
5845a8273e movenc: use the CPB props side data
Do not access the encoder options, since it makes no sense when the
AVStream codec context is not the encoding context.
2015-12-06 10:26:01 +01:00
Luca Barbato
5f3a081b42 avi: Spin out the logic to position to the next non-interleaved stream
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2015-12-02 23:49:10 +01:00
Michael Niedermayer
0fc61c6ab6 avi: Validate the stream-id for DV as well
Avoid false positives while syncing.

Bug-Id: ffmpeg/4086
Bug-Id: 879

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2015-12-02 23:49:10 +01:00
Luca Barbato
d017ed878a avi: Use the correct data type
avio_tell returns an int64_t.
2015-12-02 23:49:10 +01:00
Mohamed Naufal
ca5f386e75 lavf: G.723.1 muxer
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2015-11-30 10:58:46 -05:00
Luca Barbato
a0fa6d06b8 matroska: Warn when metadata references a non-existent element
Avoid some confusion when the information is not present.

Bug-Id: 902
2015-11-28 17:02:15 +01:00
Luca Barbato
f7986239f4 dvenc: Validate the frame size before copying it 2015-11-28 17:02:15 +01:00
Luca Barbato
0e2395293b nut: Mark non-fatal errors as warnings
And make one more informative.
2015-11-25 09:01:25 +01:00
Luca Barbato
62f72b40c0 nut: Provide more information on failure 2015-11-25 09:01:25 +01:00
Luca Barbato
2c17fb61ce rtsp: Log getaddrinfo failures
And forward the logging contexts when needed.
2015-11-25 09:01:25 +01:00
Luca Barbato
12b1438286 udp: Provide additional information on getaddrinfo failure 2015-11-25 09:01:25 +01:00
Luca Barbato
34af7813f7 udp: Use the logging context 2015-11-25 09:01:25 +01:00
Luca Barbato
98063bcf15 rtsp: Do not assume getnameinfo cannot fail
And properly report the error when it happens.
2015-11-25 09:01:25 +01:00
Michael Niedermayer
5b70fb8fee movenc-test: Fix integer overflows
Signed-off-by: Martin Storsjö <martin@martin.st>
2015-11-24 20:57:11 +02:00
Alexandra Hájková
8375dc1dd1 asfdec: handle the case when the stream index has an invalid value better
The demuxer returned INVALIDDATA and failed to demux the remaining data
when an invalid stream index was read, now it just skips the asf packet
for the stream with an invalid stream index and continues demuxing.

Reported-By: Hendrik Leppkes

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2015-11-23 11:42:55 +01:00
Derek Buitenhuis
c8fa647811 oggparsespeex: Fix unchecked malloc
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2015-11-23 10:44:07 +01:00
John Stebbins
ca489564ae movenc: add fallback audio track tref support
This feature allows making associations between audio tracks
that apple players recognize.  E.g. when an ac3 track has a
tref that points to an aac track, devices that don't support
ac3 will automatically fall back to the aac track.

Apple used to *guess* these associations, but new products
(AppleTV 4) no longer guess and this association can only
be made explicitly now using the "fall" tref.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2015-11-18 11:38:03 +01:00
John Stebbins
7f4ec4364b avformat: expose av_stream_new_side_data helper
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2015-11-18 11:36:27 +01:00
Anton Khirnov
21ab6fd01b lavf: document that passing valid timestamps to muxers is now mandatory
Also, extend the documentation about setting timestamps.
2015-11-18 11:31:40 +01:00
Michael Niedermayer
2fb6e1e754 segafilm: Fix current_sample after seeking and avio_seek return type
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-14 03:39:44 +01:00
Martin Storsjö
62b4a6f1b9 rtmpcrypt: Provide the xtea keys in little endian format for consistency
Signed-off-by: Martin Storsjö <martin@martin.st>
2015-11-13 21:54:04 +02:00
Martin Storsjö
588b6215b4 rtmpcrypt: Do the xtea decryption in little endian mode
The XTEA algorithm operates on 32 bit numbers, not on byte sequences.
The XTEA implementation in libavutil is written assuming big endian
numbers, while the rtmpe signature encryption assumes little endian.

This fixes rtmpe communication with rtmpe servers that use signature
type 8 (XTEA), e.g. crunchyroll.

Signed-off-by: Martin Storsjö <martin@martin.st>
2015-11-13 21:53:57 +02:00
Vittorio Giovara
b5f963bfec mov: Drop dref when unable to parse
Some entries might be either empty or contain types we do not parse
(eg. 'url '). In both cases, if an 'alis' is not the first entry,
external references are not loaded, so make sure that the array starts
with an 'alis' dref.
2015-11-12 04:39:14 +01:00
Vittorio Giovara
303f931938 mov: Correctly store dref paths
Rather than reading the alternate absolute path version from dref
type 18, make sure that 0s are considered as '/'. These values are
sometimes present in the full path, and are mistakenly interpreted as
line terminators othewise.

With the correct handling of this dref type, parsing type 18 is not
needed any more.
2015-11-12 04:39:14 +01:00
Carl Eugen Hoyos
73b0324913 aiff: Support demuxing G.722 streams 2015-11-12 04:39:14 +01:00
Paul B Mahol
5f2c8315b3 thp: set duration for audio stream too
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2015-11-12 04:39:14 +01:00
Martin Storsjö
1d62ee3889 movenc: Add a unit test for signaling of the track start times
Signed-off-by: Martin Storsjö <martin@martin.st>
2015-11-11 22:53:42 +02:00
Martin Storsjö
bef3b1f59f movenc: Allow setting start_dts/start_cts before writing actual packets
By writing a zero-sized packet, the caller can communicate the
start_dts/start_cts for the stream without actually writing
the first packet.

This allows doing random-access writing of fragments when the
start dts of the stream isn't zero, so that the edit list in the moov
is written based on timestamps from the nominal start time signaled
via the zero-sized packet, while the first proper packet written
corresponds to a later fragment.

To avoid potential unexpected behaviour, empty packets only set
start_dts if the frag_discont flag is set.

Signed-off-by: Martin Storsjö <martin@martin.st>
2015-11-11 22:53:31 +02:00
Martin Storsjö
3eeb7edfc2 movenc: Add a unit test for frag_discont with edit lists
This tests the case where the muxer correctly guesses that a stream
starts at pts=0.

Signed-off-by: Martin Storsjö <martin@martin.st>
2015-11-11 22:52:53 +02:00
Martin Storsjö
09e431b9e3 movenc: Assume streams starting at pts=0 for discontinuous fragments with editlists
This allows producing fragments discontinously where the video
stream has b-frames (but starts at pts=0), but doesn't work for the
cases with audio with preroll.

Signed-off-by: Martin Storsjö <martin@martin.st>
2015-11-11 22:52:36 +02:00
Martin Storsjö
59e8ec0aa8 movenc: Add an API unit test for fragmenting options/calls
Contrary to the normal fate tests that run via avconv, this tests
nontrivial call sequences that are only doable via the API
(mainly for different corner cases when using the muxer for
segmenting).

The test muxes fake packet data (with extradata that looks
enough like proper data to make the file be viewable with e.g.
boxdumper) and checks the hash of the produced files. The test also
verifies that fragments produced via different call sequences remain
identical (to avoid e.g. updating the output hashes and suddenly
having fragments that used to be identical suddenly diverging), for
fragments written with frag_discont and/or delay_moov.

Signed-off-by: Martin Storsjö <martin@martin.st>
2015-11-10 21:50:25 +02:00
Martin Storsjö
8ad5124b7e movenc: Automatically flush after writing the initial moov
In most other cases when writing fragmented mp4 files, the output
IO context is flushed after each fragment. Also flush it after
writing the initial moov, to have it behave in the same way.

Signed-off-by: Martin Storsjö <martin@martin.st>
2015-11-10 21:46:03 +02:00