Commit Graph

10137 Commits

Author SHA1 Message Date
Anton Khirnov 99143140de mp3dec: fix reading the Xing tag
The quality scale field is only supposed to be present if the fourth bit
is set. In practice, lame always sets it, but other tools might not.

CC:libav-stable@libav.org
2014-10-24 09:03:16 +02:00
Martin Storsjö 6df9d9b55d lavf: Use av_gettime_relative
The ones left using av_gettime are NTP timestamps (for RTCP,
which is specified to send the actual current realtime clock
in RTCP SR packets), and the NUT muxer timestamper, which is
documented as using wallclock time.

Signed-off-by: Martin Storsjö <martin@martin.st>
2014-10-24 09:53:45 +03:00
Vittorio Giovara af7ca6ea12 nutdec: check av_new_packet return value
CC: libav-stable@libav.org
Bug-Id: CID 733713
2014-10-21 14:37:48 +01:00
Vittorio Giovara b69183f65d nutenc: check for negative index rather than assert
CC: libav-stable@libav.org
Bug-Id: CID 703721
2014-10-21 14:37:48 +01:00
Vittorio Giovara be42c0b8d5 rmdec: stricter error check to avoid theoretical unitialized use
CC: libav-stable@libav.org
Bug-Id: CID 90558
2014-10-21 14:37:48 +01:00
Vittorio Giovara 7207dd8f82 rmdec: check av_new_packet return value
CC: libav-stable@libav.org
Bug-Id: CID 733714
2014-10-21 14:37:48 +01:00
Vittorio Giovara 629b2ed0ac flvdec: make sure to check create_stream and report the same error
CC: libav-stable@libav.org
Bug-Id: CID 732242
2014-10-21 14:37:48 +01:00
Vittorio Giovara f22aa6b841 flvdec: avoid unitialized use of a struct member
CC: libav-stable@libav.org
Bug-Id: CID 718141
2014-10-21 14:37:48 +01:00
Vittorio Giovara e73d26bbd6 smoothstreamingenc: explict cast to avoid overflow
CC: libav-stable@libav.org
Bug-Id: CID 732248
2014-10-21 14:37:48 +01:00
Luca Barbato d2771a1dc0 rtpproto: Free the addrinfo pointer on failure
CC: libav-stable@libav.org
Bug-Id: CID 1238797
2014-10-20 10:47:29 +01:00
Luca Barbato 96bfb67747 nutdec: Prevent a memory corruption
Chapters do not have an event_flags field.

Bug-Id: CID 1231990
2014-10-20 10:47:03 +01:00
Vittorio Giovara 350ed18292 rtpdec_hevc: drop unnecessary check
len is always >=1 in that case.

Bug-Id: CID 1238784
2014-10-20 10:44:42 +01:00
Vittorio Giovara 322b571d55 rtmpproto: remove dead code
Expression already evaluated before, redundant since
0533868642.

Bug-Id: CID 732199
2014-10-20 10:44:22 +01:00
Vittorio Giovara 7b48bf9524 wtv: clean memory on error
CC: libav-stable@libav.org
Bug-Id: CID 718002
2014-10-20 10:38:38 +01:00
Vittorio Giovara 9fbc613f0d wtv: check seek_by_sector return value
CC: libav-stable@libav.org
Bug-Id: CID 1198258
2014-10-20 10:38:38 +01:00
Vittorio Giovara d7f530b0d6 aviobuf: check context before using it
Avoid a possible null pointer dereference.

CC: libav-stable@libav.org
Bug-Id: CID 1135769
2014-10-20 10:38:38 +01:00
Michael Niedermayer 02484d1a93 avio: fix sizeof argument
CC: libav-stable@libav.org
Bug-Id: CID 732284
2014-10-20 10:38:38 +01:00
Vittorio Giovara 8ab3b71e4b idcin: fix return check
CC: libav-stable@libav.org
Bug-Id: CID 732198
2014-10-20 10:38:37 +01:00
Alexander Drozdov 0034314a69 rtmp: Always call rtmp_close() on rtmp_open() failure
Prevent possible memory leaks.

