[soundconverter] Fix aborted task queue.

Michael Schwendt mschwendt at fedoraproject.org
Sun Feb 10 18:22:27 UTC 2013


commit ff7a691636562e9e82280e9aa7a7e644ff60bdcc
Author: Michael Schwendt <mschwendt at fedoraproject.org>
Date:   Sun Feb 10 19:22:13 2013 +0100

    Fix aborted task queue.
    
    - Fix race condition between tags_read() and converter.start() (#909681).
    - Fix gstreamer.py show_error tracebacks.

 soundconverter-2.0.4-abort-conversion.patch        |   11 ++++
 soundconverter-2.0.4-gstreamer-show_error.patch    |   30 ++++++++++++
 ...dconverter-2.0.4-tagreader-converter-race.patch |   51 ++++++++++++++++++++
 soundconverter.spec                                |   16 ++++++-
 4 files changed, 107 insertions(+), 1 deletions(-)
---
diff --git a/soundconverter-2.0.4-abort-conversion.patch b/soundconverter-2.0.4-abort-conversion.patch
new file mode 100644
index 0000000..e0660f8
--- /dev/null
+++ b/soundconverter-2.0.4-abort-conversion.patch
@@ -0,0 +1,11 @@
+diff -Nur soundconverter-2.0.4-orig/soundconverter/ui.py soundconverter-2.0.4/soundconverter/ui.py
+--- soundconverter-2.0.4-orig/soundconverter/ui.py	2012-10-06 12:43:23.000000000 +0200
++++ soundconverter-2.0.4/soundconverter/ui.py	2013-02-10 18:19:45.128353502 +0100
+@@ -1430,6 +1430,7 @@
+         self.filelist.hide_row_progress()
+         self.status_frame.show()
+         self.widget.set_sensitive(True)
++        self.converter.abort()
+         try:
+             from gi.repository import Unity
+             launcher = Unity.LauncherEntry.get_for_desktop_id ("soundconverter.desktop")
diff --git a/soundconverter-2.0.4-gstreamer-show_error.patch b/soundconverter-2.0.4-gstreamer-show_error.patch
new file mode 100644
index 0000000..793acaf
--- /dev/null
+++ b/soundconverter-2.0.4-gstreamer-show_error.patch
@@ -0,0 +1,30 @@
+diff -Nur soundconverter-2.0.4-orig/soundconverter/gstreamer.py soundconverter-2.0.4/soundconverter/gstreamer.py
+--- soundconverter-2.0.4-orig/soundconverter/gstreamer.py	2012-10-04 13:56:26.000000000 +0200
++++ soundconverter-2.0.4/soundconverter/gstreamer.py	2013-02-10 14:57:32.940211007 +0100
+@@ -187,7 +187,7 @@
+             return
+         self.done()
+         if result == gst.pbutils.INSTALL_PLUGINS_USER_ABORT:
+-            show_error(_('Plugin installation aborted.'))
++            show_error('Error',_('Plugin installation aborted.'))
+             return
+ 
+         show_error('Error', 'failed to install plugins: %s' % gobject.markup_escape_text(str(result)))
+@@ -518,7 +518,7 @@
+         if not encoder:
+             # TODO: is this used ?
+             # TODO: add proper error management when an encoder cannot be created
+-            show_error(_("Cannot create a decoder for \'%s\' format.") % 
++            show_error('Error',_("Cannot create a decoder for \'%s\' format.") % 
+                         self.output_type)
+             return
+ 
+@@ -529,7 +529,7 @@
+         if dirname and not gnomevfs.exists(dirname):
+             log('Creating folder: \'%s\'' % dirname)
+             if not vfs_makedirs(str(dirname)):
+-                show_error(_("Cannot create \'%s\' folder.") % dirname)
++                show_error('Error',_("Cannot create \'%s\' folder.") % dirname)
+                 return
+ 
+         self.add_command('%s location="%s"' % (
diff --git a/soundconverter-2.0.4-tagreader-converter-race.patch b/soundconverter-2.0.4-tagreader-converter-race.patch
new file mode 100644
index 0000000..22858fa
--- /dev/null
+++ b/soundconverter-2.0.4-tagreader-converter-race.patch
@@ -0,0 +1,51 @@
+diff -Nur soundconverter-2.0.4-orig/soundconverter/ui.py soundconverter-2.0.4/soundconverter/ui.py
+--- soundconverter-2.0.4-orig/soundconverter/ui.py	2012-10-06 12:43:23.000000000 +0200
++++ soundconverter-2.0.4/soundconverter/ui.py	2013-02-10 19:10:58.353493331 +0100
+@@ -1300,6 +1300,7 @@
+ 
+     def read_tags(self, sound_file):
+         if sound_file.tags_read: # TODO: factorize
++            self.wait_for_tags -= 1
+             self.converter.add(sound_file)
+             return
+ 
+@@ -1309,7 +1310,8 @@
+ 
+     def tags_read(self, tagreader):
+         sound_file = tagreader.get_sound_file()
+-        self.converter.add(sound_file)
++        self.wait_for_tags -= 1
++        self.tag_reader_completed.append(sound_file)
+ 
+     def on_progress(self):
+         if self.pulse_progress >= 0: # still waiting for tags
+@@ -1336,6 +1338,7 @@
+         return running
+ 
+     def do_convert(self):
++        self.tag_reader_completed = []
+         try:
+             self.pulse_progress = -1
+             gobject.timeout_add(100, self.on_progress)
+@@ -1345,6 +1348,7 @@
+                 self.progressbar.set_text(_('Preparing conversion...'))
+             files = self.filelist.get_files()
+             total = len(files)
++            self.wait_for_tags = total
+             for i, sound_file in enumerate(files):
+                 gtk_iteration()
+                 self.pulse_progress = float(i)/total
+@@ -1354,6 +1358,13 @@
+                 else:
+                     self.converter.add(sound_file)
+ 
++            if self.prefs.require_tags:
++                while self.wait_for_tags > 0:
++                    gtk_sleep(1)
++            for sound_file in self.tag_reader_completed:
++                self.converter.add(sound_file)
++            del self.tag_reader_completed
++
+         except ConverterQueueCanceled:
+             log('cancelling conversion.')
+             self.conversion_ended()
diff --git a/soundconverter.spec b/soundconverter.spec
index a8db279..43f36fa 100644
--- a/soundconverter.spec
+++ b/soundconverter.spec
@@ -2,7 +2,7 @@
 
 Name:           soundconverter
 Version:        2.0.4
-Release:        8%{?dist}
+Release:        9%{?dist}
 Summary:        Simple sound converter application for GNOME
 
 Group:          Applications/Multimedia
@@ -17,6 +17,12 @@ Patch0: soundconverter-2.0.4-no-space-left.patch
 Patch1: soundconverter-2.0.4-folder-choose.patch
 # lp #1087901
 Patch2: soundconverter-2.0.4-rootfiles.patch
+# lp #1121164
+Patch3: soundconverter-2.0.4-gstreamer-show_error.patch
+# lp #1121192
+Patch4: soundconverter-2.0.4-tagreader-converter-race.patch
+# lp #1121297
+Patch5: soundconverter-2.0.4-abort-conversion.patch
 
 BuildRequires:  desktop-file-utils
 BuildRequires:  intltool gettext
@@ -58,6 +64,9 @@ writes anything the GStreamer library can.
 %patch0 -p1 -b .no-space-left
 %patch1 -p1 -b .folder-choose
 %patch2 -p1 -b .rootfiles
+%patch3 -p1 -b .gstreamer-show-error
+%patch4 -p1 -b .tagreader-converter-race
+%patch5 -p1 -b .abort-conversion
 
 
 %build
@@ -108,6 +117,11 @@ update-desktop-database &> /dev/null ||:
 
 
 %changelog
+* Sun Feb 10 2013 Michael Schwendt <mschwendt at fedoraproject.org> - 2.0.4-9
+- Fix aborted task queue.
+- Fix race condition between tags_read() and converter.start() (#909681).
+- Fix gstreamer.py show_error tracebacks.
+
 * Mon Dec 10 2012 Michael Schwendt <mschwendt at fedoraproject.org> - 2.0.4-8
 - Merge fix for accessing files in filesystem root dir (#1087901).
 


More information about the scm-commits mailing list