Commit Graph

9990 Commits

Author SHA1 Message Date
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
Nidhi Makhijani 0528226a05 a64: Return correct error code on invalid data stream
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2014-08-14 01:22:47 -07:00
Luca Barbato e8049af132 mpegts: Do not try to write a PMT larger than SECTION_SIZE
Prevent out of array writes.

Similar to what Michael Niedermayer did to address the same issue.

Bug-Id: CVE-2014-2263
CC: libav-stable@libav.org

Signed-off-by: Diego Biurrun <diego@biurrun.de>
2014-08-13 12:43:26 -07:00
Anton Khirnov 30e50c5027 lavf: eliminate ff_get_audio_frame_size()
It is basically a wrapper around av_get_audio_frame_duration(), with a
fallback to AVCodecContext.frame_size. However, that field is set only
when the stream codec context is actually used for encoding or decoding,
which is discouraged.

For muxing, it is generally the responsibility of the caller to set the
packet duration.
For demuxing, if the duration is not stored at the container level, it
should be set by the parser.

Therefore, removing the frame_size fallback should not break any
important case.
2014-08-13 17:41:11 +00:00
Martin Storsjö 4e629ef80e http: Fix authentication, broken since 6a463e7fb
The cur_*auth_type variables were set before the http_connect call
prior to 6a463e7fb - their sole purpose is to record the
authentication type used to do the latest request, since parsing
the http response sets the new type in the auth state.

CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
2014-08-13 20:22:28 +03:00
Andrew Stone db68ef898a ogg: update event_flags with STREAM_/METADATA_UPDATED whenever metadata changes.
Originally, AVFormatContext and a metadata dict were provided to ff_vorbis_comment(),
but this presented issues if an AVStream was being updated or the metadata on
AVFormatContext wasn't actually being updated. To remedy this, ff_vorbis_stream_comment()
explicitly updates a stream's metadata and sets any necessary flags.

ff_vorbis_comment() does not modify any flags, and any calls to it that update
AVFormatContext's metadata (just a single call) must also update
AVFormatContext.event_flags after detecting any metadata changes to the provided
dictionary, as signaled by a positive return value.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-08-13 16:25:19 +00:00
Andrew Stone cc3e88a2b9 mov: update AVFormatContext.event_flags with METADATA_UPDATED whenever metadata changes.
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-08-13 16:24:09 +00:00
Andrew Stone fa3a5dd4de nutdec: update AVFormatContext.event_flags with STREAM_/METADATA_UPDATED whenever metadata changes.
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-08-13 16:23:36 +00:00
Andrew Stone 0f789322ef flvdec: update AVFormatContext.event_flags with METADATA_UPDATED whenever metadata changes.
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-08-13 16:23:28 +00:00
Andrew Stone 93c04e095d Expose metadata found in onCuePoint events in .flv files.
Currently, only onMetaData is used, but some providers (wrongly)
put metadata into onCuePoint events, and it's still nice to be
able to use that data.

onCuePoint events also present metadata slightly differently than
onMetaData events: all metadata is found inside an object called
"parameters". In order to extract this metadata, it's easiest to
recurse through the object tree and pull out anything found in
child objects and put it in the top-level metadata.

Reference: http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/2/help.html?content=00001404.html

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-08-13 16:11:43 +00:00
Andrew Stone 019d3fccc4 Set protocol-level metadata in AVFormatContext any time a packet is read.
If any option named "metadata" is set inside the context, it is pulled up to
the context and then the option is cleared.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-08-13 16:10:49 +00:00
Andrew Stone 7e38903b5c http: enable icy metadata by default.
It won't hurt servers that don't care about the header,
and those that do will include it by default.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-08-13 16:10:15 +00:00
Andrew Stone 7601f9412a http: export icecast metadata as an option with name "metadata".
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-08-13 16:09:05 +00:00
Andrew Stone afbd4b7e09 lavf: add AVFormatContext/AVStream fields for signaling to the user when events happen.
The only flags, for now, indicate if metadata was updated and are set after each call to
av_read_frame(). This comes with the caveat that, on stream start, it might not be set properly
as packets might be buffered in AVFormatContext.packet_buffer before being given to the user
in av_read_frame().

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-08-13 16:04:48 +00:00
Martin Storsjö 8bf3bf69ad http: Stop reading after receiving the whole file for non-chunked transfers
Previously this logic was only used if the server didn't
respond with Connection: close, but use it even for that case,
if the server response is non-chunked.

Originally the http code has relied on Connection: close to close
the socket when the file/stream is received - the http protocol
code just kept reading from the socket until the socket was closed.
In f240ed18 we added a check for the file size, because some
http servers didn't respond with Connection: close (and wouldn't
close the socket) even though we requested it, which meant that the
http protocol blocked for a long time at the end of files, waiting
for a socket level timeout.

When reading over tls, trying to read at the end of the connection,
when the peer has closed the connection, can produce spurious (but
harmless) warnings. Therefore always voluntarily stop reading when
the specified file size has been received, if not using a chunked
transfer encoding. (For chunked transfers, we already return 0
as soon as we get the chunk header indicating end of stream.)

