[vlc-commits] contrib: medialibrary: Bump version
Hugo Beauzée-Luyssen
git at videolan.org
Tue Oct 29 11:56:13 CET 2019
vlc | branch: master | Hugo Beauzée-Luyssen <hugo at beauzee.fr> | Thu Oct 10 17:10:48 2019 +0200| [7b81168938cf2fd2217cbc5bf701ab23ad8655b9] | committer: Hugo Beauzée-Luyssen
contrib: medialibrary: Bump version
And reflect the API changes
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=7b81168938cf2fd2217cbc5bf701ab23ad8655b9
---
contrib/src/medialibrary/rules.mak | 4 ++--
include/vlc_media_library.h | 4 ++++
modules/misc/medialibrary/fs/directory.cpp | 13 ++++++-------
modules/misc/medialibrary/fs/file.cpp | 2 +-
modules/misc/medialibrary/fs/file.h | 2 +-
modules/misc/medialibrary/medialib.cpp | 7 +++++++
modules/misc/medialibrary/medialibrary.h | 1 +
7 files changed, 22 insertions(+), 11 deletions(-)
diff --git a/contrib/src/medialibrary/rules.mak b/contrib/src/medialibrary/rules.mak
index dcf198e18c..a868819a5a 100644
--- a/contrib/src/medialibrary/rules.mak
+++ b/contrib/src/medialibrary/rules.mak
@@ -1,4 +1,4 @@
-MEDIALIBRARY_HASH := 18148bcaf26964d22ebdda26a475ed1ed533046b
+MEDIALIBRARY_HASH := a6a3bf2cf19fcff5c816ac478ad4086fa9ea4193
MEDIALIBRARY_VERSION := git-$(MEDIALIBRARY_HASH)
MEDIALIBRARY_GITURL := https://code.videolan.org/videolan/medialibrary.git
@@ -10,7 +10,7 @@ endif
DEPS_medialibrary = sqlite $(DEPS_sqlite)
$(TARBALLS)/medialibrary-$(MEDIALIBRARY_VERSION).tar.xz:
- $(call download_git,$(MEDIALIBRARY_GITURL),,$(MEDIALIBRARY_HASH))
+ $(call download_git,$(MEDIALIBRARY_GITURL),0.6.x,$(MEDIALIBRARY_HASH))
.sum-medialibrary: medialibrary-$(MEDIALIBRARY_VERSION).tar.xz
$(call check_githash,$(MEDIALIBRARY_HASH))
diff --git a/include/vlc_media_library.h b/include/vlc_media_library.h
index 8c599a3710..00227f46ba 100644
--- a/include/vlc_media_library.h
+++ b/include/vlc_media_library.h
@@ -641,6 +641,10 @@ enum vlc_ml_event_type
* vlc_ml_event_t::history_changed::history_type
*/
VLC_ML_EVENT_HISTORY_CHANGED,
+ /**
+ * Sent when an application requested rescan starts being processed.
+ */
+ VLC_ML_EVENT_RESCAN_STARTED,
};
typedef struct vlc_ml_event_t
diff --git a/modules/misc/medialibrary/fs/directory.cpp b/modules/misc/medialibrary/fs/directory.cpp
index f370ef147c..6aa8c48f91 100644
--- a/modules/misc/medialibrary/fs/directory.cpp
+++ b/modules/misc/medialibrary/fs/directory.cpp
@@ -35,6 +35,7 @@
#include <vlc_input.h>
#include <vlc_threads.h>
#include <vlc_cxx_helpers.hpp>
+#include <medialibrary/filesystem/Errors.h>
using InputItemPtr = vlc_shared_data_ptr_type(input_item_t,
input_item_Hold,
@@ -92,7 +93,7 @@ std::shared_ptr<IFile> SDDirectory::file(const std::string& mrl) const
return f->name() == fileName;
});
if ( it == cend( fs ) )
- throw std::runtime_error( mrl + " wasn't found in the directory" );
+ throw medialibrary::fs::errors::NotFound( mrl, m_mrl );
return *it;
}
@@ -168,9 +169,8 @@ static bool request_metadata_sync( libvlc_int_t *libvlc, input_item_t *media,
auto res = req.cond.timedwait( req.lock, deadline );
if (res != 0 )
{
- throw std::system_error( ETIMEDOUT, std::generic_category(),
- "Failed to browse network directory: "
- "Network is too slow");
+ throw medialibrary::fs::errors::System( ETIMEDOUT,
+ "Failed to browse network directory: Network is too slow" );
}
}
return req.success;
@@ -189,9 +189,8 @@ SDDirectory::read() const
auto status = request_metadata_sync( m_fs.libvlc(), media.get(), &children);
if ( status == false )
- throw std::system_error(EIO, std::generic_category(),
- "Failed to browse network directory: "
- "Unknown error");
+ throw medialibrary::fs::errors::System( EIO,
+ "Failed to browse network directory: Unknown error" );
for (const InputItemPtr &m : children)
{
diff --git a/modules/misc/medialibrary/fs/file.cpp b/modules/misc/medialibrary/fs/file.cpp
index f6c6c04397..1dd98a5c06 100644
--- a/modules/misc/medialibrary/fs/file.cpp
+++ b/modules/misc/medialibrary/fs/file.cpp
@@ -59,7 +59,7 @@ SDFile::lastModificationDate() const
return 0;
}
-unsigned int
+int64_t
SDFile::size() const
{
return 0;
diff --git a/modules/misc/medialibrary/fs/file.h b/modules/misc/medialibrary/fs/file.h
index 18ecf2b1d8..bb0525b4d9 100644
--- a/modules/misc/medialibrary/fs/file.h
+++ b/modules/misc/medialibrary/fs/file.h
@@ -37,7 +37,7 @@ public:
const std::string& name() const override;
const std::string& extension() const override;
unsigned int lastModificationDate() const override;
- unsigned int size() const override;
+ int64_t size() const override;
inline bool isNetwork() const override { return true; }
private:
diff --git a/modules/misc/medialibrary/medialib.cpp b/modules/misc/medialibrary/medialib.cpp
index 5a9fe5098c..cb5d4007f9 100644
--- a/modules/misc/medialibrary/medialib.cpp
+++ b/modules/misc/medialibrary/medialib.cpp
@@ -335,6 +335,13 @@ void MediaLibrary::onHistoryChanged( medialibrary::HistoryType historyType )
m_vlc_ml->cbs->pf_send_event( m_vlc_ml, &ev );
}
+void MediaLibrary::onRescanStarted()
+{
+ vlc_ml_event_t ev;
+ ev.i_type = VLC_ML_EVENT_RESCAN_STARTED;
+ m_vlc_ml->cbs->pf_send_event( m_vlc_ml, &ev );
+}
+
MediaLibrary::MediaLibrary( vlc_medialibrary_module_t* ml )
: m_vlc_ml( ml )
{
diff --git a/modules/misc/medialibrary/medialibrary.h b/modules/misc/medialibrary/medialibrary.h
index 5a0db1fe41..0acbe10e38 100644
--- a/modules/misc/medialibrary/medialibrary.h
+++ b/modules/misc/medialibrary/medialibrary.h
@@ -196,6 +196,7 @@ public:
medialibrary::ThumbnailSizeType sizeType,
bool success) override;
virtual void onHistoryChanged( medialibrary::HistoryType historyType ) override;
+ virtual void onRescanStarted() override;
};
bool Convert( const medialibrary::IMedia* input, vlc_ml_media_t& output );
More information about the vlc-commits
mailing list