History log of /haiku/src/add-ons/media/plugins/ape_reader/APEReader.cpp
Revision Date Author Comments
# 425ac1b6 20-Jun-2023 Alexander von Gluck IV <kallisti5@unixzen.com>

refactor: Swap %Ld for %lld in all format usages

* %Ld is an undocumented alias for %lld in glibc.
* muslc doesn't implement it for this reason.
* While we will likely never drop %Ld support,
lets clean house and set a better example.

Change-Id: Id46dad3104abae483e80cc5c05d1464d3ecd8030
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6636
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
Reviewed-by: Alex von Gluck IV <kallisti5@unixzen.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>


# a4436289 21-Dec-2022 PulkoMandy <pulkomandy@pulkomandy.tk>

media plugins: replace strcpy with strlcpy

Fixes a memory corruption: the ffmpeg plugin has a LOT of file
extensions, which goes way past the 8 allowed characters and even past
the 88 reserved bytes at the end of the structure. As a result, memory
after the structure is overwritten, resulting in heap corruption and
crashes.

This is immediately detected by using the guarded heap.

As a short term measure, use strlcpy to avoid overwriting memory, but
now the ffmpeg plugin will be unable to provide any useful info. It
would make sense to make media_format_info store a pointer to a string
instead (similar to entry_ref), but this requires more changes and will
create some incompatibility with existing apps if they use the field.

Change-Id: I8d2b567a179e9f7816b72f48aedac4e8534bc044


# 218a8c03 17-May-2019 Augustin Cavalier <waddlesplash@gmail.com>

Revert the Codec Kit.

All of Barrett's individual reverts have been squashed into this
one commit, save a few actual bugfixes.

Change-Id: Ib0a7d0a841d3ac40b1fca7372c58b7f9229bd1f0


# a57cf128 01-Dec-2018 Barrett17 <b.vitruvio@gmail.com>

Codec Kit: Introduce declarative macro with version and name

* Namespaces protect symbols, I didn't consider that when adding
the BCodecKit namespace, so, the AddOnManager complained that
instantiate_plugin() was missing. A macro is introduced that allow
plugins to specify it's className, version and name, this ease
the declaration of the plugin symbols, otherwise the function
should have been declared inside the BCodecKit namespace which
we would like to avoid.
* The code is also more future proof, since in future the AddOn manager
can begin to check for plugin versions.


# 915d5661 24-Nov-2018 Barrett17 <b.vitruvio@gmail.com>

ape_reader: Update class names


# d56f636b 21-Jun-2016 Dario Casalinuovo <b.vitruvio@gmail.com>

ape_reader: Refuse to work on streaming data

* The MACLib try to find the APE_DESCRIPTOR in the whole file, this
will not work for streams with a finite size.


# 88846940 30-May-2016 Dario Casalinuovo <b.vitruvio@gmail.com>

APEReader: Check initialization error


# ff72ec4f 10-Dec-2014 Adrien Destugues <pulkomandy@gmail.com>

APE reader: optimize seeking

* The APE SDK can only decode rather big chunks at a time (several
seconds), so our reader keeps an internal buffer of the last decoded
chunk.
* However, this was always dropped when seeking, meaning the same few
seconds of sound were decoded again and again.
* I'm not sure why MediaPlayer is trying to seek to the position it
already is at, but we can make it work, so why not.

Now the existing buffer is reused if possible when seeking. This makes
it possible to play APE files in MediaPlayer.

Also, several more style fixes.


# 5480f203 10-Dec-2014 Adrien Destugues <pulkomandy@gmail.com>

APE reader: style fixes.


# 6229115b 16-Jun-2014 Humdinger <humdingerb@gmail.com>

More small C++11 tweaks.


# c1ee6946 12-Apr-2009 David McPaul <dlmcpaul@gmail.com>

Add seeking support (my first commit from haiku)

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30143 a95241bf-73f2-0310-859d-f6bbb57e9c96


# b51fbe43 11-Apr-2009 David McPaul <dlmcpaul@gmail.com>

change to lower case

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30114 a95241bf-73f2-0310-859d-f6bbb57e9c96


# ff72ec4feefdf23442cb3426ebfa656f3c28fc80 10-Dec-2014 Adrien Destugues <pulkomandy@gmail.com>

APE reader: optimize seeking

* The APE SDK can only decode rather big chunks at a time (several
seconds), so our reader keeps an internal buffer of the last decoded
chunk.
* However, this was always dropped when seeking, meaning the same few
seconds of sound were decoded again and again.
* I'm not sure why MediaPlayer is trying to seek to the position it
already is at, but we can make it work, so why not.

Now the existing buffer is reused if possible when seeking. This makes
it possible to play APE files in MediaPlayer.

Also, several more style fixes.


# 5480f203d332ef54efe0ac73173f886475ff8997 10-Dec-2014 Adrien Destugues <pulkomandy@gmail.com>

APE reader: style fixes.


# 6229115bacb6fe085dcef68cbde071632e05bb68 16-Jun-2014 Humdinger <humdingerb@gmail.com>

More small C++11 tweaks.


# c1ee694618d533f533ead9a268714585f0af7c75 12-Apr-2009 David McPaul <dlmcpaul@gmail.com>

Add seeking support (my first commit from haiku)

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30143 a95241bf-73f2-0310-859d-f6bbb57e9c96


# b51fbe43f532ef73b4d3b772f60aace45765e54c 11-Apr-2009 David McPaul <dlmcpaul@gmail.com>

change to lower case

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30114 a95241bf-73f2-0310-859d-f6bbb57e9c96