From ad7f9f7f029b6ab0644456de16602d1788a506ad Mon Sep 17 00:00:00 2001 From: Adam Williamson Date: Oct 04 2021 15:58:36 +0000 Subject: Backport fixes for https://bugs.launchpad.net/soundconverter/+bug/1945838 --- diff --git a/0001-Read-tags-in-both-root-info-and-audio-streams.patch b/0001-Read-tags-in-both-root-info-and-audio-streams.patch new file mode 100644 index 0000000..c6bc0c9 --- /dev/null +++ b/0001-Read-tags-in-both-root-info-and-audio-streams.patch @@ -0,0 +1,65 @@ +From b47060eec9645ea8d89b8b3aa488c6ceeab8e088 Mon Sep 17 00:00:00 2001 +From: Adam Williamson +Date: Mon, 4 Oct 2021 08:52:45 -0700 +Subject: [PATCH] Read tags in both root info and audio streams + +This is needed because gstreamer 1.19.2 does not add tags +to the root anymore, they are only present at stream level. +Also includes assorted related fixes/improvements to the same +code. +--- + soundconverter/gstreamer/discoverer.py | 13 ++++++++++--- + tests/test data/no tags/no-tags.flac | Bin 0 -> 132423 bytes + tests/test data/no tags/no-tags.mp3 | Bin 0 -> 13095 bytes + tests/test data/no tags/no-tags.ogg | Bin 0 -> 15381 bytes + tests/test.py | 3 ++- + tests/testcases/batch.py | 24 ++++++++++++++++++------ + tests/testcases/integration.py | 14 ++++++++++++++ + 7 files changed, 44 insertions(+), 10 deletions(-) + create mode 100644 tests/test data/no tags/no-tags.flac + create mode 100644 tests/test data/no tags/no-tags.mp3 + create mode 100644 tests/test data/no tags/no-tags.ogg + +diff --git a/soundconverter/gstreamer/discoverer.py b/soundconverter/gstreamer/discoverer.py +index 1ee76c9..93d2024 100644 +--- a/soundconverter/gstreamer/discoverer.py ++++ b/soundconverter/gstreamer/discoverer.py +@@ -109,6 +109,7 @@ class DiscovererThread(Thread): + def _analyse_file(self, sound_file): + """Figure out readable, tags and duration properties.""" + sound_file.readable = False ++ + denylisted_pattern = is_denylisted(sound_file) + if denylisted_pattern: + logger.info('filename denylisted ({}): {}'.format( +@@ -123,9 +124,15 @@ class DiscovererThread(Thread): + # whatever anybody might ever need from it, here it is: + sound_file.info = info + ++ # Read root tags + taglist = info.get_tags() +- if not taglist: return +- taglist.foreach(lambda *args: self._add_tag(*args, sound_file)) ++ if taglist: ++ taglist.foreach(lambda *args: self._add_tag(*args, sound_file)) ++ ++ for audio_stream in info.get_audio_streams(): ++ # Read tags for each audio stream ++ taglist = audio_stream.get_tags() ++ taglist.foreach(lambda *args: self._add_tag(*args, sound_file)) + + filename = sound_file.filename_for_display + logger.debug('found tag: {}'.format(filename)) +@@ -135,8 +142,8 @@ class DiscovererThread(Thread): + # since threads share memory, this doesn't have to be sent + # over a bus or queue, but rather can be written into the + # sound_file +- sound_file.readable = True + sound_file.duration = info.get_duration() / Gst.SECOND ++ sound_file.readable = True + except Exception as error: + if not isinstance(error, GLib.Error): + logger.error(str(error)) +-- +2.32.0 + diff --git a/soundconverter.spec b/soundconverter.spec index 67686c8..397a26e 100644 --- a/soundconverter.spec +++ b/soundconverter.spec @@ -1,12 +1,19 @@ Name: soundconverter Version: 4.0.1 -Release: 3%{?dist} +Release: 4%{?dist} Summary: Simple sound converter application for GNOME License: GPLv3 URL: http://soundconverter.org Source0: http://launchpad.net/%{name}/trunk/%{version}/+download/%{name}-%{version}.tar.gz Patch0: %{name}-appdata.patch +# Contains the series of fixes related to +# https://bugs.launchpad.net/soundconverter/+bug/1945838 +# from py3k branch, after a revert of the 4.0.1-only patch that +# prevents those fixes applying *(and is superseded by them) +# changes to tests are dropped as binary patches don't apply with +# autosetup, and we don't run the tests anyway +Patch1: 0001-Read-tags-in-both-root-info-and-audio-streams.patch BuildArch: noarch @@ -80,6 +87,9 @@ rm -f %{buildroot}%{_datadir}/glib-2.0/schemas/gschemas.compiled %changelog +* Mon Oct 04 2021 Adam Williamson - 4.0.1-4 +- Backport fixes for https://bugs.launchpad.net/soundconverter/+bug/1945838 + * Fri Jul 23 2021 Fedora Release Engineering - 4.0.1-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild