https://bugs.kde.org/show_bug.cgi?id=407153

--- Comment #9 from Wolfgang Bauer <wba...@tmo.at> ---
Full patch that fixes playback with libvlc 2.2.6 and shouldn't affect 3.0+:
@@ -170,7 +170,9 @@ VlcMediaWidget::VlcMediaWidget(QWidget *parent) :
AbstractMediaWidget(parent),
     typeOfDevice(""), trackNumber(1), numTracks(1)
 {
        libvlc_event_e events[] = {
+#if LIBVLC_VERSION_MAJOR > 2
                libvlc_MediaMetaChanged,
+#endif
                libvlc_MediaPlayerEncounteredError,
                libvlc_MediaPlayerEndReached,
                libvlc_MediaPlayerLengthChanged,
@@ -517,6 +490,13 @@ int VlcMediaWidget::makePlay()
                return -1;
        }

+#if LIBVLC_VERSION_MAJOR <= 2
+       libvlc_event_manager_t *eventManager =
libvlc_media_event_manager(vlcMedia);
+       if (libvlc_event_attach(eventManager, libvlc_MediaMetaChanged,
vlcEventHandler, this) != 0) {
+                       qCWarning(logMediaWidget, "Cannot attach event handler
%d", libvlc_MediaMetaChanged);
+       }
+#endif
+
        libvlc_media_player_set_media(vlcMediaPlayer, vlcMedia);

        /*

I haven't noticed problems with 2.2.6, tried to play an AudioCD, VideoDVD, AVI
(Xvid) file, and DVB-S (MPEG2) tv channels (also recording and playing back the
recorded file works). AudioCD track changes are notified too (they weren't
without the change to makePlay()).
This obviously leaks the eventManager though, I suppose I can look into trying
to fix that too...

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to