Connect to nginx and request a non-existent resource to
trigger the issue.

CC: libav-stable@libav.org

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Uwe L. Korn <uwelk@xhochy.com>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2014-10-18 17:37:11 +02:00
Anton Khirnov fb238f8230 urlprotocol: remove unused url_interrupt_cb declaration
It is a remnant of the old interrupt callback API.
2014-10-18 05:01:20 +02:00
Uwe L. Korn 9bec3ca2b8 rtmpproto: Add pause support
Signed-off-by: Martin Storsjö <martin@martin.st>
2014-10-17 23:13:51 +03:00
Uwe L. Korn f4cd8b80b9 rtmpproto: Track last received timestamp
Some RTMP commands need the most recent timestamp as their parameter, so
keep track of it. This must be the most recent one and not e.g. the max
received timestamp as it can decrease again through seeking.

Signed-off-by: Martin Storsjö <martin@martin.st>
2014-10-17 23:13:37 +03:00
Uwe L. Korn e65c776d18 rtmpproto: Add getStreamLength call to query duration
In (non-live) streams with no metadata, the duration of a stream can
be retrieved by calling the RTMP function getStreamLength with the
playpath. The server will return a positive duration upon the request if
the duration is known, otherwise either no response or a duration of 0
will be returned.

Signed-off-by: Martin Storsjö <martin@martin.st>
2014-10-17 12:07:19 +03:00
Uwe L. Korn 324b23dde1 rtmpproto: Add function to read a number response
Packets that contain a number as a result to a rtmp function call are
structured the same way (String, Number, Null, Number). This new method
also includes more bounds checks to better handle packets that are not
structured as expected.

Signed-off-by: Martin Storsjö <martin@martin.st>
2014-10-17 12:07:19 +03:00
Luca Barbato 0db6bbb24c avformat: Make avformat_free_context handle NULL
Work as the other free()-like functions.

Bug-Id: CID 1087081
CC: libav-stable@libav.org
2014-10-17 09:55:46 +01:00
Michael Lynch 460b509a34 rtsp: Check a memory allocation
CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
2014-10-16 09:19:03 +03:00
Martin Storsjö 79dd756e14 rtmpproto: Fix a typo
Signed-off-by: Martin Storsjö <martin@martin.st>
2014-10-15 21:00:39 +03:00
Martin Storsjö ced7238cd0 rtpdec_hevc: Use av_realloc instead of av_malloc+memcpy
Signed-off-by: Martin Storsjö <martin@martin.st>
2014-10-15 20:54:32 +03:00
Martin Storsjö 752e71e74f rtpdec_hevc: Rename a variable for clarity
Signed-off-by: Martin Storsjö <martin@martin.st>
2014-10-15 20:54:30 +03:00
Vittorio Giovara 74b0237798 mov: Correctly check the color transfer characteristics range
Reported-by: Ruoyu <liangry@ucweb.com>
2014-10-15 14:48:40 +01:00
Martin Storsjö e5cfc8fdad sdp: Provide out of bound parameter sets for HEVC if extradata is set
Signed-off-by: Martin Storsjö <martin@martin.st>
2014-10-15 12:12:54 +03:00
Martin Storsjö 9b7f932ee5 rtpdec_hevc: Parse out of band vps/sps/pps/sei from fmtp lines
These are assembled into extradata in the order vps/sps/pps/sei.

