[vlc-commits] [Git][videolan/libvlcpp][master] Fix build with libvlc 3.x

Hugo Beauzée-Luyssen gitlab at videolan.org
Mon Jun 15 10:34:08 CEST 2020



Hugo Beauzée-Luyssen pushed to branch master at VideoLAN / libvlcpp


Commits:
7a026fa6 by Hugo Beauzée-Luyssen at 2020-06-15T10:27:39+02:00
Fix build with libvlc 3.x

- - - - -


4 changed files:

- test/main.cpp
- vlcpp/Media.hpp
- vlcpp/MediaPlayer.hpp
- vlcpp/structures.hpp


Changes:

=====================================
test/main.cpp
=====================================
@@ -105,10 +105,12 @@ int main(int ac, char** av)
     auto lFunc = std::function<void(float)>{ l };
     auto h1 = mp.eventManager().onTimeChanged(lFunc);
     auto h2 = mp.eventManager().onPositionChanged(lFunc);
+#if LIBVLC_VERSION_INT >= LIBVLC_VERSION(4, 0, 0, 0)
     mp.eventManager().onTitleSelectionChanged(
                 [](const VLC::TitleDescription& t, int idx ) {
         std::cout << "New title selected: " << t.name() << " at index " << idx << std::endl;
     });
+#endif
 
     std::this_thread::sleep_for( std::chrono::seconds( 2 ) );
 


=====================================
vlcpp/Media.hpp
=====================================
@@ -662,7 +662,7 @@ public:
             return nullptr;
         return std::make_shared<TrackList>( trackList );
     }
-#elif #if LIBVLC_VERSION_INT >= LIBVLC_VERSION(3, 0, 0, 0)
+#elif LIBVLC_VERSION_INT >= LIBVLC_VERSION(3, 0, 0, 0)
     std::vector<MediaTrack> tracks()
     {
         libvlc_media_track_t**  tracks;


=====================================
vlcpp/MediaPlayer.hpp
=====================================
@@ -1841,7 +1841,7 @@ public:
 
 #endif
 
-#if LIBVLC_VERSION_INT >= LIBVLC_VERSION(3, 0, 0, 0)
+#if LIBVLC_VERSION_INT >= LIBVLC_VERSION(4, 0, 0, 0)
 
     std::shared_ptr<TrackList> tracks( libvlc_track_type_t type )
     {


=====================================
vlcpp/structures.hpp
=====================================
@@ -341,7 +341,7 @@ public:
     }
 #endif
 
-#if LIBVLC_VERSION_INT >= LIBVLC_VERSION(3, 0, 0, 0)
+#if LIBVLC_VERSION_INT >= LIBVLC_VERSION(4, 0, 0, 0)
     const std::string& idStr() const
     {
         return m_idStr;
@@ -391,10 +391,12 @@ public:
             m_language = c->psz_language;
         if ( c->psz_description != nullptr )
             m_description = c->psz_description;
+#if LIBVLC_VERSION_INT >= LIBVLC_VERSION(4, 0, 0, 0)
         if ( c->psz_id != nullptr )
             m_idStr = c->psz_id;
         if ( c->psz_name )
             m_name = c->psz_name;
+#endif
         switch ( c->i_type )
         {
             case libvlc_track_audio:



View it on GitLab: https://code.videolan.org/videolan/libvlcpp/-/commit/7a026fa6874a2e755a685d5f8794f758ab5ab3be

-- 
View it on GitLab: https://code.videolan.org/videolan/libvlcpp/-/commit/7a026fa6874a2e755a685d5f8794f758ab5ab3be
You're receiving this email because of your account on code.videolan.org.




More information about the vlc-commits mailing list