[soundconverter] Enhance the previous patch, and consider the case when preferences are changed after creating a list

Michael Schwendt mschwendt at fedoraproject.org
Fri Aug 19 13:06:42 UTC 2011


commit 18515485365dcdbc3df60b7b6cf9d9870eb79d0d
Author: Michael Schwendt <mschwendt at fedoraproject.org>
Date:   Fri Aug 19 15:06:21 2011 +0200

    Enhance the previous patch, and consider the case when preferences
    are changed after creating a list of input files. Also remove rejected
    FLAC files from an internal filelist, so readding them will display the
    warning dialog again.

 soundconverter-1.5.4-flacogg.patch |   37 +++++++++++++++++++++++++++++++++--
 soundconverter.spec                |    8 ++++++-
 2 files changed, 41 insertions(+), 4 deletions(-)
---
diff --git a/soundconverter-1.5.4-flacogg.patch b/soundconverter-1.5.4-flacogg.patch
index 1cb1ecb..dc2fdc3 100644
--- a/soundconverter-1.5.4-flacogg.patch
+++ b/soundconverter-1.5.4-flacogg.patch
@@ -1,6 +1,6 @@
 diff -Nur soundconverter-1.5.4-pl4/src/soundconverter.py soundconverter-1.5.4-pl5/src/soundconverter.py
 --- soundconverter-1.5.4-pl4/src/soundconverter.py	2011-08-19 13:12:46.186280952 +0200
-+++ soundconverter-1.5.4-pl5/src/soundconverter.py	2011-08-19 13:15:05.061771245 +0200
++++ soundconverter-1.5.4-pl5/src/soundconverter.py	2011-08-19 14:48:29.481147167 +0200
 @@ -48,6 +48,23 @@
  gettext.install(PACKAGE,localedir='@datadir@/locale',unicode=1)
  
@@ -34,18 +34,49 @@ diff -Nur soundconverter-1.5.4-pl4/src/soundconverter.py soundconverter-1.5.4-pl
  	parser.add_option('--help-gst', action="store_true", dest="_unused",
  		help=_('Show GStreamer Options'))
  	return parser
-@@ -1456,6 +1475,10 @@
+@@ -542,6 +561,7 @@
+ 		self.tags_read = False
+ 		self.duration = 0
+ 		self.mime_type = None
++		self.mime_type_keep = None
+ 
+ 	def get_uri(self):
+ 		return self.uri
+@@ -1056,6 +1076,7 @@
+ 		for t in mime_whitelist:
+ 			if t in mime_type:
+ 				self.sound_file.mime_type = mime_type
++		self.sound_file.mime_type_keep = mime_type
+ 		if not self.sound_file.mime_type:
+ 			log('Mime type skipped: %s' % mime_type)
+ 		self.pipeline.set_state(gst.STATE_NULL)
+@@ -1456,6 +1477,12 @@
  
  	def found_type(self, sound_file, mime):
  		debug('found_type', sound_file.get_filename())
 +		omime = _GCONF.get_string(gconfsc+'/output-mime-type')
 +		if mime == 'audio/x-flac' and omime == 'audio/x-vorbis':
++			if sound_file.get_uri() in self.filelist:
++				del self.filelist[sound_file.get_uri()]
 +			flacoggwarn()
 +			return
  
  		self.append_file(sound_file)
  		self.window.set_sensitive()
-@@ -2934,6 +2957,11 @@
+@@ -2717,8 +2744,12 @@
+ 		self.converter.add(sound_file)
+ 
+ 	def do_convert(self):
++		omime = self.prefs.get_string('output-mime-type')
+ 		try:
+ 			for sound_file in self.filelist.get_files():
++				if sound_file.mime_type_keep == 'audio/x-flac' and omime == 'audio/x-vorbis':
++					flacoggwarn()
++					continue
+ 				if sound_file.tags_read:
+ 					self.converter.add(sound_file)
+ 				else:
+@@ -2934,6 +2965,11 @@
  	output_type = get_option('cli-output-type')
  	output_suffix = get_option('cli-output-suffix')
  
diff --git a/soundconverter.spec b/soundconverter.spec
index 09ed813..6ab7fe4 100644
--- a/soundconverter.spec
+++ b/soundconverter.spec
@@ -1,6 +1,6 @@
 Name:           soundconverter
 Version:        1.5.4
-Release:        8%{?dist}
+Release:        9%{?dist}
 Summary:        Simple sound converter application for GNOME
 
 Group:          Applications/Multimedia
@@ -110,6 +110,12 @@ update-desktop-database &> /dev/null ||:
 
 
 %changelog
+* Fri Aug 19 2011 Michael Schwendt <mschwendt at fedoraproject.org> - 1.5.4-9
+- Enhance the previous patch, and consider the case when preferences
+  are changed after creating a list of input files. Also remove rejected
+  FLAC files from an internal filelist, so readding them will display the
+  warning dialog again.
+
 * Fri Aug 19 2011 Michael Schwendt <mschwendt at fedoraproject.org> - 1.5.4-8
 - Block conversion of FLAC to Ogg Vorbis due to GStreamer stream
   corruption (GNOME bz 651615).


More information about the scm-commits mailing list