Signed-off-by: Martin Storsjö <martin@martin.st>
2014-10-15 12:12:02 +03:00
Anton Khirnov 2d6e58497e lavf: switch to AVCodecContext.framerate for demuxing 2014-10-15 06:37:55 +00:00
Martin Storsjö a74f8121d8 mov: Handle tfdt atoms
Signed-off-by: Martin Storsjö <martin@martin.st>
2014-10-14 13:52:32 +03:00
Martin Storsjö c2c22c75cf movenc: Write tfdt atoms
These allow getting the absolute start timestamp of a fragment
without reading preceding timestamps. This fixes sync between
tracks if starting from fragments in different streams that don't
align exactly.

This also is a prerequisite for producing DASH content.

Signed-off-by: Martin Storsjö <martin@martin.st>
2014-10-14 13:52:32 +03:00
Anton Khirnov eabdc2a830 lavf: use initial_padding instead of deprecated delay 2014-10-13 19:10:30 +00:00
Mark McGough 76c70e33d2 icecast: Do not use chunked post
Icecast uses HTTP 1.0 while Libav uses HTTP 1.1 and enables by
default chunked post.

Icecast actually forwards the HTTP chunk headers to the listener
as part of the media stream (without the chunk encoding HTTP headers)
causing the players to lose sync.

Disabling the option is enough to feed icecast properly.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2014-10-12 19:54:07 +02:00
Martin Storsjö e44ee1eb8d movenc: Simplify code by using an existing local pointer
Signed-off-by: Martin Storsjö <martin@martin.st>
2014-10-12 17:48:09 +03:00
Martin Storsjö dad12ce452 movenc: Print a warning for an unhandled case of nonzero start dts with empty_moov
Signed-off-by: Martin Storsjö <martin@martin.st>
2014-10-12 17:46:56 +03:00
Martin Storsjö dbb472cb2f movenc: Write edit lists for fragmented files as well, if necessary
This is necessary to get the right timestamp offset for content
that starts with dts != 0.

This currently only helps when writing fragmented files with a non-empty
moov atom. When writing an empty moov atom, we don't have any packets
yet, so we don't know the starting dts for the tracks.

Signed-off-by: Martin Storsjö <martin@martin.st>
2014-10-12 17:46:31 +03:00
Martin Storsjö 95ee4e2ce7 movenc: Add some comments explaining subtle details in writing the edit lists
Signed-off-by: Martin Storsjö <martin@martin.st>
2014-10-12 17:46:01 +03:00
Michael Niedermayer 72f801619a movenc: Adjust edit lists to trim out parts of tracks with negative pts
This makes sure that audio preroll for e.g. AAC is signaled correctly.

Previously we only wrote the edit list correctly if we had negative
dts but started with pts == 0 (e.g. for video with B-frames).

Signed-off-by: Martin Storsjö <martin@martin.st>
2014-10-12 17:45:55 +03:00
Martin Storsjö 8bef433881 smoothstreamingenc: Simplify code by removing a redundant variable
Signed-off-by: Martin Storsjö <martin@martin.st>
2014-10-12 17:42:42 +03:00
Michael Niedermayer bd239c9a2e lavf: Don't drop both pts and dts if timestamps are invalid
In these cases, only drop dts. Because if we drop both we have no
timestamps at all for some files.

This improves playback of HLS streams from GoPro cameras.

Signed-off-by: Martin Storsjö <martin@martin.st>
2014-10-12 01:32:52 +03:00
Luca Barbato 1d4579e38e tcp: Add AVOption support 2014-10-10 16:29:07 +02:00
Luca Barbato cd9d6399fd tls: Support passing old-style tcp options
Make tcp and tls urls near-interchangeable.
2014-10-10 16:29:07 +02:00
Luca Barbato 3df8d52fcd rtsp: Add rtsps to the probe 2014-10-10 16:29:06 +02:00
Luca Barbato c839b0439f rtsp: Support tls when in listen mode 2014-10-10 16:29:06 +02:00
Luca Barbato 8b2e9636c5 rtsp: Support tls-encapsulated RTSP 2014-10-10 16:29:06 +02:00
Luca Barbato c27328e749 rtsp: Check for command strings without spaces
Prevent a NULL-pointer dereference.