Signed-off-by: Martin Storsjö <martin@martin.st>
2014-08-13 14:34:25 +03:00
Nidhi Makhijani 8dca0877e3 mpegts: Return proper error code on invalid input data
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2014-08-10 07:24:30 -07:00
Luca Barbato 8c6f430291 mpeg: Suppress a compiler warning on callback type 2014-08-09 21:39:36 +02:00
Anton Khirnov 24c788f487 Remove obsolete FF_API_REFERENCE_DTS cruft. 2014-08-09 16:59:26 +00:00
Anton Khirnov 24e87f7f42 Remove obsolete FF_API_PROBE_MIME cruft. 2014-08-09 16:59:21 +00:00
Anton Khirnov 1985c2e75c Bump major versions of all libraries. 2014-08-09 16:58:33 +00:00
Anton Khirnov f4c444e17d Postpone API-incompatible changes until the next bump. 2014-08-09 16:57:10 +00:00
Luca Barbato e4c9e59a45 mpeg: K&R formatting cosmetics
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2014-08-08 05:22:09 -07:00
Diego Biurrun 454697603e mpegts: Use av_free() to free memory allocated by av_strdup() 2014-08-08 03:12:57 -07:00
Diego Biurrun 5b220e1e19 mpegts: Fix memory leaks and related crashes in mpegs_write_header() 2014-08-07 07:52:17 -07:00
Diego Biurrun f8ab9f2fe3 mpegts: Avoid unnecessary variable shadowing 2014-08-07 07:52:17 -07:00
Diego Biurrun 6d6bd3a3db mpegts: Drop some unnecessary parentheses 2014-08-07 07:52:17 -07:00
Diego Biurrun b7b1bf9166 mpegts: K&R formatting cosmetics 2014-08-07 07:48:54 -07:00
John Stebbins b50173a4dd movenc: fix QT chapter track character encoding
An encoding ("encd") box is required to tell QT that the string is UTF8
2014-08-06 13:27:17 -07:00
John Stebbins da9cc22d5b movenc: add track title to tracks 2014-08-06 13:27:17 -07:00
John Stebbins d9432789bd movenc: remove pointless loop around BITEXACT test 2014-08-06 13:27:17 -07:00
John Stebbins 0897d2fdc7 movenc: Add option to disable nero chapters
And add flag to muxer documentation.
Nero chapters break some taggers (mp3tag and iTunes).

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2014-08-05 11:36:08 +02:00
Femi Adeyemi-Ejeye 2601a9447e mpegts: Add HEVC definitions
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2014-08-05 11:30:50 +02:00
Luca Barbato 89616408e3 mpegts: Define the section length with a constant
The specification says the value is expressed in 10 bits including
the 4-byte CRC.
2014-08-04 22:22:54 +02:00
Marvin Scholz eb9244f202 Add Icecast protocol
Icecast is basically a convenience wrapper around the HTTP protocol.

Signed-off-by: Martin Storsjö <martin@martin.st>
2014-08-04 12:56:42 +03:00
Luca Barbato 6a463e7fb4 http: Refactor http_open_cnx
Split return value handling from the actual opening.

Incidentally fixes the https -> http redirect issue reported by
Compn on behalf of rcombs.

CC: libav-stable@libav.org
2014-08-03 23:13:27 +02:00
Luca Barbato fa14804c83 flv: Index the audio stream
And leverage the video index if the video is just disabled as wm4
did in an initial patch.
2014-08-01 15:04:51 +02:00
Luca Barbato fa38573cd9 matroska: Register mime types 2014-07-29 17:47:32 +02:00
Luca Barbato 02cf0c9e42 aac: Register the mime type
Speed up probing ADTS live streams that are not frame-aligned such
as http://mp3.streampower.be/radio1.aac .
2014-07-29 17:47:32 +02:00
Luca Barbato 3a19405d57 avformat: Use the mime type information in input probe
It should provide a quicker guess for elementary streams provided
by http.
2014-07-29 17:47:26 +02:00
Luca Barbato 69e7336b8e avstring: Expose the simple name match function
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2014-07-29 17:46:29 +02:00
Luca Barbato e253a9e2b3 avformat: Move av_probe_input* to format.c 2014-07-29 15:18:51 +02:00
Diego Biurrun 942269fd00 caf: Use correct printf conversion specifiers for POSIX int types 2014-07-28 13:19:05 -07:00
Diego Biurrun 59ca29a560 dump: Use correct printf conversion specifiers for POSIX int types 2014-07-28 13:19:04 -07:00
Marc-Antoine Arnaud 259fe7280d mxf: Extract origin information from material and source track
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2014-07-28 22:17:42 +02:00
Marc-Antoine Arnaud c9d982aa11 mxf: Detect Vanc/Vbi SMPTE-436M mxf track
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2014-07-28 22:17:42 +02:00
Diego Biurrun 7215fcf840 avformat: Mark AVOutputFormat argument in avformat_query_codec as const 2014-07-26 14:51:16 -07:00
Diego Biurrun ec4f04da1a avformat: Mark argument in av_{i|o}format_next/ffurl_protocol_next as const 2014-07-26 14:51:16 -07:00
Diego Biurrun ce2e858f5b http: K&R formatting cosmetics
Also comment some #endifs and reshuffle headers into canonical order.
2014-07-23 13:57:24 -07:00