[SCM] projectm packaging branch, master, updated. debian/2.0.1+dfsg-1-5-g23b9b62

ximion-guest at users.alioth.debian.org ximion-guest at users.alioth.debian.org
Thu Jul 29 15:54:03 UTC 2010


The following commit has been merged in the master branch:
commit 7dd2981a8660bd0ff7f270d2c2fc92ee538c602d
Author: Matthias Klumpp <matthias at nlinux.org>
Date:   Thu Jul 29 17:51:03 2010 +0200

    More patches for projectM-pulseaudio bug
    
    * 09_error-handling.patch: Fix some problems while
       loading Milkdrop presets.
    * 01_pulseaudio_check.patch: Check for working
       PulseAudio daemon

diff --git a/debian/patches/01_pulseaudio-check.patch b/debian/patches/01_pulseaudio-check.patch
new file mode 100644
index 0000000..bd76023
--- /dev/null
+++ b/debian/patches/01_pulseaudio-check.patch
@@ -0,0 +1,38 @@
+Description: Check for PulseAudio connection
+ Only write device name when pulse connection is established
+ 
+Forwarded: yes
+Author: Carmelo Piccione <carmelo.piccione at gmail.com>
+Last-Update: 2010-07-29
+--- a/src/projectM-pulseaudio/QPulseAudioDeviceChooser.cpp
++++ b/src/projectM-pulseaudio/QPulseAudioDeviceChooser.cpp
+@@ -30,7 +30,8 @@
+ 	QSettings settings ( "projectM", "qprojectM-pulseaudio" );
+ 	settings.setValue ( "tryFirstAvailablePlaybackMonitor",
+ 	                    this->tryFirstPlayBackMonitorCheckBox->checkState() == Qt::Checked );
+-	if (_qpulseAudioThread->sourcePosition() != _qpulseAudioThread->devices().end())
++			    
++	if ( _qpulseAudioThread != 0 && (_qpulseAudioThread->devices().size() > 0) && _qpulseAudioThread->sourcePosition() != _qpulseAudioThread->devices().end())
+ 		settings.setValue("pulseAudioDeviceName", *_qpulseAudioThread->sourcePosition());
+ 	
+ }
+@@ -63,6 +64,7 @@
+ 	devicesListView->setEnabled(state != Qt::Checked);
+ 		
+ 	if (state == Qt::Checked) {
++	    if (_qpulseAudioThread != 0)
+ 		_qpulseAudioThread->connectDevice();
+ 	}
+ }
+--- a/src/projectM-pulseaudio/qprojectM-pulseaudio.cpp
++++ b/src/projectM-pulseaudio/qprojectM-pulseaudio.cpp
+@@ -118,7 +118,8 @@
+ 	
+ 	//QApplication::connect(mainWindow, SIGNAL(shuttingDown()), pulseThread, SLOT(cleanup()), Qt::DirectConnection);
+  	int ret = app.exec();
+-	devChooser.writeSettings();
++	if (pulseThread != 0)
++	  devChooser.writeSettings();
+ 	
+ 	if (mainWindow)
+         	mainWindow->unregisterSettingsAction(&pulseAction);
diff --git a/debian/patches/01_pulseaudio_cmakelist.patch b/debian/patches/02_pulseaudio_cmakelist.patch
similarity index 100%
rename from debian/patches/01_pulseaudio_cmakelist.patch
rename to debian/patches/02_pulseaudio_cmakelist.patch
diff --git a/debian/patches/02_desktop-files.patch b/debian/patches/03_desktop-files.patch
similarity index 100%
rename from debian/patches/02_desktop-files.patch
rename to debian/patches/03_desktop-files.patch
diff --git a/debian/patches/03_pulseaudio_stat.patch b/debian/patches/04_pulseaudio_stat.patch
similarity index 100%
rename from debian/patches/03_pulseaudio_stat.patch
rename to debian/patches/04_pulseaudio_stat.patch
diff --git a/debian/patches/04_libprojectm_fix-cmakelists.patch b/debian/patches/05_libprojectm_fix-cmakelists.patch
similarity index 100%
rename from debian/patches/04_libprojectm_fix-cmakelists.patch
rename to debian/patches/05_libprojectm_fix-cmakelists.patch
diff --git a/debian/patches/05_libprojectm_fonts.patch b/debian/patches/06_libprojectm_fonts.patch
similarity index 100%
rename from debian/patches/05_libprojectm_fonts.patch
rename to debian/patches/06_libprojectm_fonts.patch
diff --git a/debian/patches/06_cg-profile-setting.patch b/debian/patches/07_cg-profile-setting.patch
similarity index 100%
rename from debian/patches/06_cg-profile-setting.patch
rename to debian/patches/07_cg-profile-setting.patch
diff --git a/debian/patches/07_qprojectm-openglcontext.patch b/debian/patches/08_qprojectm-openglcontext.patch
similarity index 100%
rename from debian/patches/07_qprojectm-openglcontext.patch
rename to debian/patches/08_qprojectm-openglcontext.patch
diff --git a/debian/patches/09_error-handling.patch b/debian/patches/09_error-handling.patch
new file mode 100644
index 0000000..4154884
--- /dev/null
+++ b/debian/patches/09_error-handling.patch
@@ -0,0 +1,308 @@
+Description: Error handling
+ * Guard against reinitializing the builtin milkdrop functions.
+   Hides a deeper issue where something is double loading the preset factories, most
+   likely.
+ * Playlist file / directory error handling fixes, resize playlist refresh fix
+ 
+Forwarded: yes
+Author: Carmelo Piccione <carmelo.piccione at gmail.com>
+Last-Update: 2010-07-29
+--- a/src/libprojectM/MilkdropPresetFactory/BuiltinFuncs.cpp
++++ b/src/libprojectM/MilkdropPresetFactory/BuiltinFuncs.cpp
+@@ -29,7 +29,7 @@
+   /* Create new function */
+   func = new Func(name, func_ptr, num_args);
+ 
+-  if (func == NULL)
++  if (func == 0)
+     return PROJECTM_OUTOFMEM_ERROR;
+ 
+   retval = insert_func( func );
+@@ -115,12 +115,18 @@
+   return PROJECTM_SUCCESS;
+ }
+ 
++volatile bool BuiltinFuncs::initialized = false;
+ 
+ /* Initialize the builtin function database.
+    Should only be necessary once */
+ int BuiltinFuncs::init_builtin_func_db() {
+   int retval;
+ 
++  if (initialized) {
++    return 0;
++  } else
++    initialized = true;
++  
+   retval = load_all_builtin_func();
+   return retval;
+ }
+@@ -134,7 +140,7 @@
+ traverse<TraverseFunctors::Delete<Func> >(builtin_func_tree);
+ 
+ builtin_func_tree.clear();
+-
++initialized = false;
+ return PROJECTM_SUCCESS;
+ }
+ 
+@@ -142,13 +148,24 @@
+ int BuiltinFuncs::insert_func( Func *func ) {
+ 
+   assert(func);
+-  std::pair<std::map<std::string, Func*>::iterator, bool> inserteePair =
+-  	builtin_func_tree.insert(std::make_pair(std::string(func->getName()), func));
+   
++  if (func == 0) {
++      std::cerr << "Received a null function object, ignoring...." << std::endl;
++      return PROJECTM_ERROR;
++  }
++  
++//   //std::cout << "inserting function " << func->getName() << std::endl;
++  
++  const std::pair<std::string, Func*> pair = std::make_pair(std::string(func->getName()), func);
++  
++  assert(pair.second);
++  
++  const std::pair<std::map<std::string, Func*>::iterator, bool> inserteePair =
++  	builtin_func_tree.insert(pair);
++  	
+   if (!inserteePair.second) {
+ 	std::cerr << "Failed to insert builtin function \"" << func->getName() << "\" into collection! Bailing..." << std::endl;
+ 	abort();
+-
+   }
+ 
+   return PROJECTM_SUCCESS;
+--- a/src/libprojectM/MilkdropPresetFactory/BuiltinFuncs.hpp
++++ b/src/libprojectM/MilkdropPresetFactory/BuiltinFuncs.hpp
+@@ -229,6 +229,7 @@
+     static Func *find_func( const std::string & name );
+ private:
+      static std::map<std::string, Func*> builtin_func_tree;
++     static volatile bool initialized;
+ };
+ 
+ #endif
+--- a/src/libprojectM/MilkdropPresetFactory/MilkdropPresetFactory.cpp
++++ b/src/libprojectM/MilkdropPresetFactory/MilkdropPresetFactory.cpp
+@@ -26,7 +26,7 @@
+ 	Eval::init_infix_ops();
+ 
+ 	_presetOutputs = createPresetOutputs(gx,gy);
+-    _presetOutputs2 = createPresetOutputs(gx, gy);
++	_presetOutputs2 = createPresetOutputs(gx, gy);
+ }
+ 
+ MilkdropPresetFactory::~MilkdropPresetFactory() {
+@@ -37,13 +37,13 @@
+ 	BuiltinFuncs::destroy_builtin_func_db();
+ 	std::cerr << "[~MilkdropPresetFactory] delete preset out puts" << std::endl;
+ 	delete(_presetOutputs);
+-    delete(_presetOutputs2);
++        delete(_presetOutputs2);
+ 	std::cerr << "[~MilkdropPresetFactory] done" << std::endl;
+ 
+ }
+ 
+ /* Reinitializes the engine variables to a default (conservative and sane) value */
+-void resetPresetOutputs(PresetOutputs *presetOutputs)
++void resetPresetOutputs(PresetOutputs * presetOutputs)
+ {
+ 
+     presetOutputs->zoom=1.0;
+--- a/src/libprojectM/PresetFactoryManager.cpp
++++ b/src/libprojectM/PresetFactoryManager.cpp
+@@ -20,7 +20,7 @@
+ #endif
+ 
+ #include <sstream>
+-PresetFactoryManager::PresetFactoryManager() : _gx(0), _gy(0) {}
++PresetFactoryManager::PresetFactoryManager() : _gx(0), _gy(0), initialized(false) {}
+ 
+ PresetFactoryManager::~PresetFactoryManager() {
+ 	for (std::vector<PresetFactory *>::iterator pos = _factoryList.begin(); 
+@@ -29,11 +29,20 @@
+ 		delete(*pos);
+ 	}
+ 
+-
++  initialized = false;
+ }
++
+ void PresetFactoryManager::initialize(int gx, int gy) {
+ 	_gx = gx;
+ 	_gy = gy;
++	
++	if (!initialized) {
++	  initialized = true;
++	} else {
++	  std::cout << "already initialized " << std::endl;
++	  return;
++	}
++	  
+ 	PresetFactory * factory;
+ 	
+ 	#ifndef DISABLE_MILKDROP_PRESETS
+--- a/src/libprojectM/PresetFactoryManager.hpp
++++ b/src/libprojectM/PresetFactoryManager.hpp
+@@ -21,7 +21,7 @@
+ 		virtual ~PresetFactoryException() throw() {}
+ 		const std::string & message() const { return _message; } 
+ 
+-	private:	
++	private:
+ 		std::string _message;
+ };
+ 
+@@ -54,6 +54,6 @@
+ 		mutable std::map<std::string, PresetFactory *> _factoryMap;
+ 		mutable std::vector<PresetFactory *> _factoryList;
+ 		void registerFactory(const std::string & extension, PresetFactory * factory);
+-
++		volatile bool initialized;
+ };
+ #endif
+--- a/src/libprojectM/projectM.cpp
++++ b/src/libprojectM/projectM.cpp
+@@ -222,7 +222,6 @@
+     projectM_init ( _settings.meshX, _settings.meshY, _settings.fps,
+                     _settings.textureSize, _settings.windowWidth,_settings.windowHeight);
+ 
+-
+                     _settings.beatSensitivity = beatDetect->beat_sensitivity = config.read<float> ( "Hard Cut Sensitivity", 10.0 );
+ 
+                     if ( config.read ( "Aspect Correction", true ) )
+--- a/src/projectM-pulseaudio/QPulseAudioThread.cpp
++++ b/src/projectM-pulseaudio/QPulseAudioThread.cpp
+@@ -296,9 +296,7 @@
+ {
+ 	assert ( mainloop_api );
+ 	mainloop_api->quit ( mainloop_api, ret );
+-	if (*s_qprojectM_MainWindowPtr)
+-		delete(*s_qprojectM_MainWindowPtr);
+-	*s_qprojectM_MainWindowPtr = 0;
++	
+ }
+ 
+ 
+@@ -315,7 +313,8 @@
+ 	{
+ 		fprintf ( stderr, "pa_stream_peek() failed: %s\n", pa_strerror ( pa_context_errno ( context ) ) );
+ 		pulseQuit ( 1 );
+-		return;
++		return
++;
+ 	}
+ 
+ 	if ((!s_qprojectM_MainWindowPtr) || (!*s_qprojectM_MainWindowPtr))
+@@ -352,16 +351,16 @@
+ 	switch ( pa_stream_get_state ( s ) )
+ 	{
+ 		case PA_STREAM_UNCONNECTED:
+-//			qDebug() << "UNCONNECTED";
++			qDebug() << "UNCONNECTED";
+ 			break;
+ 		case PA_STREAM_CREATING:
+-//			qDebug() << "CREATED";
++		  qDebug() << "CREATED";
+ 			break;
+ 		case PA_STREAM_TERMINATED:
+-//			qDebug() << "TERMINATED";
++			qDebug() << "TERMINATED";
+ 			break;
+ 		case PA_STREAM_READY:
+-//			qDebug() << "READY";
++			qDebug() << "READY";
+ 			if ( verbose )
+ 			{
+ 				const pa_buffer_attr *a;
+--- a/src/projectM-qt/qplaylisttableview.hpp
++++ b/src/projectM-qt/qplaylisttableview.hpp
+@@ -93,14 +93,14 @@
+ 	 }
+ 	 
+ 	 inline void resizeEvent(QResizeEvent * event) {
+-
++		QTableView::resizeEvent(event);
+ 		emit(resized(event));
+ 	 }	
+ 	 
+ 	 inline void mousePressEvent(QMouseEvent * event) {
+ 		QAbstractItemView::mousePressEvent(event);
+ 		if (event->button() == Qt::RightButton) {
+-			emit(mousePressed(event, selectedIndexes()));			
++			emit(mousePressed(event, selectedIndexes()));
+ 		}
+ 		else
+ 				;
+--- a/src/projectM-qt/qprojectm_mainwindow.cpp
++++ b/src/projectM-qt/qprojectm_mainwindow.cpp
+@@ -98,7 +98,8 @@
+ 
+ 	connect(ui->tableView, SIGNAL(resized(QResizeEvent *)), this, SLOT(refreshHeaders(QResizeEvent*)));
+ 	
+-	connect(ui->tableView, SIGNAL(mousePressed(QMouseEvent*, const QModelIndexList &)), this, SLOT(popupPlaylistContextMenu(QMouseEvent*, const QModelIndexList &)));
++	connect(ui->tableView, SIGNAL(mousePressed(QMouseEvent*, const QModelIndexList &)), this,
++		SLOT(popupPlaylistContextMenu(QMouseEvent*, const QModelIndexList &)));
+ 	
+ 	connect ( m_QProjectMWidget, SIGNAL ( projectM_Initialized(QProjectM*) ), 
+ 		  this, SLOT ( postProjectM_Initialize() ) );
+@@ -662,7 +663,7 @@
+ 		// Add 1 to skip the Name column
+ 		hHeader->setResizeMode (i+1, QHeaderView::ResizeToContents);
+ 		sizeTotal += hHeader->sectionSize(i+1);
+-	}				
++	}
+ 	hHeader->resizeSection(0, ui->tableView->size().width()-20-sizeTotal);
+ 	
+ 	
+@@ -883,11 +884,13 @@
+ 		QString url = m_QPlaylistFileDialog->selectedFiles() [0];
+ 
+ 		
+-		if ( !playlistModel->readPlaylist ( url ) ) { 
++		const bool loadedOk = playlistModel->readPlaylist ( url );
++		
++		if (!loadedOk) { 
+ 			qDebug() << "could not open playlist";
+ 			url = QString();
+-			
+-		}
++		} 
++		
+ 		qDebug() << "url: " << url;
+ 		updatePlaylistUrl(url);
+ 		
+--- a/src/projectM-qt/qprojectmwidget.hpp
++++ b/src/projectM-qt/qprojectmwidget.hpp
+@@ -22,6 +22,7 @@
+ #ifndef QPROJECTM_WIDGET_HPP
+ #define QPROJECTM_WIDGET_HPP
+ 
++#include <iostream>
+ #include "qprojectm.hpp"
+ #include <QGLWidget>
+ #include <QMutex>
+@@ -111,7 +112,7 @@
+ 
+ 		void resetProjectM()
+ 		{
+-
++			std::cout << "reseting" << std::endl;
+ 			qDebug() << "reset start";
+ 
+ 			emit ( projectM_BeforeDestroy() );
+@@ -246,8 +247,10 @@
+ 		void initializeGL()
+ 		{
+ 
+-			this->m_projectM = new QProjectM ( m_config_file );
+-			projectM_Initialized ( m_projectM );
++		        if (m_projectM == 0) {
++			    this->m_projectM = new QProjectM ( m_config_file );
++			    projectM_Initialized ( m_projectM );
++			}
+ 		}
+ 
+ 		inline void paintGL()
diff --git a/debian/patches/series b/debian/patches/series
index 7f9fe9c..fc62544 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,7 +1,9 @@
-01_pulseaudio_cmakelist.patch
-02_desktop-files.patch
-03_pulseaudio_stat.patch
-04_libprojectm_fix-cmakelists.patch
-05_libprojectm_fonts.patch
-06_cg-profile-setting.patch
-07_qprojectm-openglcontext.patch
+01_pulseaudio-check.patch
+02_pulseaudio_cmakelist.patch
+03_desktop-files.patch
+04_pulseaudio_stat.patch
+05_libprojectm_fix-cmakelists.patch
+06_libprojectm_fonts.patch
+07_cg-profile-setting.patch
+08_qprojectm-openglcontext.patch
+09_error-handling.patch

-- 
projectm packaging



More information about the pkg-multimedia-commits mailing list