- 09 May, 2020 1 commit
-
-
Andreas Rheinhardt authored
When the Ogg muxer writes a page, it has to do three things: It needs to write a page header, then it has to actually copy the page data and then it has to calculate and write a CRC checksum of both header as well as data at a certain position in the page header. To do this, the muxer used a dynamic buffer for both writing as well as calculating the checksum via an AVIOContext's feature to automatically calculate checksums on the data it writes. This entails an allocation of an AVIOContext, of the opaque specific to dynamic buffers and of the buffer itself (which may be reallocated multiple times) as well as memcopying the data (first into the AVIOContext's small write buffer, then into the dynamic buffer's big buffer). This commit changes this: The page header is no longer written into a dynamic buffer any more; instead the (small) page header is written into a small buffer on the stack. The CRC is then calculated directly via av_crc() on both the page header as well as the page data. Then both the page header and the page data are written. Finally, ogg_write_page() can now no longer fail, so it has been modified to return nothing; this also fixed a bug in the only caller of this function: It didn't check the return value. Signed-off-by:
Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
-
- 03 May, 2020 2 commits
-
-
Andreas Rheinhardt authored
Up until now ff_vorbiscomment_write() used the bytestream API to write VorbisComments. Therefore the caller had to provide a sufficiently large buffer to write the output. Yet two of the three callers (namely the FLAC and the Matroska muxer) actually want the output to be written via an AVIOContext; therefore they allocated buffers of the right size just for this purpose (i.e. they get freed immediately afterwards). Only the Ogg muxer actually wants a buffer. But given that it is easy to wrap a buffer into an AVIOContext this commit changes ff_vorbiscomment_write() to use an AVIOContext for its output. Signed-off-by:
Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
-
Andreas Rheinhardt authored
ff_vorbiscomment_write() used an AVDictionary ** parameter for a dictionary whose contents ought to be written; yet this can be replaced by AVDictionary * since commit 042ca05f; and this in turn can be replaced by const AVDictionary * to indicate that the dictionary isn't modified; the latter also applies to ff_vorbiscomment_length(). Signed-off-by:
Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
-
- 20 Apr, 2020 1 commit
-
-
Andreas Rheinhardt authored
For FLAC, Speex, Opus and VP8 the Ogg muxer allocates two buffers for building the headers: The first for extradata in an Ogg-specific format and the second contains a Vorbiscomment. These buffers are reachable via pointers in the corresponding AVStream's priv_data. If an error happens during building the headers, the AVStream's priv_data would be freed. This is pointless in general as it would be freed generically anyway, but here it is actively harmful: If the second of the aforementioned allocations fails, the first buffer would leak upon freeing priv_data. This commit stops freeing priv_data manually, which allows the muxer to properly clean up in the deinit function. Signed-off-by:
Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
-
- 07 Jan, 2020 2 commits
-
-
Marton Balint authored
Converting explicit avio_flush() calls helps us to buffer more data and avoid flushing the IO context too often which causes reduced IO throughput for non-streamed file output. The user can control FLUSH_POINT flushing behaviour using the -flush_packets option, the default typically means to flush unless a non-streamed file output is used, so this change should have no adverse effect on streaming even if it is assumed that after an avio_flush() the output buffer is clean so small seekbacks within the output buffer will work even when the IO context is not seekable. Signed-off-by:
Marton Balint <cus@passwd.hu>
-
Marton Balint authored
avio_close_dyn_buf() also does avio_flush(). Signed-off-by:
Marton Balint <cus@passwd.hu>
-
- 21 Oct, 2019 1 commit
-
-
James Almer authored
If the trailer is never writen, there could be buffered pages that would leak. Reviewed-by:
Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by:
James Almer <jamrial@gmail.com>
-
- 18 Dec, 2018 1 commit
-
-
Paul B Mahol authored
Fixes #7532.
-
- 22 Jun, 2017 1 commit
-
-
James Almer authored
Fixes a NULL pointer derefence when ogg_init() returns a failure and a stream's private data was not yet allocated. This is a regression since 3c5a53cdReviewed-by:
Paul B Mahol <onemda@gmail.com> Signed-off-by:
James Almer <jamrial@gmail.com>
-
- 19 Jun, 2017 1 commit
-
-
James Almer authored
Reviewed-by:
Michael Niedermayer <michael@niedermayer.cc> Signed-off-by:
James Almer <jamrial@gmail.com>
-
- 21 Jul, 2016 2 commits
-
-
James Almer authored
Addresses ticket #5687 Signed-off-by:
James Almer <jamrial@gmail.com>
-
James Almer authored
Signed-off-by:
James Almer <jamrial@gmail.com>
-
- 20 Jul, 2016 1 commit
-
-
James Almer authored
Reviewed-by:
Michael Niedermayer <michael@niedermayer.cc> Signed-off-by:
James Almer <jamrial@gmail.com>
-
- 12 Jul, 2016 1 commit
-
-
James Almer authored
Fixes ticket #5704 Reviewed-by:
Michael Niedermayer <michael@niedermayer.cc> Signed-off-by:
James Almer <jamrial@gmail.com>
-
- 11 Jul, 2016 1 commit
-
-
James Almer authored
This allows simpler selection of flac in ogg from the command line, while following the RFC 5334 recommendation[1] for the oga extension. [1] https://tools.ietf.org/html/rfc5334#section-10.3Reviewed-by:
Michael Niedermayer <michael@niedermayer.cc> Signed-off-by:
James Almer <jamrial@gmail.com>
-
- 23 Feb, 2016 1 commit
-
-
Anton Khirnov authored
Currently, AVStream contains an embedded AVCodecContext instance, which is used by demuxers to export stream parameters to the caller and by muxers to receive stream parameters from the caller. It is also used internally as the codec context that is passed to parsers. In addition, it is also widely used by the callers as the decoding (when demuxer) or encoding (when muxing) context, though this has been officially discouraged since Libav 11. There are multiple important problems with this approach: - the fields in AVCodecContext are in general one of * stream parameters * codec options * codec state However, it's not clear which ones are which. It is consequently unclear which fields are a demuxer allowed to set or a muxer allowed to read. This leads to erratic behaviour depending on whether decoding or encoding is being performed or not (and whether it uses the AVStream embedded codec context). - various synchronization issues arising from the fact that the same context is used by several different APIs (muxers/demuxers, parsers, bitstream filters and encoders/decoders) simultaneously, with there being no clear rules for who can modify what and the different processes being typically delayed with respect to each other. - avformat_find_stream_info() making it necessary to support opening and closing a single codec context multiple times, thus complicating the semantics of freeing various allocated objects in the codec context. Those problems are resolved by replacing the AVStream embedded codec context with a newly added AVCodecParameters instance, which stores only the stream parameters exported by the demuxers or read by the muxers.
-
- 27 Aug, 2015 1 commit
-
-
Michael Niedermayer authored
Fixes infinite loop and segfault in ogg_buffer_data() Fixes Ticket4806 Signed-off-by:
Michael Niedermayer <michael@niedermayer.cc>
-
- 09 Jun, 2015 1 commit
-
-
Michael Niedermayer authored
Signed-off-by:
Michael Niedermayer <michaelni@gmx.at>
-
- 11 May, 2015 1 commit
-
-
Michael Niedermayer authored
Signed-off-by:
Michael Niedermayer <michaelni@gmx.at>
-
- 15 Feb, 2015 1 commit
-
-
Federico Tomassetti authored
Bug-Id: CID 1257795 CC: libav-stable@libav.org Signed-off-by:
Luca Barbato <lu_zero@gentoo.org>
-
- 14 Feb, 2015 1 commit
-
-
Diego Biurrun authored
-
- 01 Feb, 2015 2 commits
-
-
Michael Niedermayer authored
Signed-off-by:
Michael Niedermayer <michaelni@gmx.at>
-
Luca Barbato authored
The ogg serial number doubles as codec id and sequence value for concatenated samples.
-
- 14 Dec, 2014 1 commit
-
-
Michael Niedermayer authored
Reviewed-by:
Reimar Döffinger <Reimar.Doeffinger@gmx.de> Signed-off-by:
Michael Niedermayer <michaelni@gmx.at>
-
- 03 Dec, 2014 1 commit
-
-
Lukasz Marek authored
Signed-off-by:
Lukasz Marek <lukasz.m.luki2@gmail.com>
-
- 06 Nov, 2014 1 commit
-
-
Anton Khirnov authored
The reasoning is the same as for 0097cbea.
-
- 29 Oct, 2014 1 commit
-
-
Michael Niedermayer authored
The code would have segfaulted before if oggstream were NULL. CC: libav-stable@libav.org Bug-Id: CID 732218
-
- 13 Oct, 2014 1 commit
-
-
Anton Khirnov authored
-
- 23 Aug, 2014 1 commit
-
-
Luca Barbato authored
Unbreak 051aadee
-
- 22 Aug, 2014 1 commit
-
-
Luca Barbato authored
Since they are aliases for ogg enabling any of them enables ogg as well.
-
- 18 Jun, 2014 1 commit
-
-
Anton Khirnov authored
Previously, AVStream.codec.time_base was used for that purpose, which was quite confusing for the callers. This change also opens the path for removing AVStream.codec. The change in the lavf-mkv test is due to the native timebase (1/1000) being used instead of the default one (1/90000), so the packets are now sent to the crc muxer in the same order in which they are demuxed (previously some of them got reordered because of inexact timestamp conversion).
-
- 06 Jun, 2014 1 commit
-
-
Martin Storsjö authored
On big endian machines, the default value set via the faulty AVOption ended up as 2^32 times too big. This fixes the fate-lavf-ogg test which currently is broken on big endian machines, broken since 38313626. Since that commit, a final zero-sized packet is written to the ogg muxer in that test, which caused different flushing behaviour on little and big endian depending on whether the pref_duration option was handled as it should or not. CC: libav-stable@libav.org Signed-off-by:
Martin Storsjö <martin@martin.st>
-
- 04 Jun, 2014 1 commit
-
-
Martin Storsjö authored
This allows the caller to write all buffered data to disk, allowing the caller to know at what byte position in the file a certain packet starts (any packet written after the flush will be located after that byte position). Signed-off-by:
Martin Storsjö <martin@martin.st>
-
- 28 May, 2014 2 commits
-
-
Michael Niedermayer authored
This corrects the bug that caused the checksums to change in 9767d7c0. It caused the EOS flag to be set incorrectly; the ogg spec does not allow it to be set in the middle of a logical bitstream. Signed-off-by:
Andrew Kelley <superjoe30@gmail.com> Signed-off-by:
Martin Storsjö <martin@martin.st>
-
Anton Khirnov authored
-
- 27 May, 2014 3 commits
-
-
Michael Niedermayer authored
This corrects the bug that caused the checksums to change in 9767d7c0Signed-off-by:
Michael Niedermayer <michaelni@gmx.at>
-
Andrew Kelley authored
Before, header information for ogg format files was sent with the first encoded packet. This patch makes it so that it is possible for API users to differentiate between headers and encoded audio. This is useful, for example, when creating an audio stream where you want to send one set of headers for every client that connects and then the encoded stream of audio. Signed-off-by:
Martin Storsjö <martin@martin.st>
-
Andrew Kelley authored
Signed-off-by:
Martin Storsjö <martin@martin.st>
-
- 15 May, 2014 1 commit
-
-
Anton Khirnov authored
Use it instead of checking CODEC_FLAG_BITEXACT in the first stream's codec context. Using codec options inside lavf is fragile and can easily break when the muxing codec context is not the encoding context.
-
- 04 Apr, 2014 1 commit
-
-
James Almer authored
Signed-off-by:
James Almer <jamrial@gmail.com> Signed-off-by:
Michael Niedermayer <michaelni@gmx.at>
-