diff -Nru phonon-backend-vlc-0.11.2/CMakeLists.txt phonon-backend-vlc-0.11.3/CMakeLists.txt --- phonon-backend-vlc-0.11.2/CMakeLists.txt 2021-02-04 10:39:36.000000000 +0000 +++ phonon-backend-vlc-0.11.3/CMakeLists.txt 2021-03-26 15:13:01.000000000 +0000 @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 3.5 FATAL_ERROR) -project(PhononVLC VERSION 0.11.2) +project(PhononVLC VERSION 0.11.3) set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") diff -Nru phonon-backend-vlc-0.11.2/debian/changelog phonon-backend-vlc-0.11.3/debian/changelog --- phonon-backend-vlc-0.11.2/debian/changelog 2021-02-04 23:34:41.000000000 +0000 +++ phonon-backend-vlc-0.11.3/debian/changelog 2021-08-15 16:59:43.000000000 +0000 @@ -1,3 +1,10 @@ +phonon-backend-vlc (0.11.3-1) unstable; urgency=medium + + * Team upload. + * New upstream release. + + -- Pino Toscano Sun, 15 Aug 2021 18:59:43 +0200 + phonon-backend-vlc (0.11.2-1) unstable; urgency=medium * Team upload. diff -Nru phonon-backend-vlc-0.11.2/po/fr/phonon_vlc_qt.po phonon-backend-vlc-0.11.3/po/fr/phonon_vlc_qt.po --- phonon-backend-vlc-0.11.2/po/fr/phonon_vlc_qt.po 2021-02-04 10:39:39.000000000 +0000 +++ phonon-backend-vlc-0.11.3/po/fr/phonon_vlc_qt.po 2021-03-26 15:13:04.000000000 +0000 @@ -12,7 +12,7 @@ "POT-Creation-Date: 2019-07-01 01:50+0200\n" "PO-Revision-Date: 2021-01-13 17:49+0100\n" "Last-Translator: Xavier Besnard \n" -"Language-Team: FR\n" +"Language-Team: French \n" "Language: fr\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" diff -Nru phonon-backend-vlc-0.11.2/po/sl/phonon_vlc_qt.po phonon-backend-vlc-0.11.3/po/sl/phonon_vlc_qt.po --- phonon-backend-vlc-0.11.2/po/sl/phonon_vlc_qt.po 1970-01-01 00:00:00.000000000 +0000 +++ phonon-backend-vlc-0.11.3/po/sl/phonon_vlc_qt.po 2021-03-26 15:13:08.000000000 +0000 @@ -0,0 +1,48 @@ +# Slovenian translation of phonon_vlc. +# Copyright (C) 2011 Free Software Foundation, Inc. +# +# +# Klemen Košir , 2011. +# Andrej Vernekar , 2012. +# Andrej Mernik , 2013. +# Matjaž Jeran , 2019. +msgid "" +msgstr "" +"Project-Id-Version: phonon_vlc\n" +"Report-Msgid-Bugs-To: https://bugs.kde.org\n" +"POT-Creation-Date: \n" +"PO-Revision-Date: 2021-03-19 15:54+0100\n" +"Last-Translator: Matjaž Jeran \n" +"Language-Team: Slovenian \n" +"Language: sl\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Translator: Andrej Mernik \n" +"Plural-Forms: nplurals=4; plural=(n%100==1 ? 0 : n%100==2 ? 1 : n%100>=3 && n" +"%100<=4 ? 2 : 3);\n" +"X-Generator: Poedit 2.4.2\n" +"X-Qt-Contexts: true\n" + +#: src/backend.cpp:132 +msgctxt "Phonon::VLC::Backend|" +msgid "LibVLC Failed to Initialize" +msgstr "Začetnih vrednosti knjižnice libVLC ni bilo mogoče nastaviti" + +#: src/backend.cpp:133 +msgctxt "Phonon::VLC::Backend|" +msgid "" +"Phonon's VLC backend failed to start.\n" +"\n" +"This usually means a problem with your VLC installation, please report a bug " +"with your distributor." +msgstr "" +"Zaledja VLC za Phonon ni bilo mogoče zagnati.\n" +"\n" +"Razlog za to napako je ponavadi težava z namestitvijo programa VLC. Prosimo " +"sporočite napako vašemu distributerju." + +#: src/devicemanager.cpp:214 +msgctxt "Phonon::VLC::DeviceManager|" +msgid "Default" +msgstr "Privzeto" \ No newline at end of file diff -Nru phonon-backend-vlc-0.11.2/po/zh_CN/phonon_vlc_qt.po phonon-backend-vlc-0.11.3/po/zh_CN/phonon_vlc_qt.po --- phonon-backend-vlc-0.11.2/po/zh_CN/phonon_vlc_qt.po 2021-02-04 10:39:46.000000000 +0000 +++ phonon-backend-vlc-0.11.3/po/zh_CN/phonon_vlc_qt.po 2021-03-26 15:13:10.000000000 +0000 @@ -1,7 +1,7 @@ msgid "" msgstr "" "Project-Id-Version: kdeorg\n" -"PO-Revision-Date: 2021-02-03 16:17\n" +"PO-Revision-Date: 2021-03-14 15:44\n" "Language-Team: Chinese Simplified\n" "Language: zh_CN\n" "MIME-Version: 1.0\n" diff -Nru phonon-backend-vlc-0.11.2/src/mediaobject.cpp phonon-backend-vlc-0.11.3/src/mediaobject.cpp --- phonon-backend-vlc-0.11.2/src/mediaobject.cpp 2021-02-04 10:39:36.000000000 +0000 +++ phonon-backend-vlc-0.11.3/src/mediaobject.cpp 2021-03-26 15:13:01.000000000 +0000 @@ -4,7 +4,7 @@ Copyright (C) 2009 Fathi Boudra Copyright (C) 2010 Ben Cooksley Copyright (C) 2009-2011 vlc-phonon AUTHORS - Copyright (C) 2010-2015 Harald Sitter + Copyright (C) 2010-2021 Harald Sitter This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -109,6 +109,10 @@ m_stateAfterBuffering = ErrorState; resetMediaController(); + + // Forcefully shutdown plusesupport to prevent crashing between the PS PA glib mainloop + // and the VLC PA threaded mainloop. See destructor. + PulseSupport::shutdown(); } void MediaObject::play() diff -Nru phonon-backend-vlc-0.11.2/src/video/videowidget.cpp phonon-backend-vlc-0.11.3/src/video/videowidget.cpp --- phonon-backend-vlc-0.11.2/src/video/videowidget.cpp 2021-02-04 10:39:36.000000000 +0000 +++ phonon-backend-vlc-0.11.3/src/video/videowidget.cpp 2021-03-26 15:13:01.000000000 +0000 @@ -3,7 +3,7 @@ Copyright (C) 2008 Lukas Durfina Copyright (C) 2009 Fathi Boudra Copyright (C) 2009-2011 vlc-phonon AUTHORS - Copyright (C) 2011-2019 Harald Sitter + Copyright (C) 2011-2021 Harald Sitter This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -48,16 +48,20 @@ // Plus VLC can actually skip frames as necessary. QMutexLocker lock(&m_mutex); Q_UNUSED(event); + + if (m_frame.isNull()) { + return; + } + QPainter painter(widget); // When using OpenGL for the QPaintEngine drawing the same QImage twice // does not actually result in a texture change for one reason or another. - // So we simply create new iamges for every event. This is plenty cheap + // So we simply create new images for every event. This is plenty cheap // as the QImage only points to the plane data (it can't even make it // properly shared as it does not know that the data belongs to a QBA). - painter.drawImage(drawFrameRect(), - QImage(reinterpret_cast(m_plane.constData()), - m_frame.width(), m_frame.height(), - m_frame.bytesPerLine(), m_frame.format())); + // TODO: investigate if this is still necessary. This was added for gwenview, but with Qt 5.15 the problem + // can't be produced. + painter.drawImage(drawFrameRect(), QImage(m_frame)); event->accept(); } @@ -67,7 +71,7 @@ virtual void *lockCallback(void **planes) { m_mutex.lock(); - planes[0] = (void *) m_plane.data(); + planes[0] = (void *) m_frame.bits(); return 0; } @@ -90,21 +94,42 @@ unsigned *pitches, unsigned *lines) { + QMutexLocker lock(&m_mutex); + // Surface rendering is a fallback system used when no efficient rendering implementation is available. + // As such we only support RGB32 for simplicity reasons and this will almost always mean software scaling. + // And since scaling is unavoidable anyway we take the canonical frame size and then scale it on our end via + // QPainter, again, greater simplicity at likely no real extra cost since this is all super inefficient anyway. + // Also, since aspect ratio can be change mid-playback by the user, doing the scaling on our end means we + // don't need to restart the entire player to retrigger format calculation. + // With all that in mind we simply use the canonical size and feed VLC the QImage's pitch and lines as + // effectively the VLC vout is the QImage so its constraints matter. + + // per https://wiki.videolan.org/Hacker_Guide/Video_Filters/#Pitch.2C_visible_pitch.2C_planes_et_al. + // it would seem that we can use either real or visible pitches and lines as VLC generally will iterate the + // smallest value when moving data between two entities. i.e. since QImage will at most paint NxM anyway, + // we may just go with its values as calculating the real pitch/line of the VLC picture_t for RV32 wouldn't + // change the maximum pitch/lines we can paint on the output side. + qstrcpy(chroma, "RV32"); - unsigned bufferSize = setPitchAndLines(vlc_fourcc_GetChromaDescription(VLC_CODEC_RGB32), - *width, *height, - pitches, lines); - m_plane.resize(bufferSize); - m_frame = QImage(reinterpret_cast(m_plane.constData()), - *width, *height, pitches[0], QImage::Format_RGB32); - return bufferSize; + m_frame = QImage(*width, *height, QImage::Format_RGB32); + Q_ASSERT(!m_frame.isNull()); // ctor may construct null if allocation fails + m_frame.fill(0); + pitches[0] = m_frame.bytesPerLine(); + lines[0] = m_frame.sizeInBytes() / m_frame.bytesPerLine(); + + return m_frame.sizeInBytes(); } virtual void formatCleanUpCallback() { // Lazy delete the object to avoid callbacks from VLC after deletion. - if (!widget) + if (!widget) { + // The widget member is set to null by the widget destructor, so when this condition is true the + // widget had already been destroyed and we can't possibly receive a paint event anymore, meaning + // we need no lock here. If it were any other way we'd have trouble with synchronizing deletion + // without deleting a locked mutex. delete this; + } } QRect scaleToAspect(QRect srcRect, int w, int h) const @@ -165,9 +190,8 @@ return drawFrameRect; } + // Could ReadWriteLock two frames so VLC can write while we paint. QImage m_frame; - // We need an idependent plane as QImage needs to be forced to use the right stride/pitch. - QByteArray m_plane; QMutex m_mutex; };