summaryrefslogtreecommitdiff
path: root/libavformat
Commit message (Collapse)AuthorAge
* apetag: account for header size if present when returning the start positionJames Almer2017-02-25
| | | | | | | | | | | | The size field in the header/footer accounts for the entire APE tag structure except the 32 bytes from header, for compatibility with APEv1. Signed-off-by: James Almer <jamrial@gmail.com> CC: libav-stable@libav.org Signed-off-by: Anton Khirnov <anton@khirnov.net>
* apetag: fix flag value to signal footer presenceJames Almer2017-02-25
| | | | | | | | | | | | | | | | | According to the spec[1], a value of 0 means the footer is present and a value of 1 means it's absent, the exact opposite of header presence flag where 1 means present and 0 absent. The reason for this is compatibility with APEv1 tags, where there's no header, footer presence was mandatory for all files, and the flags field was a zeroed reserved field. [1] http://wiki.hydrogenaud.io/index.php?title=Ape_Tags_Flags Signed-off-by: James Almer <jamrial@gmail.com> CC: libav-stable@libav.org Signed-off-by: Anton Khirnov <anton@khirnov.net>
* asfdec: fix reading files larger than 2GBJohn Stebbins2017-02-24
| | | | avio_skip returns file position and overflows int
* matroskaenc: factor ts_offset into block timecode computationJohn Stebbins2017-02-21
| | | | | | | | | | | | | | | ts_offset was added to cluster timecode, but then effectively subtracted back off the block timecode When setting initial_padding for an audio stream, the timestamps are written incorrectly to the mkv file. cluster timecode gets written as pts0 + ts_offset which is correct, but then block timecode gets written as pts - cluster timecode which expanded is pts - (pts0 + ts_offset). Adding cluster and block tc back together: cluster + block = (pts0 + ts_offset) + (pts - (pts0 + ts_offset)) = pts But the result should be pts + ts_offset since demux will subtract the CodecDelay element from pts and set initial_padding to CodecDelay. This patch gives the correct result.
* dv: Don't return EIO upon EOFJohn Stebbins2017-02-19
|
* asfdec: Account for different Format Data sizesAlexandra Hájková2017-02-15
| | | | | | | | | | Some muxers may use the BMP_HEADER Format Data size instead of the ASF-specific one. Bug-Id: 1020 CC: libav-stable@libav.org Signed-off-by: Diego Biurrun <diego@biurrun.de>
* mov: Do not try to parse multiple stsd for the same trackLuca Barbato2017-02-15
| | | | | | | Bug-Id: 1017 CC: libav-stable@libav.org Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
* Use the new AVIOContext destructor.Anton Khirnov2017-02-11
|
* avio: add a destructor for AVIOContextAnton Khirnov2017-02-11
| | | | | Before this commit, AVIOContext is to be freed with a plain av_free(), which prevents us from adding any deeper structure to it.
* mov: Rework stsc index validationVittorio Giovara2017-02-10
| | | | | In order to avoid potential integer overflow change the comparison and make sure to use the same unsigned type for both elements.
* hlsenc: Correctly write down all 16 bytes in hexLuca Barbato2017-02-10
| | | | Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
* Use bitstream_init8() where appropriateDiego Biurrun2017-02-07
|
* asfdec: Use the ASF stream count when iteratingJohn Stebbins2017-02-04
| | | | | | | | | The AVFormat stream count can be larger due external factors, such as an id3 tag appended. Avoid an out of bound read. Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
* rtmp: Correctly handle the Window Acknowledgement Size packetsMartin Storsjö2017-02-03
| | | | | | | | | | | | | | | | | | | | | | | | | | | This swaps which field is set when the Window Acknowledgement Size and Set Peer BW packets are received, renames the fields in order to clarify their role further and adds verbose comments explaining their respective roles and how well the code currently does what it is supposed to. The Set Peer BW packet tells the receiver of the packet (which can be either client or server) that it should not send more data if it already has sent more data than the specified number of bytes, without receiving acknowledgement for them. Actually checking this limit is currently not implemented. In order to be able to check that properly, one can send the Window Acknowledgement Size packet, which tells the receiver of the packet that it needs to send Acknowledgement packets (RTMP_PT_BYTES_READ) at least after receiving a given number of bytes since the last Acknowledgement. Therefore, when we receive a Window Acknowledgement Size packet, this sets the maximum number of bytes we can receive without sending an Acknowledgement; therefore when handling this packet we should set the receive_report_size field (previously client_report_size). Signed-off-by: Martin Storsjö <martin@martin.st>
* rtmp: Rename packet types to closer match the specMartin Storsjö2017-02-03
| | | | | | | | | | | | | | | | | | | | | | Also rename comments and log messages accordingly, and add clarifying comments for some hardcoded values. The previous names were taken from older, reverse engineered references. These names match the official public rtmp specification, and matches the names used by wirecast in annotating captured streams. These names also avoid hardcoding the roles of server and client, since the handling of them is irrelevant of whether we act as server or client. The RTMP_PT_PING type maps to RTMP_PT_USER_CONTROL. The SERVER_BW and CLIENT_BW types are a bit more intertwined; RTMP_PT_SERVER_BW maps to RTMP_PT_WINDOW_ACK_SIZE and RTMP_PT_CLIENT_BW maps to RTMP_PT_SET_PEER_BW. Signed-off-by: Martin Storsjö <martin@martin.st>
* Mark some arrays that never change as const.Anton Khirnov2017-02-01
|
* h261dec: Convert to the new bitstream readerAlexandra Hájková2017-01-31
|
* golomb: Convert to the new bitstream readerDiego Biurrun2017-01-31
|
* mov: Avoid memcmp of uninitialised dataMark Thompson2017-01-30
| | | | | | | | | The string codec name need not be as long as the value we are comparing it to, so memcmp may make decisions derived from uninitialised data that valgrind then complains about (though the overall result of the function will always be the same). Use strncmp instead, which will stop at the first zero byte and therefore not encounter this issue.
* dashenc: add webm supportPeter Große2017-01-31
| | | | | | | Use webm muxer for VP8, VP9 and Opus codec, mp4 muxer otherwise. Signed-off-by: Peter Große <pegro@friiks.de> Signed-off-by: Martin Storsjö <martin@martin.st>
* dashenc: use avio_dynbuf instead of packet_write callbackPeter Große2017-01-31
| | | | | | | | | | | | | | | The dash_write function drops data, if no IOContext is initialized. Since the mp4 muxer is used in "frag_custom" mode, data is only written when calling av_write_frame(NULL) explicitly and thus there will be no data loss. To add support for webm as subordinate muxer, which doesn't have such a mode, a dynamic buffer is required to provide an always initialized IOContext. Signed-off-by: Peter Große <pegro@friiks.de> Signed-off-by: Martin Storsjö <martin@martin.st>
* dashenc: copy language and role metadata from streams assigned to setsPeter Große2017-01-31
| | | | | Signed-off-by: Peter Große <pegro@friiks.de> Signed-off-by: Martin Storsjö <martin@martin.st>
* dashenc: default to one AdaptationSet per streamPeter Große2017-01-31
| | | | | | | | | | | | | | | | Previously all mapped streams of a media type (video, audio) where assigned to a single AdaptationSet. Using the DASH live profile it is mandatory, that the segments of all representations are aligned, which is currently not enforced. This leads to problems when using video streams with different key frame intervals. So to play safe, default to one AdaptationSet per stream, unless overwritten by explicit assignment. To get the old assignment scheme, use -adaptation_sets "id=0,streams=v id=1,streams=a" Signed-off-by: Peter Große <pegro@friiks.de> Signed-off-by: Martin Storsjö <martin@martin.st>
* dashenc: allow assigning all streams of a media type to an AdaptationSetPeter Große2017-01-31
| | | | | | | | | Using the characters "v" or "a" instead of stream index numbers for assigning streams in the adaption_set option, all streams matching that given type will be added to the AdaptationSet. Signed-off-by: Peter Große <pegro@friiks.de> Signed-off-by: Martin Storsjö <martin@martin.st>
* dashenc: add support for assigning streams to AdaptationSetsPeter Große2017-01-31
| | | | | | | | | Also makes sure all streams are assigned to exactly one AdaptationSet. This patch is originally based partially on code by Vignesh Venkatasubramanian. Signed-off-by: Peter Große <pegro@friiks.de> Signed-off-by: Martin Storsjö <martin@martin.st>
* dashenc: calculate stream bitrate from first segment if not availablePeter Große2017-01-31
| | | | | | | | | Bandwidth information is required in the manifest, but not always provided by the demuxer. In that case calculate the bandwith based on the size and duration of the first segment. Signed-off-by: Peter Große <pegro@friiks.de> Signed-off-by: Martin Storsjö <martin@martin.st>
* dashenc: separate segments based on current segment durationPeter Große2017-01-31
| | | | | | | | | | | | | | | | | | | | | | | | | The current implementation creates new segments comparing pkt->pts - first_pts > nb_segs * min_seg_duration This works fine, but if the keyframe interval is smaller than "min_seg_duration" segments shorter than the minimum segment duration are created. Example: keyint=50, min_seg_duration=3000000 segment 1 contains keyframe 1 (duration=2s < total_duration=3s) and keyframe 2 (duration=4s >= total_duration=3s) segment 2 contains keyframe 3 (duration=6s >= total_duration=6s) segment 3 contains keyframe 4 (duration=8s < total_duration=9s) and keyframe 5 (duration=10s >= total_duration=9s) ... Segment 2 is only 2s long, shorter than min_seg_duration = 3s. To fix this, new segments are created based on the actual written duration. Otherwise the option name "min_seg_duration" is misleading. Signed-off-by: Peter Große <pegro@friiks.de> Signed-off-by: Martin Storsjö <martin@martin.st>
* dashenc: add option to provide UTC timing sourcePeter Große2017-01-31
| | | | | | | | | | | | | | | | | If set, adds a UTCTiming tag in the manifest. This is part of the recommendations listed in the "Guidelines for Implementations: DASH-IF Interoperability Points" [1][2] Section 4.7 describes means for the Availability Time Synchronization. A usable default is "https://time.akamai.com/?iso" [1] http://dashif.org/guidelines/ [2] http://dashif.org/wp-content/uploads/2016/12/DASH-IF-IOP-v4.0-clean.pdf (current version as of writing) Signed-off-by: Peter Große <pegro@friiks.de> Signed-off-by: Martin Storsjö <martin@martin.st>
* rtmp: Account for bytes_read wraparoundLuca Barbato2017-01-29
| | | | | | | Servers seem to be happy to receive the wrapped-around value as long as they receive a report, otherwise they timeout. Initially reported and analyzed by Thomas Bernhard.
* dashenc: increase buffer time hint in the manifestAnton Schubert2017-01-27
| | | | | | | to avoid rebuffering on the clientside for difficult network conditions. Signed-off-by: Anton Schubert <ischluff@mailbox.org> Signed-off-by: Martin Storsjö <martin@martin.st>
* dashenc: add mandatory id to AdaptationSet and Period in manifestPeter Große2017-01-27
| | | | | Signed-off-by: Peter Große <pegro@friiks.de> Signed-off-by: Martin Storsjö <martin@martin.st>
* dashenc: fix ISO8601 UTC parsingAnton Schubert2017-01-27
| | | | | | | | | Appends Z to timestamp to force ISO8601 datetime parsing as UTC. Without Z, some browsers (Chrome) interpret the timestamp as localtime and others (Firefox) interpret it as UTC. Signed-off-by: Anton Schubert <ischluff@mailbox.org> Signed-off-by: Martin Storsjö <martin@martin.st>
* tak: Convert to the new bitstream readerAlexandra Hájková2017-01-25
|
* mpc: Convert to the new bitstream readerAlexandra Hájková2017-01-25
|
* rtp: Convert to the new bitstream readerAlexandra Hájková2017-01-13
|
* mov: Convert to the new bitstream readerAlexandra Hájková2017-01-13
|
* matroskadec: make sure not to leave EbmlBin in an inconsistent stateAnton Khirnov2017-01-04
| | | | | | | | | | If a read fails, the current code will free the data but leave the size non-zero. Make sure the size is zeroed in such a case. CC: libav-stable@libav.org Bug-Id: 1001 Found-By: Kamil Frankowicz Signed-off-by: Sean McGovern <gseanmcg@gmail.com>
* matroskadec: fix SRT subtitle durationJohn Stebbins2016-12-24
| | | | The codec id for SRT was changed and conditionals were not updated.
* http: Check for negative chunk sizesMartin Storsjö2016-12-23
| | | | | | | | | | | A negative chunk size is illegal and would end up used as length for memcpy, where it would lead to memory accesses out of bounds. Found-by: Paul Cher <paulcher@icloud.com> CC: libav-stable@libav.org Signed-off-by: Martin Storsjö <martin@martin.st>
* Use correct printf conversion specifiers for POSIX integer typesDiego Biurrun2016-12-23
|
* build: Generate pkg-config files from Make and not from configureDiego Biurrun2016-12-22
| | | | | | | | This moves work from the configure to the Make stage where it can be parallelized and ensures that pkgconfig files are updated when library versions change. Bug-Id: 449
* unary: Convert to the new bitstream readerAlexandra Hájková2016-12-19
|
* mov: fix a possible invalid read in mov_read_mac_string()Anton Khirnov2016-12-19
| | | | | | | | | | When the input string is too large, so the second condition in if () fails, the code will erroneously execute the else branch, indexing the mac_to_unicode table with a negative index. CC: libav-stable@libav.org Bug-Id: 1000 Found-By: Kamil Frankowicz
* rtmppkt: Check for packet size mismatchesMichael Niedermayer2016-12-15
| | | | | | | | | | | | | | | | | | | When receiving fragmented packets, the first packet declares the size, and the later ones normally are small follow-on packets that don't repeat the size and the other header fields. But technically, the later fragments also can have a full header, declaring a different size than the previous packet. If the follow-on packet declares a larger size than the initial one, we could end up writing outside of the allocation. This fixes out of bounds writes. Found-by: Paul Cher <paulcher@icloud.com> Reviewed-by: Paul Cher <paulcher@icloud.com> CC: libav-stable@libav.org Signed-off-by: Martin Storsjö <martin@martin.st>
* libavformat: Fix a faulty api deprecation guard in prepare_input_packetMartin Storsjö2016-12-15
| | | | | | | | | | | This seems to have been added by mistake in 11de006b, by not noticing the negation for the existing condition. This block does not contain any code that accesses the codec field in AVStream. This function is meant to serve as a complement to compute_pkt_fields2, which is guarded by FF_API_COMPUTE_PKT_FIELDS2 && FF_API_LAVF_AVCTX. Signed-off-by: Martin Storsjö <martin@martin.st>
* avio: Keep track of the amount of data writtenLuca Barbato2016-12-08
| | | | Make avio_size() work with any write AVIOContext.
* Add missing #includes for standalone spherical-information-related headersDiego Biurrun2016-12-08
|
* mov: Export spherical informationVittorio Giovara2016-12-07
| | | | | | | This implements Spherical Video V1 and V2, as described in the spatial-media collection by Google. Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
* lavc: Add spherical packet side data APIVittorio Giovara2016-12-07
| | | | Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
* build: Separate avisynth and avxsynth supportDiego Biurrun2016-12-06
| | | | This simplifies the code.