diff options
22 files changed, 113 insertions, 80 deletions
diff --git a/addons/metadata.album.universal/addon.xml b/addons/metadata.album.universal/addon.xml index 3a0527a36f..cf931d0611 100644 --- a/addons/metadata.album.universal/addon.xml +++ b/addons/metadata.album.universal/addon.xml @@ -5,11 +5,11 @@ provider-name="Olympia, Team XBMC"> <requires> <import addon="xbmc.metadata" version="2.1.0"/> - <import addon="metadata.common.allmusic.com" version="2.5.2"/> - <import addon="metadata.common.musicbrainz.org" version="1.2.3"/> - <import addon="metadata.common.fanart.tv" version="2.1.2"/> - <import addon="metadata.common.amazon.de" version="1.0.0"/> - <import addon="metadata.common.theaudiodb.com" version="1.7.0"/> + <import addon="metadata.common.allmusic.com" version="3.0.2"/> + <import addon="metadata.common.amazon.de" version="1.0.2"/> + <import addon="metadata.common.fanart.tv" version="3.1.0"/> + <import addon="metadata.common.musicbrainz.org" version="2.0.2"/> + <import addon="metadata.common.theaudiodb.com" version="1.7.3"/> </requires> <extension point="xbmc.metadata.scraper.albums" language="en" diff --git a/addons/metadata.artists.universal/addon.xml b/addons/metadata.artists.universal/addon.xml index 555e98b0fb..8098246d78 100644 --- a/addons/metadata.artists.universal/addon.xml +++ b/addons/metadata.artists.universal/addon.xml @@ -5,11 +5,11 @@ provider-name="Olympia, Team XBMC"> <requires> <import addon="xbmc.metadata" version="2.1.0"/> - <import addon="metadata.common.allmusic.com" version="3.0.0"/> - <import addon="metadata.common.musicbrainz.org" version="1.3.0"/> - <import addon="metadata.common.fanart.tv" version="2.1.2"/> - <import addon="metadata.common.theaudiodb.com" version="1.5.0"/> - <import addon="metadata.common.htbackdrops.com" version="1.3.0"/> + <import addon="metadata.common.allmusic.com" version="3.0.2"/> + <import addon="metadata.common.fanart.tv" version="3.1.0"/> + <import addon="metadata.common.htbackdrops.com" version="1.3.2"/> + <import addon="metadata.common.musicbrainz.org" version="2.0.2"/> + <import addon="metadata.common.theaudiodb.com" version="1.7.3"/> </requires> <extension point="xbmc.metadata.scraper.artists" language="en" diff --git a/addons/metadata.common.allmusic.com/addon.xml b/addons/metadata.common.allmusic.com/addon.xml index 94ad5612c6..bfcb63c3b7 100644 --- a/addons/metadata.common.allmusic.com/addon.xml +++ b/addons/metadata.common.allmusic.com/addon.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <addon id="metadata.common.allmusic.com" - name="AllMusic" + name="AllMusic Scraper Library" version="3.0.2" provider-name="Team XBMC"> <requires> @@ -10,7 +10,6 @@ library="allmusic.xml"/> <extension point="xbmc.addon.metadata"> <platform>all</platform> - <minversion>20000</minversion> <summary lang="bg">Библиотека за сваляне на музикална инф. от AllMusic</summary> <summary lang="en">AllMusic Music Scraper Library</summary> <summary lang="de">Musik-Scraper für AllMusic.com</summary> diff --git a/addons/metadata.common.amazon.de/addon.xml b/addons/metadata.common.amazon.de/addon.xml index dda6587ef0..8b9eec1e9f 100644 --- a/addons/metadata.common.amazon.de/addon.xml +++ b/addons/metadata.common.amazon.de/addon.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <addon id="metadata.common.amazon.de" - name="Amazon.de" + name="Amazon.de Scraper Library" version="1.0.2" provider-name="Team XBMC"> <requires> @@ -10,7 +10,6 @@ library="amazonde.xml"/> <extension point="xbmc.addon.metadata"> <platform>all</platform> - <minversion>20000</minversion> <summary lang="en">amazon.de Scraper Library</summary> <description lang="en">Download Music information from amazon.de</description> </extension> diff --git a/addons/metadata.common.fanart.tv/addon.xml b/addons/metadata.common.fanart.tv/addon.xml index 8f05b79ea0..34e44e288b 100644 --- a/addons/metadata.common.fanart.tv/addon.xml +++ b/addons/metadata.common.fanart.tv/addon.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <addon id="metadata.common.fanart.tv" - name="fanart.tv" + name="fanart.tv Scraper Library" version="3.1.0" provider-name="Team XBMC"> <requires> @@ -10,7 +10,6 @@ library="fanarttv.xml"/> <extension point="xbmc.addon.metadata"> <platform>all</platform> - <minversion>20000</minversion> <summary lang="bg">Библиотека за сваляне на инф. от fanart.tv</summary> <summary lang="en">fanart.tv Scraper Library</summary> <summary lang="de">Scraper für Hintergründe von fanart.tv</summary> diff --git a/addons/metadata.common.htbackdrops.com/addon.xml b/addons/metadata.common.htbackdrops.com/addon.xml index 06f8910962..5afafdf471 100644 --- a/addons/metadata.common.htbackdrops.com/addon.xml +++ b/addons/metadata.common.htbackdrops.com/addon.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <addon id="metadata.common.htbackdrops.com" - name="HTBackdrops" + name="HTBackdrops Scraper Library" version="1.3.2" provider-name="Team XBMC"> <requires> @@ -10,7 +10,6 @@ library="htbackdrops.xml"/> <extension point="xbmc.addon.metadata"> <platform>all</platform> - <minversion>20000</minversion> <summary lang="bg">Библиотека за сваляне на инф. от HTBackdrops</summary> <summary lang="en">HTBackdrops Scraper Library</summary> <summary lang="de">Scraper für Hintergründe von HTBackdrops</summary> diff --git a/addons/metadata.common.imdb.com/addon.xml b/addons/metadata.common.imdb.com/addon.xml index 99fe531d92..d88bbbe6a1 100644 --- a/addons/metadata.common.imdb.com/addon.xml +++ b/addons/metadata.common.imdb.com/addon.xml @@ -10,7 +10,6 @@ library="imdb.xml"/> <extension point="xbmc.addon.metadata"> <platform>all</platform> - <minversion>20000</minversion> <summary lang="bg">Библиотека за сваляне на инф. от IMDB</summary> <summary lang="en">IMDB Scraper Library</summary> <summary lang="fi">IMDB elokuvatietojen lataaja</summary> diff --git a/addons/metadata.common.last.fm/addon.xml b/addons/metadata.common.last.fm/addon.xml index ed1fb4a4af..951fb6d3b3 100644 --- a/addons/metadata.common.last.fm/addon.xml +++ b/addons/metadata.common.last.fm/addon.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <addon id="metadata.common.last.fm" - name="Last.FM" + name="Last.FM Scraper Library" version="1.6.1" provider-name="Team XBMC"> <requires> @@ -10,7 +10,6 @@ library="lastfm.xml"/> <extension point="xbmc.addon.metadata"> <platform>all</platform> - <minversion>20000</minversion> <summary lang="bg">Библиотека за сваляне на инф. от LastFM</summary> <summary lang="en">LastFM Scraper Library</summary> <summary lang="de">Musik-Scraper für LastFM</summary> diff --git a/addons/metadata.common.musicbrainz.org/addon.xml b/addons/metadata.common.musicbrainz.org/addon.xml index bf8801c3c9..1cc1b60932 100644 --- a/addons/metadata.common.musicbrainz.org/addon.xml +++ b/addons/metadata.common.musicbrainz.org/addon.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <addon id="metadata.common.musicbrainz.org" - name="musicbrainz" + name="MusicBrainz Scraper Library" version="2.0.2" provider-name="Team XBMC"> <requires> @@ -10,7 +10,6 @@ library="musicbrainz.xml"/> <extension point="xbmc.addon.metadata"> <platform>all</platform> - <minversion>20000</minversion> <summary lang="bg">Библиотека за сваляне на музикална инф. от MusicBrainz</summary> <summary lang="en">MusicBrainz Music Scraper Library</summary> <summary lang="de">Musik-Scraper für musicbrainz.org</summary> diff --git a/addons/metadata.common.theaudiodb.com/addon.xml b/addons/metadata.common.theaudiodb.com/addon.xml index 547db5bc22..1373f410c3 100644 --- a/addons/metadata.common.theaudiodb.com/addon.xml +++ b/addons/metadata.common.theaudiodb.com/addon.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <addon id="metadata.common.theaudiodb.com" - name="TheAudioDb Common Scraper Functions" + name="TheAudioDb Scraper Library" version="1.7.3" provider-name="Team XBMC"> <requires> @@ -10,7 +10,6 @@ library="tadb.xml"/> <extension point="xbmc.addon.metadata"> <platform>all</platform> - <minversion>20000</minversion> <summary lang="bg">Библиотека за сваляне на музикална инф. от TheAudioDb</summary> <summary lang="en">TheAudioDb Music Scraper Library</summary> <summary lang="de">Musik-Scraper für TheAudioDb.org</summary> diff --git a/addons/metadata.common.themoviedb.org/addon.xml b/addons/metadata.common.themoviedb.org/addon.xml index 55f6e5ba4c..2c5e13ae3e 100644 --- a/addons/metadata.common.themoviedb.org/addon.xml +++ b/addons/metadata.common.themoviedb.org/addon.xml @@ -10,7 +10,6 @@ library="tmdb.xml"/> <extension point="xbmc.addon.metadata"> <platform>all</platform> - <minversion>20000</minversion> <summary lang="bg">Библиотека за сваляне на инф. от TMDb</summary> <summary lang="en">TMDb Scraper Library</summary> <summary lang="es">Scraper de peliculas de TMDb</summary> diff --git a/addons/metadata.musicvideos.theaudiodb.com/addon.xml b/addons/metadata.musicvideos.theaudiodb.com/addon.xml index 208140f796..7c7b51a754 100644 --- a/addons/metadata.musicvideos.theaudiodb.com/addon.xml +++ b/addons/metadata.musicvideos.theaudiodb.com/addon.xml @@ -5,8 +5,8 @@ provider-name="Team XBMC"> <requires> <import addon="xbmc.metadata" version="2.1.0"/> - <import addon="metadata.common.theaudiodb.com" version="1.6.0"/> - <import addon="metadata.common.fanart.tv" version="2.1.2"/> + <import addon="metadata.common.fanart.tv" version="3.1.0"/> + <import addon="metadata.common.theaudiodb.com" version="1.7.3"/> </requires> <extension point="xbmc.metadata.scraper.musicvideos" language="en" @@ -103,7 +103,7 @@ <website></website> <source></source> <email></email> - <forum></forum> + <forum>http://forum.xbmc.org/showthread.php?tid=136105</forum> <license>GPL v2.0</license> </extension> </addon> diff --git a/addons/metadata.themoviedb.org/addon.xml b/addons/metadata.themoviedb.org/addon.xml index 5de97d0230..06f4dc8233 100644 --- a/addons/metadata.themoviedb.org/addon.xml +++ b/addons/metadata.themoviedb.org/addon.xml @@ -5,10 +5,10 @@ provider-name="Team XBMC"> <requires> <import addon="xbmc.metadata" version="2.1.0"/> - <import addon="metadata.common.themoviedb.org" version="2.8.0"/> - <import addon="metadata.common.hdtrailers.net" version="1.0.7"/> - <import addon="metadata.common.imdb.com" version="2.6.0"/> - <import addon="plugin.video.youtube" version="2.9.1" optional="true"/> + <import addon="metadata.common.imdb.com" version="2.7.8"/> + <import addon="metadata.common.hdtrailers.net" version="2.0.5"/> + <import addon="metadata.common.themoviedb.org" version="2.12.1"/> + <import addon="plugin.video.youtube" version="4.4.10" optional="true"/> </requires> <extension point="xbmc.metadata.scraper.movies" language="en" diff --git a/configure.in b/configure.in index a195d00d31..ea4de56c62 100644 --- a/configure.in +++ b/configure.in @@ -84,8 +84,8 @@ AC_DEFUN([XB_FIND_SONAME], lib=[`ls -- $path/lib$2.dylib 2>/dev/null`] if test x$lib != x; then # we want the path/name that is embedded in the dylib - $1_SONAME=[`otool -L $lib | grep -v lib$2.dylib | grep lib$2 | awk '{V=1; print $V}'`] - $1_SONAME=[`basename $$1_SONAME`] + $1_FILENAME=[`otool -L $lib | grep -v lib$2.dylib | grep lib$2 | awk '{V=1; print $V}'`] + $1_SONAME=[`basename $$1_FILENAME`] fi done fi @@ -599,6 +599,8 @@ AC_PROG_MAKE_SET PKG_PROG_PKG_CONFIG MAKE="${MAKE:-make}" OBJDUMP="${OBJDUMP:-objdump}" +READELF="${READELF:-readelf}" +NM="${NM:-nm}" use_external_ffmpeg=no use_static_ffmpeg=no @@ -1099,17 +1101,25 @@ AC_CHECK_HEADER([samplerate.h],, AC_MSG_ERROR($missing_library)) AC_CHECK_HEADER([ogg/ogg.h],, AC_MSG_ERROR($missing_library)) AC_CHECK_HEADER([vorbis/vorbisfile.h],, AC_MSG_ERROR($missing_library)) AC_CHECK_HEADER([libmodplug/modplug.h],, AC_MSG_ERROR($missing_library)) -AC_CHECK_HEADER([curl/curl.h],, AC_MSG_ERROR($missing_library)) AC_CHECK_HEADER([FLAC/stream_decoder.h],, AC_MSG_ERROR($missing_library)) -# we need to check for the header because if it exists we set the openssl -# and gcrypt MT callback hooks. This is mostly so that libcurl operates -# in MT manner correctly. -AC_MSG_CHECKING([for CRYPTO_set_locking_callback(0)]) -AC_TRY_LINK([],[CRYPTO_set_locking_callback(0);], - [have_curl_static=yes], - [have_curl_static=no]) -AC_MSG_RESULT($have_curl_static) +AC_CHECK_HEADER([curl/curl.h],, AC_MSG_ERROR($missing_library)) +XB_FIND_SONAME([CURL], [curl]) +AC_MSG_CHECKING([for CRYPTO_set_locking_callback(0) in $CURL_SONAME]) +if test "$host_vendor" = "apple" ; then + libchecker="$NM" + searchpattern="T [_]?CRYPTO_set_locking_call" +else + libchecker="$READELF -s" + searchpattern="CRYPTO_set_locking_call" +fi +if test $($libchecker $CURL_FILENAME | grep -Eq "${searchpattern}" ; echo $?) -eq 0 ; then + AC_MSG_RESULT(yes) + AC_DEFINE([HAS_CURL_STATIC], [1], [Whether OpenSSL inside libcurl is static.]) +else + AC_MSG_RESULT(no) +fi + AC_CHECK_HEADER([openssl/crypto.h], AC_DEFINE([HAVE_OPENSSL],[1],[Define if we have openssl]),) AC_CHECK_HEADER([gcrypt.h], gcrypt_headers_available=yes,gcrypt_headers_available=no) if test "$gcrypt_headers_available" = "yes"; then @@ -1258,7 +1268,6 @@ fi XB_FIND_SONAME([MAD], [mad]) XB_FIND_SONAME([OGG], [ogg]) -XB_FIND_SONAME([CURL], [curl]) XB_FIND_SONAME([FLAC], [FLAC]) XB_FIND_SONAME([VORBIS], [vorbis]) XB_FIND_SONAME([VORBISFILE], [vorbisfile]) @@ -1522,11 +1531,6 @@ else AC_DEFINE([HAVE_LIBSSH], [1], [Whether to use libSSH library.]) fi -# libcurl -if test "x$have_curl_static" = "xyes"; then - AC_DEFINE([HAS_CURL_STATIC], [1], [Whether OpenSSL inside libcurl is static.]) -fi - # libRTMP if test "$use_librtmp" != "no"; then PKG_CHECK_MODULES([LIBRTMP], [librtmp], diff --git a/xbmc/android/activity/XBMCApp.cpp b/xbmc/android/activity/XBMCApp.cpp index e598df36b6..a9c66a93af 100644 --- a/xbmc/android/activity/XBMCApp.cpp +++ b/xbmc/android/activity/XBMCApp.cpp @@ -87,6 +87,9 @@ ANativeActivity *CXBMCApp::m_activity = NULL; ANativeWindow* CXBMCApp::m_window = NULL; int CXBMCApp::m_batteryLevel = 0; int CXBMCApp::m_initialVolume = 0; +CCriticalSection CXBMCApp::m_applicationsMutex; +std::vector<androidPackage> CXBMCApp::m_applications; + CXBMCApp::CXBMCApp(ANativeActivity* nativeActivity) : CJNIContext(nativeActivity) @@ -129,6 +132,12 @@ void CXBMCApp::onResume() CJNIIntentFilter batteryFilter; batteryFilter.addAction("android.intent.action.BATTERY_CHANGED"); registerReceiver(*this, batteryFilter); + + // Clear the applications cache. We could have installed/deinstalled apps + { + CSingleLock lock(m_applicationsMutex); + m_applications.clear(); + } } void CXBMCApp::onPause() @@ -349,22 +358,27 @@ int CXBMCApp::GetDPI() return dpi; } -bool CXBMCApp::ListApplications(vector<androidPackage> *applications) +std::vector<androidPackage> CXBMCApp::GetApplications() { - CJNIList<CJNIApplicationInfo> packageList = GetPackageManager().getInstalledApplications(CJNIPackageManager::GET_ACTIVITIES); - int numPackages = packageList.size(); - for (int i = 0; i < numPackages; i++) + CSingleLock lock(m_applicationsMutex); + if (m_applications.empty()) { - androidPackage newPackage; - newPackage.packageName = packageList.get(i).packageName; - newPackage.packageLabel = GetPackageManager().getApplicationLabel(packageList.get(i)).toString(); - CJNIIntent intent = GetPackageManager().getLaunchIntentForPackage(newPackage.packageName); - if (!intent || !intent.hasCategory("android.intent.category.LAUNCHER")) - continue; - - applications->push_back(newPackage); + CJNIList<CJNIApplicationInfo> packageList = GetPackageManager().getInstalledApplications(CJNIPackageManager::GET_ACTIVITIES); + int numPackages = packageList.size(); + for (int i = 0; i < numPackages; i++) + { + androidPackage newPackage; + newPackage.packageName = packageList.get(i).packageName; + newPackage.packageLabel = GetPackageManager().getApplicationLabel(packageList.get(i)).toString(); + CJNIIntent intent = GetPackageManager().getLaunchIntentForPackage(newPackage.packageName); + if (!intent || !intent.hasCategory("android.intent.category.LAUNCHER")) + continue; + + m_applications.push_back(newPackage); + } } - return true; + + return m_applications; } bool CXBMCApp::GetIconSize(const string &packageName, int *width, int *height) diff --git a/xbmc/android/activity/XBMCApp.h b/xbmc/android/activity/XBMCApp.h index cd7d10169a..3218be2acf 100644 --- a/xbmc/android/activity/XBMCApp.h +++ b/xbmc/android/activity/XBMCApp.h @@ -86,7 +86,7 @@ public: static int GetBatteryLevel(); static bool StartActivity(const std::string &package, const std::string &intent = std::string(), const std::string &dataType = std::string(), const std::string &dataURI = std::string()); - static bool ListApplications(std::vector <androidPackage> *applications); + static std::vector <androidPackage> GetApplications(); static bool GetIconSize(const std::string &packageName, int *width, int *height); static bool GetIcon(const std::string &packageName, void* buffer, unsigned int bufSize); @@ -124,7 +124,9 @@ private: bool m_firstrun; bool m_exiting; pthread_t m_thread; - + static CCriticalSection m_applicationsMutex; + static std::vector<androidPackage> m_applications; + static ANativeWindow* m_window; static CEvent m_windowCreated; diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/VAAPI.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/VAAPI.cpp index bfefc9d899..fd3e249ab9 100644 --- a/xbmc/cores/dvdplayer/DVDCodecs/Video/VAAPI.cpp +++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/VAAPI.cpp @@ -391,7 +391,6 @@ bool CDecoder::Open(AVCodecContext *avctx, enum PixelFormat fmt, unsigned int su m_hwaccel->display = m_display->get(); avctx->hwaccel_context = m_hwaccel; - avctx->thread_count = 1; avctx->get_buffer = GetBufferS; avctx->reget_buffer = GetBufferS; avctx->release_buffer = RelBufferS; diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp index 4bc51808e6..73c4fa4a83 100644 --- a/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp +++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp @@ -589,7 +589,6 @@ bool CDecoder::Open(AVCodecContext* avctx, const enum PixelFormat fmt, unsigned avctx->draw_horiz_band = CDecoder::FFDrawSlice; avctx->slice_flags=SLICE_FLAG_CODED_ORDER|SLICE_FLAG_ALLOW_FIELD; avctx->hwaccel_context = &m_hwContext; - avctx->thread_count = 1; g_Windowing.Register(this); return true; diff --git a/xbmc/filesystem/AndroidAppDirectory.cpp b/xbmc/filesystem/AndroidAppDirectory.cpp index 86a5409229..ff7502b36c 100644 --- a/xbmc/filesystem/AndroidAppDirectory.cpp +++ b/xbmc/filesystem/AndroidAppDirectory.cpp @@ -50,22 +50,21 @@ bool CAndroidAppDirectory::GetDirectory(const CStdString& strPath, CFileItemList CLog::Log(LOGDEBUG, "CAndroidAppDirectory::GetDirectory: %s",dirname.c_str()); if (dirname == "apps") { - vector<androidPackage> applications; - CXBMCApp::ListApplications(&applications); - if (!applications.size()) + vector<androidPackage> applications = CXBMCApp::GetApplications(); + if (applications.empty()) { CLog::Log(LOGERROR, "CAndroidAppDirectory::GetDirectory Application lookup listing failed"); return false; } - for(unsigned int i = 0; i < applications.size(); i++) + for(std::vector<androidPackage>::iterator i = applications.begin(); i != applications.end(); ++i) { - if (applications[i].packageName == "org.xbmc.xbmc") + if ((*i).packageName == "org.xbmc.xbmc") continue; - CFileItemPtr pItem(new CFileItem(applications[i].packageName)); + CFileItemPtr pItem(new CFileItem((*i).packageName)); pItem->m_bIsFolder = false; - CStdString path = StringUtils::Format("androidapp://%s/%s/%s", url.GetHostName().c_str(), dirname.c_str(), applications[i].packageName.c_str()); + std::string path = StringUtils::Format("androidapp://%s/%s/%s", url.GetHostName().c_str(), dirname.c_str(), (*i).packageName.c_str()); pItem->SetPath(path); - pItem->SetLabel(applications[i].packageLabel); + pItem->SetLabel((*i).packageLabel); pItem->SetArt("thumb", path+".png"); items.Add(pItem); } diff --git a/xbmc/filesystem/AndroidAppFile.cpp b/xbmc/filesystem/AndroidAppFile.cpp index 3aa5a65dae..0c7361df3b 100644 --- a/xbmc/filesystem/AndroidAppFile.cpp +++ b/xbmc/filesystem/AndroidAppFile.cpp @@ -45,17 +45,33 @@ CFileAndroidApp::~CFileAndroidApp(void) bool CFileAndroidApp::Open(const CURL& url) { - m_url = url; m_appname = URIUtils::GetFileName(url.Get()); m_appname = m_appname.substr(0, m_appname.size() - 4); - return m_appname.size() > 0; + std::vector<androidPackage> applications = CXBMCApp::GetApplications(); + for(std::vector<androidPackage>::iterator i = applications.begin(); i != applications.end(); ++i) + { + if ((*i).packageName == m_appname) + return true; + } + + return false; } bool CFileAndroidApp::Exists(const CURL& url) { - return true; + std::string appname = URIUtils::GetFileName(url.Get()); + appname = appname.substr(0, appname.size() - 4); + + std::vector<androidPackage> applications = CXBMCApp::GetApplications(); + for(std::vector<androidPackage>::iterator i = applications.begin(); i != applications.end(); ++i) + { + if ((*i).packageName == appname) + return true; + } + + return false; } unsigned int CFileAndroidApp::Read(void* lpBuf, int64_t uiBufSize) diff --git a/xbmc/utils/BitstreamConverter.cpp b/xbmc/utils/BitstreamConverter.cpp index 80b4a22179..96516c7a14 100644 --- a/xbmc/utils/BitstreamConverter.cpp +++ b/xbmc/utils/BitstreamConverter.cpp @@ -645,6 +645,7 @@ pps: m_sps_pps_context.sps_pps_data = out; m_sps_pps_context.size = total_size; m_sps_pps_context.first_idr = 1; + m_sps_pps_context.idr_sps_pps_seen = 0; return true; } @@ -677,8 +678,12 @@ bool CBitstreamConverter::BitstreamConvert(uint8_t* pData, int iSize, uint8_t ** if (buf + nal_size > buf_end || nal_size < 0) goto fail; - // prepend only to the first type 5 NAL unit of an IDR picture - if (m_sps_pps_context.first_idr && unit_type == 5) + // Don't add sps/pps if the unit already contain them + if (m_sps_pps_context.first_idr && (unit_type == 7 || unit_type == 8)) + m_sps_pps_context.idr_sps_pps_seen = 1; + + // prepend only to the first access unit of an IDR picture, if no sps/pps already present + if (m_sps_pps_context.first_idr && unit_type == 5 && !m_sps_pps_context.idr_sps_pps_seen) { BitstreamAllocAndCopy(poutbuf, poutbuf_size, m_sps_pps_context.sps_pps_data, m_sps_pps_context.size, buf, nal_size); @@ -688,7 +693,10 @@ bool CBitstreamConverter::BitstreamConvert(uint8_t* pData, int iSize, uint8_t ** { BitstreamAllocAndCopy(poutbuf, poutbuf_size, NULL, 0, buf, nal_size); if (!m_sps_pps_context.first_idr && unit_type == 1) + { m_sps_pps_context.first_idr = 1; + m_sps_pps_context.idr_sps_pps_seen = 0; + } } buf += nal_size; diff --git a/xbmc/utils/BitstreamConverter.h b/xbmc/utils/BitstreamConverter.h index d3ad34672a..f6f53125c2 100644 --- a/xbmc/utils/BitstreamConverter.h +++ b/xbmc/utils/BitstreamConverter.h @@ -182,6 +182,7 @@ protected: typedef struct omx_bitstream_ctx { uint8_t length_size; uint8_t first_idr; + uint8_t idr_sps_pps_seen; uint8_t *sps_pps_data; uint32_t size; } omx_bitstream_ctx; |