diff -pruN 19.0.1+ds1-1/appveyor.yml 20.2.0+ds1-1/appveyor.yml
--- 19.0.1+ds1-1/appveyor.yml	2021-11-21 22:15:06.000000000 +0000
+++ 20.2.0+ds1-1/appveyor.yml	2022-01-01 10:14:07.000000000 +0000
@@ -27,7 +27,7 @@ environment:
 
 build_script:
   - cd ..
-  - git clone --branch Matrix --depth=1 https://github.com/xbmc/xbmc.git
+  - git clone --branch master --depth=1 https://github.com/xbmc/xbmc.git
   - cd %app_id%
   - mkdir build
   - cd build
diff -pruN 19.0.1+ds1-1/audioencoder.vorbis/addon.xml.in 20.2.0+ds1-1/audioencoder.vorbis/addon.xml.in
--- 19.0.1+ds1-1/audioencoder.vorbis/addon.xml.in	2021-11-21 22:15:06.000000000 +0000
+++ 20.2.0+ds1-1/audioencoder.vorbis/addon.xml.in	2022-01-01 10:14:07.000000000 +0000
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <addon
   id="audioencoder.vorbis"
-  version="19.0.1"
+  version="20.2.0"
   name="Vorbis Audio Encoder"
   provider-name="spiff">
   <requires>@ADDON_DEPENDS@</requires>
diff -pruN 19.0.1+ds1-1/azure-pipelines.yml 20.2.0+ds1-1/azure-pipelines.yml
--- 19.0.1+ds1-1/azure-pipelines.yml	2021-11-21 22:15:06.000000000 +0000
+++ 20.2.0+ds1-1/azure-pipelines.yml	2022-01-01 10:14:07.000000000 +0000
@@ -4,7 +4,7 @@ variables:
 trigger:
   branches:
     include:
