aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat
Commit message (Collapse)AuthorAgeFilesLines
* avformat/utils: estimate_timings_from_pts - increase retry counter, fixes ↵Rainer Hochecker2015-11-151-1/+1
| | | | | | | | | invalid duration for ts files with hevc codec Fixes a mpegts file with hevc that fails estimating duration. Increasing number of retries fixes the issue. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat: implement SChannel SSP TLS protocolHendrik Leppkes2015-11-144-1/+603
| | | | | | | | | | | | This implementation does not support TLS listen sockets and loading CA/Certs from files. The Windows API does not support loading PEM certs, and would either require a manual loader or instead be limited to loading Windows PFX certificates TLS listen sockets would have to be implemented quite separately, as many of the APIs are different for server-mode (as opposed to client mode).
* avformat/async: Fix bug where async could not recover after seek to eofBryan Huh2015-11-131-5/+2
| | | | | | | | | | | | | | | | | | | | | | | When async issues its inner seek via ffurl_seek, it treats failures as EOF being reached. This is not consistent with the behavior of other protocols (e.g. http, cache) which continue to tolerate reads after failed seeks, and therefore does not interact correctly with them. A common pattern where this manifests itself is where avio_seek is called with pos to be the end-of-file - the http range-request would fail here, and async would set io_eof_reached to 1. The background thread would then refuse to read more bytes, and subsequent reads would only empty the fifo and end in an error. Presumably the code may have expected subsequent seeks to unset the io_eof_reached but this is not guaranteed to be true - a subsequent seek that lands in the AVIOContext's buffer (the fact that the previously-failed avio_seek leaves the AVIOContext's buffer intact also suggests that follow-up reads are expected to be tolerated) would not be issued to the async_seek function, and when that buffer is drained only async_read calls would follow, leading to the same error just described. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/segafilm: Fix current_sample after seeking and avio_seek return typeMichael Niedermayer2015-11-121-3/+4
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat/mux: Rename compute_pkt_fields2(), the name is absolutely terribleMichael Niedermayer2015-11-121-4/+4
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* Merge commit '8ad5124b7ecf7f727724e270a7b4bb8c7bcbf6a4'Hendrik Leppkes2015-11-111-0/+1
|\ | | | | | | | | | | | | * commit '8ad5124b7ecf7f727724e270a7b4bb8c7bcbf6a4': movenc: Automatically flush after writing the initial moov Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
| * movenc: Automatically flush after writing the initial moovMartin Storsjö2015-11-101-0/+1
| | | | | | | | | | | | | | | | 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>
* | Merge commit '8de1ee9f725aa3c550f425bd3120bcd95d5b2ea8'Hendrik Leppkes2015-11-115-2/+108
|\| | | | | | | | | | | | | * commit '8de1ee9f725aa3c550f425bd3120bcd95d5b2ea8': lavf: deprecate compute_pkt_fields2 Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
| * lavf: deprecate compute_pkt_fields2Anton Khirnov2015-11-095-2/+108
| | | | | | | | | | | | | | | | | | All encoders set pts and dts properly now (and have been doing that for a while), so there is no good reason to do any timestamp guessing in the muxer. The newly added AVStreamInternal will be later used for storing all the private fields currently living in AVStream.
* | avformat/utils: re-factor freeing AVStreamsHendrik Leppkes2015-11-111-7/+19
| | | | | | | | This matches the Libav signature and simplifies merging future changes.
* | avformat/rsd: XMA2 is actually stored, not XMA1Paul B Mahol2015-11-111-6/+6
| | | | | | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>
* | avformat/mov: Add option to ignore chapters during parsingBryan Huh2015-11-102-1/+7
| | | | | | | | | | | | | | | | | | | | Chapter-indexing can be expensive since chapters may be interspersed throughout the entire file and may require many seeks - especially costly when consuming a video over a remote protocol like http. Furthermore it is often unnecessary, especially when only trying to get video info (e.g. via ffprobe). Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avformat/mxfenc: Only store user comment related tags when neededMichael Niedermayer2015-11-101-13/+34
| | | | | | | | | | | | | | | | | | | | Also support disabling them as they seem to cause problems to some Users. They are also not allowed in IRT D-10 thus the default for mxf_d10 is not to write them This also decreases the filesize when no user comment are stored Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | brstm: reject negative sample rateAndreas Cadhalpun2015-11-101-1/+1
| | | | | | | | | | | | | | A negative sample rate causes assertion failures in av_rescale_rnd. Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
* | avformat/wavdec: allow data chunk to be before fmt/xma2 chunkPaul B Mahol2015-11-101-1/+6
| | | | | | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>
* | avformat/wavdec: parse XMA2 tagPaul B Mahol2015-11-101-3/+55
| | | | | | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>
* | Merge commit 'aeda1121c91395d1f0d434bc7f227423aa2ff97d'Hendrik Leppkes2015-11-101-5/+6
|\| | | | | | | | | | | | | * commit 'aeda1121c91395d1f0d434bc7f227423aa2ff97d': lavf: factor out freeing an AVStream Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
| * lavf: factor out freeing an AVStreamAnton Khirnov2015-11-081-25/+33
| | | | | | | | It will be needed in other functions.
* | Merge commit 'a0c71a575109f123978e345fa7eb4ac03cd4d3c3'Hendrik Leppkes2015-11-101-5/+7
|\| | | | | | | | | | | | | * commit 'a0c71a575109f123978e345fa7eb4ac03cd4d3c3': lavf: initialize cur_dts to AV_NOPTS_VALUE for muxing Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
| * lavf: initialize cur_dts to AV_NOPTS_VALUE for muxingAnton Khirnov2015-11-081-5/+7
| | | | | | | | The reasoning for setting it to zero only applies to demuxing.
* | Merge commit '563e6d860391bac0511984e5c0842320b5c94d2d'Hendrik Leppkes2015-11-101-2/+1
|\| | | | | | | | | | | | | * commit '563e6d860391bac0511984e5c0842320b5c94d2d': segafilm: drop the "song and dance" for cinepak Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
| * segafilm: drop the "song and dance" for cinepakMichael Niedermayer2015-11-061-12/+3
| | | | | | | | | | | | | | | | | | | | This seems not to do anything any more since a long time, and removing it avoids using uninitialized memory. Also change the error value forwarding as done everywhere else. Partly fixes: msan_uninit-mem_7fb7d24780d0_2744_R03T.CAK Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
| * segafilm: set video and audio stream durationPaul B Mahol2015-11-061-1/+9
| | | | | | | | Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
* | Merge commit 'c012c6f1a8b34828a7870dc1854422934f14b79a'Hendrik Leppkes2015-11-101-6/+8
|\| | | | | | | | | | | | | * commit 'c012c6f1a8b34828a7870dc1854422934f14b79a': segafilm: implement seeking Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
| * segafilm: implement seekingPaul B Mahol2015-11-061-0/+23
| | | | | | | | Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
* | Merge commit 'f128b8e19ac7f702adae899ab91cc1e80f238761'Hendrik Leppkes2015-11-101-0/+8
|\| | | | | | | | | | | | | * commit 'f128b8e19ac7f702adae899ab91cc1e80f238761': mov: detect cover art pictures by content Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
| * mov: detect cover art pictures by contentwm42015-11-031-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | I've got some m4a samples that had jpeg cover art marked as png. Since these files were supposedly written by iTunes, and other software can read it (e.g. clementine does), this should be worked around. Since png has a very simple to detect header, while it's apparently a real pain to detect jpeg in the general case, try to detect png and assume jpeg otherwise. Not bothering with bmp, as I have no test case. Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
* | Merge commit '452d659aa4a742106c70ffe9ef3df47ef5b81ea6'Hendrik Leppkes2015-11-101-1/+1
|\| | | | | | | | | | | | | * commit '452d659aa4a742106c70ffe9ef3df47ef5b81ea6': msnwc_tcp: Use the correct return values Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
| * msnwc_tcp: Use the correct return valuesLuca Barbato2015-11-021-2/+2
| | | | | | | | Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
* | Merge commit 'f8d10511fef0bb3265f2d7bdfd38f90f60731d80'Hendrik Leppkes2015-11-101-22/+23
|\| | | | | | | | | | | | | * commit 'f8d10511fef0bb3265f2d7bdfd38f90f60731d80': cosmetics: msnwc_tcp: Reformat Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
| * cosmetics: msnwc_tcp: ReformatLuca Barbato2015-11-021-23/+24
| | | | | | | | Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
* | Merge commit '4dfbc7a7559ccab666a8fd39de4224eb4b02c768'Hendrik Leppkes2015-11-101-2/+6
|\| | | | | | | | | | | | | * commit '4dfbc7a7559ccab666a8fd39de4224eb4b02c768': msnwc_tcp: Correctly report failure Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
| * msnwc_tcp: Correctly report failureLuca Barbato2015-11-021-2/+6
| | | | | | | | | | | | | | | | And prevent a memory leak CC: libav-stable@libav.org Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
| * nut: Use the correct codec_tag when multiple are availableLuca Barbato2015-11-021-1/+2
| | | | | | | | | | | | | | | | | | | | Some codecs use the codec_tag to signal specific information and picking the first one would lead to a broken file. Bug-Id: 883 CC: libav-stable@libav.org Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
| * omadec: Fix position of opening parenthesisVittorio Giovara2015-10-301-2/+2
| |
* | avformat: Add v210[x] demuxerTimothy Gu2015-11-093-0/+137
| | | | | | | | | | | | | | | | | | | | | | | | Allows one to do: ffmpeg -s 1920x1080 -i blah.v210 ... ffmpeg -s 1920x1080 -f v210x -i blah.yuv10 ... Fixes #1869. Reviewed-by: James Almer <jamrial@gmail.com> Reviewed-by: Kieran Kunhya <kierank@obe.tv>
* | avformat/cache: Avoid int-overflow in cache compare functionBryan Huh2015-11-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | cache protocol indexes its cache using AVTreeNodes which require a cmp function for inserting and searching new cache-entries. This cmp function expects a 32-bit int return value (negative, zero, or positive) but the cache cmp function returns an int64_t which can overflow the int, giving negative numbers for when it should be positive, vice versa. This manifests itself only for very large files (e.g. 4GB+) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avformat/rsd: add XMA supportPaul B Mahol2015-11-091-2/+14
| | | | | | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>
* | avformat/segafilm: Only add index entries when the stream existsMichael Niedermayer2015-11-071-5/+6
| | | | | | | | | | | | | | | | Fixes null pointer dereference Fixes: cb02dfb163ac833c04cace3d7e35b160/signal_sigsegv_e55c49_6326_8f25619fc86a00b303c57b7778baf70a.cpk Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | jvdec: avoid unsigned overflow in comparisonAndreas Cadhalpun2015-11-071-1/+1
| | | | | | | | | | | | | | | | | | The return type of strlen is size_t, i.e. unsigned, so if pd->buf_size is 3, the right side overflows leading to a wrong result of the comparison and subsequently a heap buffer overflow. Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
* | XMA1 and XMA2 stereo decodersPaul B Mahol2015-11-062-5/+24
| | | | | | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>
* | mpegtsenc: Implement writing of Opus trim_start/trim_end control valuesSebastian Dröge2015-11-061-3/+40
| | | | | | | | | | | | Signed-off-by: Sebastian Dröge <sebastian@centricular.com> Reviewed-by: Kieran Kunhya <kierank@obe.tv> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | mpegtsenc: Add support for muxing Opus in MPEG-TSSebastian Dröge2015-11-061-1/+179
| | | | | | | | | | | | Signed-off-by: Sebastian Dröge <sebastian@centricular.com> Previous version reviewed-by: Kieran Kunhya <kierank@obe.tv> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avformat/xmv: Discard remainder of packet on errorMichael Niedermayer2015-11-061-1/+4
| | | | | | | | | | | | | | | | Fixes infinite loop Fixes: 9c48ae2680c5f23bca3d20ff0f325fd8/asan_generic_4c254d_1374_993f1e5967dd6f844b8d72f978ce2a6c.pss Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avformat/xmv: factor return check out of if/elseMichael Niedermayer2015-11-061-5/+3
| | | | | | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avformat/mpegts: Only start probing data streams within probe_packetsMichael Niedermayer2015-11-051-0/+1
| | | | | | | | | | | | | | | | Fixes assertion failure Fixes: 4321db8ac331f5967ebfbfe80ce5eb78/signal_sigabrt_7ffff6ae7cc9_7213_0d6457b9d6897fa7c78507fa5de53510.ts Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avformat/cache: Use int64_t to avoid int overflow in cache_readBryan Huh2015-11-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Fixes an issue where an int64_t ffurl_seek return-value was being stored in an int (32-bit) "r" variable, leading to integer overflow when seeking into a large file (>2GB), and ultimately a "Failed to perform internal seek" error mesage. To test, try running `ffprobe 'cache:http://<something>'` on a file that is ~3GB large, whose moov atom is at the end of the file Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | all: use FFDIFFSIGN to resolve possible undefined behavior in comparatorsGanesh Ajjanagadde2015-11-031-6/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | FFDIFFSIGN was created explicitly for this purpose, since the common return a - b idiom is unsafe regarding overflow on signed integers. It optimizes to branchless code on common compilers. FFDIFFSIGN also has the subjective benefit of being easier to read due to lack of ternary operators. Tested with FATE. Things not covered by this are unsigned integers, for which overflows are well defined, and also places where overflow is clearly impossible, e.g an instance where the a - b was being done on 24 bit values. Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Reviewed-by: Clément Bœsch <u@pkh.me> Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
* | avformat: add acm demuxerPaul B Mahol2015-11-034-1/+78
| | | | | | | | Signed-off-by: Paul B Mahol <onemda@gmail.com>
* | hlsenc: Only write PAT/PMT once per segmentDerek Buitenhuis2015-11-021-1/+9
| | | | | | | | | | | | | | This saves a lot of muxing overhead, especially on lower bitrate segments. Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>