CC: libav-stable@libav.org
2014-10-10 16:29:06 +02:00
Luca Barbato 09e1ccc8cd sctp: Use AVERROR_BUG instead of abort()
Trying to write to a stream id larger the the maximum requested is
a programming error, still there is no reason to leave a
reachable abort() in the codebase.

CC: libav-stable@libav.org
2014-10-10 16:29:06 +02:00
Luca Barbato eb4f906900 lavf: More informative error message
Print the timestamp values and not just the stream index.
2014-10-10 16:29:06 +02:00
Vittorio Giovara 0d8a3656ba mov: support the Color Parameter Atoms 'colr' 2014-10-08 18:17:50 +01:00
Sylvain Rabot 167e6f1489 dump: Update streams and chapters printout format
This matches the -map option which requires '%d:%d' format.
2014-10-08 18:17:49 +01:00
Vittorio Giovara 20a5956b8d dump: split audio and video probing on multiple lines
Also always report pixel format.
2014-10-08 18:17:49 +01:00
Vittorio Giovara 7ae9791b64 avformat: bump version after mime_type change 2014-10-08 15:59:51 +01:00
Andreas Cadhalpun b15b06ebf5 avformat: use const char* instead of uint8_t* for AVProbeData.mime_type
This makes the field consistent with AVInputFormat.mime_type and the
argument type of av_match_name.

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2014-10-08 15:13:15 +01:00
Martin Storsjö 28816050e4 lavf: Set the stream time base hint properly for chained muxers
This avoids warnings about using the codec time base as time
base hint.

Signed-off-by: Martin Storsjö <martin@martin.st>
2014-10-06 23:30:52 +03:00
Martin Storsjö b762494438 sdp: Simplify parsing/conversion of H264 extradata
By using ff_avc_write_annexb_extradata instead of the h264_mp4toannexb
BSF, the code for doing the conversion itself is kept much shorter,
there's less state to restore at the end, we don't risk leaving the
AVCodecContext in an inconsistent state if returning early due to
errors, etc.

Also add a missing free if the base64 encoding fails.

Signed-off-by: Martin Storsjö <martin@martin.st>
2014-10-06 23:29:58 +03:00
Joakim Roubert 55f03d8726 hlsenc: Add parameter -hls_allow_cache
The -hls_allow_cache parameter enables explicitly setting the
EXT-X-ALLOW-CACHE tag in the manifest file. That tag indicates
whether the client MAY or MUST NOT cache downloaded media
segments for later replay.