-    - Matrix
+    - Nexus
     - releases/*
   paths:
     include:
@@ -46,7 +46,7 @@ jobs:
 
     - script: |
         cd ..
-        git clone --branch Matrix --depth=1 https://github.com/xbmc/xbmc.git kodi
+        git clone --branch master --depth=1 https://github.com/xbmc/xbmc.git kodi
         cd $(Build.SourcesDirectory)
         mkdir build
         cd build
diff -pruN 19.0.1+ds1-1/debian/changelog 20.2.0+ds1-1/debian/changelog
--- 19.0.1+ds1-1/debian/changelog	2022-03-21 17:49:54.000000000 +0000
+++ 20.2.0+ds1-1/debian/changelog	2022-08-04 09:55:46.000000000 +0000
@@ -1,3 +1,10 @@
+kodi-audioencoder-vorbis (20.2.0+ds1-1) unstable; urgency=medium
+
+  * New upstream version 20.2.0+ds1
+  * Prepare for v20 in unstable
+
+ -- Vasyl Gello <vasek.gello@gmail.com>  Thu, 04 Aug 2022 09:55:46 +0000
+
 kodi-audioencoder-vorbis (19.0.1+ds1-1) unstable; urgency=medium
 
   * New upstream version 19.0.1+ds1
diff -pruN 19.0.1+ds1-1/debian/control 20.2.0+ds1-1/debian/control
--- 19.0.1+ds1-1/debian/control	2022-03-21 17:49:54.000000000 +0000
+++ 20.2.0+ds1-1/debian/control	2022-08-04 09:55:46.000000000 +0000
@@ -4,11 +4,11 @@ Section: sound
 Maintainer: Debian Multimedia Maintainers <debian-multimedia@lists.debian.org>
 Uploaders: Vasyl Gello <vasek.gello@gmail.com>
 Build-Depends: debhelper-compat (= 13),
-Build-Depends-Arch: dh-sequence-kodiaddon (>= 2:19~),
+Build-Depends-Arch: dh-sequence-kodiaddon (>= 2:20~),
                cmake,
                libogg-dev,
                libvorbis-dev
-Standards-Version: 4.6.0
+Standards-Version: 4.6.1
 Rules-Requires-Root: no
 Vcs-Browser: https://salsa.debian.org/multimedia-team/kodi-media-center/kodi-audioencoder-vorbis
 Vcs-Git: https://salsa.debian.org/multimedia-team/kodi-media-center/kodi-audioencoder-vorbis.git
diff -pruN 19.0.1+ds1-1/debian/copyright 20.2.0+ds1-1/debian/copyright
--- 19.0.1+ds1-1/debian/copyright	2021-01-20 07:03:17.000000000 +0000
+++ 20.2.0+ds1-1/debian/copyright	2022-08-04 09:55:46.000000000 +0000
@@ -4,12 +4,12 @@ Source: https://github.com/xbmc/audioenc
 Files-Excluded: depends
 
 Files: *
-Copyright: 2005-2021 Team Kodi
+Copyright: 2005-2022 Team Kodi
 License: GPL-2+
 
 Files: debian/*
 Copyright: 2016-2020 Christian Marillat <marillat@deb-multimedia.org>
-           2020-2021 Vasyl Gello <vasek.gello@gmail.com>
+           2020-2022 Vasyl Gello <vasek.gello@gmail.com>
 License: GPL-2+
 
 License: GPL-2+
diff -pruN 19.0.1+ds1-1/debian/watch 20.2.0+ds1-1/debian/watch
--- 19.0.1+ds1-1/debian/watch	2021-08-26 10:14:23.000000000 +0000
+++ 20.2.0+ds1-1/debian/watch	2022-08-04 09:55:46.000000000 +0000
@@ -5,4 +5,4 @@ opts="repack, \
       repacksuffix=+ds1, \
       dversionmangle=auto" \
 https://github.com/xbmc/audioencoder.vorbis/releases \
-/xbmc/audioencoder.vorbis/archive/refs/tags/?(\d\S*)-Matrix\.tar\.gz
+/xbmc/audioencoder.vorbis/archive/refs/tags/?(\d\S*)-Nexus\.tar\.gz
diff -pruN 19.0.1+ds1-1/Jenkinsfile 20.2.0+ds1-1/Jenkinsfile
--- 19.0.1+ds1-1/Jenkinsfile	2021-11-21 22:15:06.000000000 +0000
+++ 20.2.0+ds1-1/Jenkinsfile	2022-01-01 10:14:07.000000000 +0000
@@ -1 +1 @@
-buildPlugin(version: "Matrix")
+buildPlugin(version: "Nexus")
diff -pruN 19.0.1+ds1-1/README.md 20.2.0+ds1-1/README.md
--- 19.0.1+ds1-1/README.md	2021-11-21 22:15:06.000000000 +0000
+++ 20.2.0+ds1-1/README.md	2022-01-01 10:14:07.000000000 +0000
@@ -4,22 +4,22 @@ This is a [Kodi](https://kodi.tv) VORBIS
 
 #### CI Testing
 [![License: GPL-2.0-or-later](https://img.shields.io/badge/License-GPL%20v2+-blue.svg)](LICENSE.md)
-[![Build Status](https://travis-ci.com/xbmc/audioencoder.vorbis.svg?branch=Matrix)](https://travis-ci.com/xbmc/audioencoder.vorbis/branches)
-[![Build Status](https://dev.azure.com/teamkodi/binary-addons/_apis/build/status/xbmc.audioencoder.vorbis?branchName=Matrix)](https://dev.azure.com/teamkodi/binary-addons/_build/latest?definitionId=23&branchName=Matrix)
-[![Build Status](https://jenkins.kodi.tv/view/Addons/job/xbmc/job/audioencoder.vorbis/job/Matrix/badge/icon)](https://jenkins.kodi.tv/blue/organizations/jenkins/xbmc%2Faudioencoder.vorbis/branches/)
+[![Build Status](https://travis-ci.com/xbmc/audioencoder.vorbis.svg?branch=Nexus)](https://travis-ci.com/xbmc/audioencoder.vorbis/branches)
+[![Build Status](https://dev.azure.com/teamkodi/binary-addons/_apis/build/status/xbmc.audioencoder.vorbis?branchName=Nexus)](https://dev.azure.com/teamkodi/binary-addons/_build/latest?definitionId=23&branchName=Nexus)
+[![Build Status](https://jenkins.kodi.tv/view/Addons/job/xbmc/job/audioencoder.vorbis/job/Nexus/badge/icon)](https://jenkins.kodi.tv/blue/organizations/jenkins/xbmc%2Faudioencoder.vorbis/branches/)
 [![Coverity Scan Build Status](https://scan.coverity.com/projects/5120/badge.svg)](https://scan.coverity.com/projects/5120)
-<!--- [![Build Status](https://ci.appveyor.com/api/projects/status/github/xbmc/audioencoder.vorbis?branch=Matrix&svg=true)](https://ci.appveyor.com/project/xbmc/audioencoder-vorbis?branch=Matrix) -->
+<!--- [![Build Status](https://ci.appveyor.com/api/projects/status/github/xbmc/audioencoder.vorbis?branch=Nexus&svg=true)](https://ci.appveyor.com/project/xbmc/audioencoder-vorbis?branch=Nexus) -->
 
 ## Build instructions
 
 When building the addon you have to use the correct branch depending on which version of Kodi you're building against.
-If you want to build the addon to be compatible with the latest kodi `Matrix` commit, you need to checkout the branch with the current kodi codename.
+If you want to build the addon to be compatible with the latest kodi `master` commit, you need to checkout the branch with the current kodi codename.
 Also make sure you follow this README from the branch in question.
 
 ### Linux
 
-1. `git clone --branch Matrix https://github.com/xbmc/xbmc.git`
-2. `git clone --branch Matrix https://github.com/audioencoder.vorbis/audioencoder.vorbis.git`
+1. `git clone --branch master https://github.com/xbmc/xbmc.git`
+2. `git clone --branch Nexus https://github.com/audioencoder.vorbis/audioencoder.vorbis.git`
 3. `cd audioencoder.vorbis && mkdir build && cd build`
 4. `cmake -DADDONS_TO_BUILD=audioencoder.vorbis -DADDON_SRC_PREFIX=../.. -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=../../xbmc/addons -DPACKAGE_ZIP=1 ../../xbmc/project/cmake/addons`
 5. `make`
diff -pruN 19.0.1+ds1-1/src/EncoderVorbis.cpp 20.2.0+ds1-1/src/EncoderVorbis.cpp
--- 19.0.1+ds1-1/src/EncoderVorbis.cpp	2021-11-21 22:15:06.000000000 +0000
+++ 20.2.0+ds1-1/src/EncoderVorbis.cpp	2022-01-01 10:14:07.000000000 +0000
@@ -13,27 +13,16 @@
 #include <time.h>
 #include <vorbis/vorbisenc.h>
 
-static const int OGG_BLOCK_FRAMES = 1024; // number of frames to encode at a time
+static const size_t OGG_BLOCK_FRAMES = 1024; // number of frames to encode at a time
 
-class ATTRIBUTE_HIDDEN CEncoderVorbis : public kodi::addon::CInstanceAudioEncoder
+class ATTR_DLL_LOCAL CEncoderVorbis : public kodi::addon::CInstanceAudioEncoder
 {
 public:
-  CEncoderVorbis(KODI_HANDLE instance, const std::string& version);
+  CEncoderVorbis(const kodi::addon::IInstanceInfo& instance);
   ~CEncoderVorbis() override;
 
-  bool Start(int inChannels,
-             int inRate,
-             int inBits,
-             const std::string& title,
-             const std::string& artist,
-             const std::string& albumartist,
-             const std::string& album,
-             const std::string& year,
-             const std::string& track,
-             const std::string& genre,
-             const std::string& comment,
-             int trackLength) override;
-  int Encode(int numBytesRead, const uint8_t* stream) override;
+  bool Start(const kodi::addon::AudioEncoderInfoTag& tag) override;
+  ssize_t Encode(const uint8_t* stream, size_t numBytesRead) override;
   bool Finish() override;
 
 private:
@@ -49,13 +38,13 @@ private:
   int m_bitrate;
 };
 
-CEncoderVorbis::CEncoderVorbis(KODI_HANDLE instance, const std::string& version)
-  : CInstanceAudioEncoder(instance, version), m_inited(false), m_preset(-1)
+CEncoderVorbis::CEncoderVorbis(const kodi::addon::IInstanceInfo& instance)
+  : CInstanceAudioEncoder(instance), m_inited(false), m_preset(-1)
 {
   // create encoder context
   vorbis_info_init(&m_vorbisInfo);
 
-  int value = kodi::GetSettingInt("preset");
+  int value = kodi::addon::GetSettingInt("preset");
   if (value == 0)
     m_preset = 4;
   else if (value == 1)
@@ -63,7 +52,7 @@ CEncoderVorbis::CEncoderVorbis(KODI_HAND
   else if (value == 2)
     m_preset = 7;
 
-  m_bitrate = 128 + 32 * kodi::GetSettingInt("bitrate");
+  m_bitrate = 128 + 32 * kodi::addon::GetSettingInt("bitrate");
 }
 
 CEncoderVorbis::~CEncoderVorbis()
@@ -78,42 +67,33 @@ CEncoderVorbis::~CEncoderVorbis()
   vorbis_info_clear(&m_vorbisInfo);
 }
 
-bool CEncoderVorbis::Start(int inChannels,
-                           int inRate,
-                           int inBits,
-                           const std::string& title,
-                           const std::string& artist,
-                           const std::string& albumartist,
-                           const std::string& album,
-                           const std::string& year,
-                           const std::string& track,
-                           const std::string& genre,
-                           const std::string& comment,
-                           int trackLength)
+bool CEncoderVorbis::Start(const kodi::addon::AudioEncoderInfoTag& tag)
 {
   // we accept only 2 ch 16 bit atm
-  if (inChannels != 2 || inBits != 16)
+  if (tag.GetChannels() != 2 || tag.GetBitsPerSample() != 16)
   {
     kodi::Log(ADDON_LOG_ERROR, "Invalid input format to encode");
     return false;
   }
 
   if (m_preset == -1)
-    vorbis_encode_init(&m_vorbisInfo, inChannels, inRate, -1, m_bitrate * 1000, -1);
+    vorbis_encode_init(&m_vorbisInfo, tag.GetChannels(), tag.GetSamplerate(), -1, m_bitrate * 1000,
+                       -1);
   else
-    vorbis_encode_init_vbr(&m_vorbisInfo, inChannels, inRate, float(m_preset) / 10.0f);
+    vorbis_encode_init_vbr(&m_vorbisInfo, tag.GetChannels(), tag.GetSamplerate(),
+                           float(m_preset) / 10.0f);
 
   /* add a comment */
   vorbis_comment comm;
   vorbis_comment_init(&comm);
