Skip to content

Commit

Permalink
audiodecoder API Version 4.0.0 update
Browse files Browse the repository at this point in the history
  • Loading branch information
AlwinEsch committed Oct 17, 2021
1 parent 692f023 commit 012437e
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 8 deletions.
15 changes: 13 additions & 2 deletions audiodecoder.dumb/addon.xml.in
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,19 @@
<extension
point="kodi.audiodecoder"
name="dumb"
extension=".it|.xm|.s3m"
library_@PLATFORM@="@LIBRARY_FILENAME@"/>
library_@PLATFORM@="@LIBRARY_FILENAME@">
<support>
<extension name=".it">
<description>30100</description>
</extension>
<extension name=".xm">
<description>30101</description>
</extension>
<extension name=".s3m">
<description>30102</description>
</extension>
</support>
</extension>
<extension point="xbmc.addon.metadata">
<platform>@PLATFORM@</platform>
<license>GPL-2.0-or-later</license>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,21 @@ msgstr ""
msgctxt "Addon Lifecyclestate"
msgid "Replaced by audiodecoder.openmpt addon! However, but still usable here."
msgstr ""

#. Supported file extension description about ".it"
#: audiodecoder.dumb/addon.xml.in
msgctxt "#30100"
msgid "Music module created by Impulse Tracker, an audio tracking program."
msgstr ""

#. Supported file extension description about ".xm"
#: audiodecoder.dumb/addon.xml.in
msgctxt "#30101"
msgid "Music module created by Fasttracker 2, an audio tracker program."
msgstr ""

#. Supported file extension description about ".s3m"
#: audiodecoder.dumb/addon.xml.in
msgctxt "#30102"
msgid "Audio module format used by Scream Tracker 3.0 and later."
msgstr ""
8 changes: 4 additions & 4 deletions src/DumbCodec.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ bool CDumbCodec::Init(const std::string& filename,
return true;
}

int CDumbCodec::ReadPCM(uint8_t* buffer, int size, int& actualsize)
int CDumbCodec::ReadPCM(uint8_t* buffer, size_t size, size_t& actualsize)
{
// Read samples from libdumb save them to the SDL buffer. Note that we are
// reading SAMPLES, not bytes!
Expand All @@ -169,9 +169,9 @@ int CDumbCodec::ReadPCM(uint8_t* buffer, int size, int& actualsize)
m_position = m_totaltime;

if (actualsize == 0)
return -1;
return AUDIODECODER_READ_EOF;

return 0;
return AUDIODECODER_READ_SUCCESS;
}

int64_t CDumbCodec::Seek(int64_t time)
Expand All @@ -181,7 +181,7 @@ int64_t CDumbCodec::Seek(int64_t time)

//------------------------------------------------------------------------------

class ATTRIBUTE_HIDDEN CMyAddon : public kodi::addon::CAddonBase
class ATTR_DLL_LOCAL CMyAddon : public kodi::addon::CAddonBase
{
public:
CMyAddon() = default;
Expand Down
4 changes: 2 additions & 2 deletions src/DumbCodec.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ extern "C"
#include <dumb.h>
} /* extern "C" */

class ATTRIBUTE_HIDDEN CDumbCodec : public kodi::addon::CInstanceAudioDecoder
class ATTR_DLL_LOCAL CDumbCodec : public kodi::addon::CInstanceAudioDecoder
{
public:
CDumbCodec(KODI_HANDLE instance, const std::string& version);
Expand All @@ -30,7 +30,7 @@ class ATTRIBUTE_HIDDEN CDumbCodec : public kodi::addon::CInstanceAudioDecoder
int& bitrate,
AudioEngineDataFormat& format,
std::vector<AudioEngineChannel>& channellist) override;
int ReadPCM(uint8_t* buffer, int size, int& actualsize) override;
int ReadPCM(uint8_t* buffer, size_t size, size_t& actualsize) override;
int64_t Seek(int64_t time) override;

private:
Expand Down

0 comments on commit 012437e

Please sign in to comment.