Valid values are 1 (=YES) or 0 (=NO) and the EXT-X-ALLOW-CACHE
will not show in the manifest for other values (or if
-hls_allow_cache is not used.

Signed-off-by: Martin Storsjö <martin@martin.st>
2014-10-03 20:20:28 +03:00
Justin Ruggles 19133e96d3 lavf: fix memleaks in avformat_find_stream_info()
When AVFMT_FLAG_NOBUFFER is set, the packets are not added to the
AVFormatContext packet list, so they need to be freed when they are
no longer needed.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-09-29 17:54:25 +00:00
Timothy B. Terriberry a05f5052fe sdp: Make opus declaration conform to the spec
Signed-off-by: Martin Storsjö <martin@martin.st>
2014-09-29 13:48:42 +03:00
Andreas Cadhalpun 883e98bc25 probe: Bump the score for mime type matching
It should be more trustworthy than extension matching.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2014-09-26 20:56:16 +02:00
Diego Biurrun 4d5b99dacd caf: Give context structure a consistent name 2014-09-26 00:44:41 -07:00
Gabriel Dume 4620affa24 m4vdec: K&R formatting cosmetics
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2014-09-25 01:58:51 -07:00
Gabriel Dume 86a361081d lmlm4: K&R formatting cosmetics
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2014-09-25 01:44:32 -07:00
Gabriel Dume 95d312d6c8 concat: K&R formatting cosmetics
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2014-09-25 01:44:31 -07:00
Martin Storsjö 2f172f1ae9 rtsp: Clear the session id on redirects
This fixes handling redirects in case the server provided a session
id within the redirect reply.

Signed-off-by: Martin Storsjö <martin@martin.st>
2014-09-24 23:34:02 +03:00
Thomas Volkert ddf5fb71ee rtpenc: HEVC/H.265 support
Signed-off-by: Martin Storsjö <martin@martin.st>
2014-09-24 23:33:26 +03:00
Martin Storsjö a2efbecc4e libavformat: Move avc mp4 startcode parsing to a shared file
Signed-off-by: Martin Storsjö <martin@martin.st>
2014-09-24 23:33:17 +03:00
Vittorio Giovara c463dfc7e4 rtpdec_hevc: Drop a duplicated, nonstandard entry
The RFC spec draft only specifies the "H265" name - there is no
specification saying how to interpret "HEVC" (if such a packet
format is specified it could be an entirely different format).

Since this is a very new standard (still a draft), there is little
need for compatibility with existing, broken implementations. Therefore
remove the extra alias, to avoid the risk of encouraging incorrect
usage.

Intentionally keeping the ff_hevc_dynamic_handler name for the
handler, to use "hevc" consistently as name for the codec instead
of "h265" within the library internals as long as there only is one
single variant in actual use.

Signed-off-by: Martin Storsjö <martin@martin.st>
2014-09-24 10:44:14 +03:00
Martin Storsjö 2bb2c2bd75 rtpenc_chain: Pass the initial time_base hint on to the chained muxer
In practice this hint is ignored - the rtp muxer always overwrites
the stream time base without taking the hint into account. But as
a general practice this is the correct way to pass a time base hint
on to a chained muxer.

This avoids warnings about using the codec time base as hint
being deprecated.

Signed-off-by: Martin Storsjö <martin@martin.st>
2014-09-17 22:53:27 +03:00
Katerina Barone-Adesi c5560e72d0 apetag: Fix APE tag size check
The size variable is (correctly) unsigned, but is passed to several functions
which take signed parameters, such as avio_read, sometimes after having
numbers added to it. So ensure that size remains within the bounds that
these functions can handle.

CC: libav-stable@libav.org
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2014-09-17 06:37:05 -07:00
Martin Storsjö 803e82276b libavformat: Check mkdir return error codes
Previously, the returned error codes were intentionally ignored
(see fadd3a6821), to avoid aborting if the directory already
existed. If the mkdir actually failed, this was caught when
opening files within the directory fails anyway.

By handling the error code here (but explicitly ignoring EEXIST),
the error messages and return codes in these cases are more
appropriate and less confusing.

Signed-off-by: Martin Storsjö <martin@martin.st>
2014-09-07 23:20:29 +03:00
Diego Biurrun 4d55e9de27 vc1: Split bits used in libavformat into a separate header
This reduces inter-library dependencies.
2014-09-04 07:11:03 -07:00
Thomas Volkert 95e177eeb2 rtpdec: HEVC/H.265 support
As specified in draft-ietf-payload-rtp-h265-06.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2014-09-03 02:39:24 +02:00
Luca Barbato 7968059e5c mpegts: Allow custom max resync size 2014-09-03 02:38:03 +02:00
Vittorio Giovara 4d686fb721 matroskaenc: convert avstream stereo3d side data during encoding
Write the StereoMode Embl to bitstream.
2014-08-28 12:35:27 -04:00
Vittorio Giovara d4ae8ac92f matroskadec: parse stereo mode on decoding
Convert the Matroska stereo format to the Stereo3D format, and add a
Stereo3D side data to the stream.

Bump the doctype version supported.

Bug-Id: 728 / https://bugs.debian.org/757185
2014-08-28 12:33:26 -04:00
Vittorio Giovara 9301486408 avcodec: add stream-level stereo3d side data 2014-08-28 12:33:26 -04:00
Vittorio Giovara f2583bc86e matroska: list supported extensions 2014-08-28 12:33:25 -04:00
Anton Khirnov 75bbaf2493 mpegenc: limit the maximum muxrate
It is written to the file as a 22-bit value.

CC: libav-stable@libav.org
2014-08-27 06:21:54 +00:00
Diego Biurrun 4c8bd8ddb0 os_support: Adjust an outdated #endif comment 2014-08-26 06:34:41 -07:00
Luca Barbato 4e9e6fa99f mpeg: Write H264 streams at offset 2
It hints that the content is H264 according to HD-DVD.
2014-08-26 03:43:13 +02:00
Rémi Denis-Courmont 6ee1cb5740 libavformat: use MSG_NOSIGNAL when applicable
If the remote end of a connection oriented socket hangs up, generating
an EPIPE error is preferable over an unhandled SIGPIPE signal.

Signed-off-by: Martin Storsjö <martin@martin.st>
2014-08-25 10:49:14 +03:00
Anton Khirnov b263f8ffe7 lavf: add AVFormatContext.max_ts_probe
It allows to configure how long will avformat_find_stream_info() wait
to get the first timestamp.
2014-08-25 05:17:54 +00:00
Luca Barbato f9f34cb998 ogg: Use separate classes for the aliases
Unbreak 051aadeed1
2014-08-23 02:42:18 +02:00
Diego Biurrun 1019b7c4ed os_support: Undefine lseek/stat/fstat before defining them
This avoids a number of redefinition warnings on MinGW64.
2014-08-22 18:35:19 +02:00
Luca Barbato 051aadeed1 ogg: Provide aliases for Speex, Opus and audio-only ogg
Since they are aliases for ogg enabling any of them enables ogg as well.
2014-08-22 13:23:50 +02:00
Anton Khirnov cb7b1a2dfb electronicarts: set the framerate for TGQ/TQI
It is hardcoded to 15fps.
2014-08-22 11:15:20 +00:00
Anton Khirnov 7b6aae23e1 electronicarts: read the framerate for MAD 2014-08-22 11:15:20 +00:00
Anton Khirnov 4d6c515284 electronicarts: do not fail on zero-sized chunks
At least one FATE sample contains such chunks and happens to work simply
by accident (due to find_stream_info() swallowing the error).

CC: libav-stable@libav.org
2014-08-22 11:15:20 +00:00
Nidhi Makhijani 13c90bc9a3 adts: Return more meaningful error codes
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2014-08-21 04:25:48 -07:00
Diego Biurrun 86dfcfd0e3 mov: Drop unused parameter from ff_mov_read_esds()
This is cleaner and avoids an uninitialized variable warning with MSVC.
2014-08-19 06:22:07 -07:00
Luca Barbato 369380e1c4 mxf: Support AAC
Update mxf_set_audio_pts to use the container-provided information.

The UL is marked as "to be changed in the future", but the current
samples in the wild do use it.
2014-08-17 16:11:16 +02:00
Luca Barbato 747cd9560c mxf: Add the UL for the MPEG2VideoDescriptor 2014-08-17 16:11:02 +02:00
Luca Barbato 304089aca7 mxf: Add UID print helpers
And use it to print non-parsed ULs.
2014-08-17 16:11:02 +02:00
Gabriel Dume 4b1f5e5090 cosmetics: Write NULL pointer inequality checks more compactly
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2014-08-15 05:34:13 -07:00
Gabriel Dume f929ab0569 cosmetics: Write NULL pointer equality checks more compactly
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2014-08-15 03:18:18 -07:00
Diego Biurrun 7ccb847f0f http: Reduce scope of a variable in parse_content_encoding()
Also fixes an unused variable warning with zlib disabled.
2014-08-15 09:37:38 +02:00