-  vorbis_comment_add_tag(&comm, "comment", comment.c_str());
-  vorbis_comment_add_tag(&comm, "artist", artist.c_str());
-  vorbis_comment_add_tag(&comm, "title", title.c_str());
-  vorbis_comment_add_tag(&comm, "album", album.c_str());
-  vorbis_comment_add_tag(&comm, "albumartist", albumartist.c_str());
-  vorbis_comment_add_tag(&comm, "genre", genre.c_str());
-  vorbis_comment_add_tag(&comm, "tracknumber", track.c_str());
-  vorbis_comment_add_tag(&comm, "date", year.c_str());
+  vorbis_comment_add_tag(&comm, "comment", tag.GetComment().c_str());
+  vorbis_comment_add_tag(&comm, "artist", tag.GetArtist().c_str());
+  vorbis_comment_add_tag(&comm, "title", tag.GetTitle().c_str());
+  vorbis_comment_add_tag(&comm, "album", tag.GetAlbum().c_str());
+  vorbis_comment_add_tag(&comm, "albumartist", tag.GetAlbumArtist().c_str());
+  vorbis_comment_add_tag(&comm, "genre", tag.GetGenre().c_str());
+  vorbis_comment_add_tag(&comm, "tracknumber", std::to_string(tag.GetTrack()).c_str());
+  vorbis_comment_add_tag(&comm, "date", tag.GetReleaseDate().c_str());
 
   /* set up the analysis state and auxiliary encoding storage */
   vorbis_analysis_init(&m_vorbisDspState, &m_vorbisInfo);
@@ -155,11 +135,11 @@ bool CEncoderVorbis::Start(int inChannel
   return true;
 }
 
-int CEncoderVorbis::Encode(int numBytesRead, const uint8_t* stream)
+ssize_t CEncoderVorbis::Encode(const uint8_t* stream, size_t numBytesRead)
 {
   int eos = 0;
 
-  int bytes_left = numBytesRead;
+  size_t bytes_left = numBytesRead;
   while (bytes_left)
   {
     const int channels = 2;
@@ -169,8 +149,8 @@ int CEncoderVorbis::Encode(int numBytesR
 
     /* uninterleave samples */
 
-    int bytes_per_frame = channels * (bits_per_channel >> 3);
-    int frames = std::min(bytes_left / bytes_per_frame, OGG_BLOCK_FRAMES);
+    size_t bytes_per_frame = channels * (bits_per_channel >> 3);
+    size_t frames = std::min(bytes_left / bytes_per_frame, OGG_BLOCK_FRAMES);
 
     const int16_t* buf = reinterpret_cast<const int16_t*>(stream);
     for (int i = 0; i < frames; i++)
@@ -261,24 +241,18 @@ bool CEncoderVorbis::Finish()
 
 //------------------------------------------------------------------------------
 
-class ATTRIBUTE_HIDDEN CMyAddon : public kodi::addon::CAddonBase
+class ATTR_DLL_LOCAL CMyAddon : public kodi::addon::CAddonBase
 {
 public:
   CMyAddon() = default;
-  ADDON_STATUS CreateInstance(int instanceType,
-                              const std::string& instanceID,
-                              KODI_HANDLE instance,
-                              const std::string& version,
-                              KODI_HANDLE& addonInstance) override;
+  ADDON_STATUS CreateInstance(const kodi::addon::IInstanceInfo& instance,
+                              KODI_ADDON_INSTANCE_HDL& hdl) override;
 };
 
-ADDON_STATUS CMyAddon::CreateInstance(int instanceType,
-                                      const std::string& instanceID,
-                                      KODI_HANDLE instance,
-                                      const std::string& version,
-                                      KODI_HANDLE& addonInstance)
+ADDON_STATUS CMyAddon::CreateInstance(const kodi::addon::IInstanceInfo& instance,
+                                      KODI_ADDON_INSTANCE_HDL& hdl)
 {
-  addonInstance = new CEncoderVorbis(instance, version);
+  hdl = new CEncoderVorbis(instance);
   return ADDON_STATUS_OK;
 }
 
diff -pruN 19.0.1+ds1-1/.travis.yml 20.2.0+ds1-1/.travis.yml
--- 19.0.1+ds1-1/.travis.yml	2021-11-21 22:15:06.000000000 +0000
+++ 20.2.0+ds1-1/.travis.yml	2022-01-01 10:14:07.000000000 +0000
@@ -34,12 +34,12 @@ before_install:
 #
 before_script:
   - if [[ $DEBIAN_BUILD != true ]]; then cd $TRAVIS_BUILD_DIR/..; fi
-  - if [[ $DEBIAN_BUILD != true ]]; then git clone --branch Matrix --depth=1 https://github.com/xbmc/xbmc.git; fi
+  - if [[ $DEBIAN_BUILD != true ]]; then git clone --branch master --depth=1 https://github.com/xbmc/xbmc.git; fi
   - if [[ $DEBIAN_BUILD != true ]]; then cd ${app_id} && mkdir build && cd build; fi
   - if [[ $DEBIAN_BUILD != true ]]; then mkdir -p definition/${app_id}; fi
   - if [[ $DEBIAN_BUILD != true ]]; then echo ${app_id} $TRAVIS_BUILD_DIR $TRAVIS_COMMIT > definition/${app_id}/${app_id}.txt; fi
   - if [[ $DEBIAN_BUILD != true ]]; then cmake -DADDONS_TO_BUILD=${app_id} -DADDON_SRC_PREFIX=$TRAVIS_BUILD_DIR/.. -DADDONS_DEFINITION_DIR=$TRAVIS_BUILD_DIR/build/definition -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=$TRAVIS_BUILD_DIR/../xbmc/addons -DPACKAGE_ZIP=1 $TRAVIS_BUILD_DIR/../xbmc/cmake/addons; fi
-  - if [[ $DEBIAN_BUILD == true ]]; then wget https://raw.githubusercontent.com/xbmc/xbmc/Matrix/xbmc/addons/kodi-dev-kit/tools/debian-addon-package-test.sh && chmod +x ./debian-addon-package-test.sh; fi
+  - if [[ $DEBIAN_BUILD == true ]]; then wget https://raw.githubusercontent.com/xbmc/xbmc/master/xbmc/addons/kodi-dev-kit/tools/debian-addon-package-test.sh && chmod +x ./debian-addon-package-test.sh; fi
   - if [[ $DEBIAN_BUILD == true ]]; then sudo apt-get build-dep $TRAVIS_BUILD_DIR; fi
 
 script: 
