[SCM] gsequencer/master: added fixes to mangled tasks

jkraehemann-guest at users.alioth.debian.org jkraehemann-guest at users.alioth.debian.org
Sun Feb 5 14:58:38 UTC 2017


The following commit has been merged in the master branch:
commit f34290af2dbeae8f31731d673abd796b91d4e53f
Author: Joël Krähemann <jkraehemann-guest at users.alioth.debian.org>
Date:   Sun Feb 5 15:34:23 2017 +0100

    added fixes to mangled tasks

diff --git a/debian/patches/fix-set-buffer-size.patch b/debian/patches/fix-set-buffer-size.patch
new file mode 100644
index 0000000..369a9e5
--- /dev/null
+++ b/debian/patches/fix-set-buffer-size.patch
@@ -0,0 +1,108 @@
+Description: This patch is considered critical since it fixes missing thread
+ frequency change. As you modify the buffer size, you have to modify the
+ refreshing rate of appropriate threads.
+Author: Joël Krähmann <jkraehemann at gmail.com>
+Applied-Upstream: 0.7.122.x, http://git.savannah.gnu.org/cgit/gsequencer.git
+Last-Update: 2017-02-05
+--- a/ags/audio/task/ags_set_buffer_size.c
++++ b/ags/audio/task/ags_set_buffer_size.c
+@@ -20,6 +20,7 @@
+ #include <ags/audio/task/ags_set_buffer_size.h>
+ 
+ #include <ags/object/ags_application_context.h>
++#include <ags/object/ags_main_loop.h>
+ #include <ags/object/ags_connectable.h>
+ #include <ags/object/ags_soundcard.h>
+ 
+@@ -371,6 +372,7 @@
+   
+   GList *list;
+ 
++  gdouble thread_frequency;
+   guint channels;
+   guint samplerate;
+   guint buffer_size;
+@@ -378,46 +380,56 @@
+ 
+   application_context = ags_soundcard_get_application_context(AGS_SOUNDCARD(soundcard));
+   
+-  /*  */
+   ags_soundcard_get_presets(AGS_SOUNDCARD(soundcard),
+ 			    &channels,
+ 			    &samplerate,
+ 			    &buffer_size,
+ 			    &format);
+-
+-  ags_soundcard_set_presets(AGS_SOUNDCARD(soundcard),
+-			    channels,
+-			    samplerate,
+-			    set_buffer_size->buffer_size,
+-			    format);
+-
++    
+   /* reset soundcards */
+   list = ags_sound_provider_get_soundcard(AGS_SOUND_PROVIDER(application_context));
+ 
+-  while(list != NULL){
+-    if(list->data != soundcard){
+-      guint target_channels;
+-      guint target_samplerate;
+-      guint target_buffer_size;
+-      guint target_format;
+-
+-      ags_soundcard_get_presets(AGS_SOUNDCARD(list->data),
+-				&target_channels,
+-				&target_samplerate,
+-				&target_buffer_size,
+-				&target_format);
++  if(soundcard == list->data){
++    /* reset soundcards if applied to first soundcard */
++    ags_soundcard_set_presets(AGS_SOUNDCARD(soundcard),
++			      channels,
++			      samplerate,
++			      set_buffer_size->buffer_size,
++			      format);
++
++    while(list != NULL){
++      if(list->data != soundcard){
++	guint target_channels;
++	guint target_samplerate;
++	guint target_buffer_size;
++	guint target_format;
++
++	ags_soundcard_get_presets(AGS_SOUNDCARD(list->data),
++				  &target_channels,
++				  &target_samplerate,
++				  &target_buffer_size,
++				  &target_format);
+       
+ 
+-      ags_soundcard_set_presets(AGS_SOUNDCARD(soundcard),
+-				target_channels,
+-				target_samplerate,
+-				set_buffer_size->buffer_size * (target_samplerate / samplerate),
+-				target_format);
++	ags_soundcard_set_presets(AGS_SOUNDCARD(soundcard),
++				  target_channels,
++				  target_samplerate,
++				  set_buffer_size->buffer_size * (target_samplerate / samplerate),
++				  target_format);
++      }
++
++      list = list->next;
+     }
++    
++    /* reset thread frequency */
++    thread_frequency = samplerate / set_buffer_size->buffer_size + AGS_SOUNDCARD_DEFAULT_OVERCLOCK;
+ 
+-    list = list->next;
++    ags_main_loop_change_frequency(AGS_MAIN_LOOP(application_context->main_loop),
++				   thread_frequency);
++  }else{
++    g_warning("buffer size can only adjusted of your very first soundcard\0");
+   }
+-
++  
+   /* AgsAudio */
+   list = ags_soundcard_get_audio(AGS_SOUNDCARD(soundcard));
+ 
diff --git a/debian/patches/fix-set-samplerate.patch b/debian/patches/fix-set-samplerate.patch
new file mode 100644
index 0000000..45a7abd
--- /dev/null
+++ b/debian/patches/fix-set-samplerate.patch
@@ -0,0 +1,119 @@
+Description: This patch is considered critical since it fixes missing changes
+ to thread frequency. As you modify the samplerate, you have to modify the
+ refreshing rate of the appropriate threads.
+Author: Joël Krähmann <jkraehemann at gmail.com>
+Applied-Upstream: 0.7.122.x, http://git.savannah.gnu.org/cgit/gsequencer.git
+Last-Update: 2017-02-05
+--- a/ags/audio/task/ags_set_samplerate.c
++++ b/ags/audio/task/ags_set_samplerate.c
+@@ -20,6 +20,7 @@
+ #include <ags/audio/task/ags_set_samplerate.h>
+ 
+ #include <ags/object/ags_application_context.h>
++#include <ags/object/ags_main_loop.h>
+ #include <ags/object/ags_connectable.h>
+ #include <ags/object/ags_soundcard.h>
+ 
+@@ -366,11 +367,12 @@
+ 
+ void
+ ags_set_samplerate_soundcard(AgsSetSamplerate *set_samplerate, GObject *soundcard)
+-{
++{  
+   AgsApplicationContext *application_context;
+   
+   GList *list;
+ 
++  gdouble thread_frequency;
+   guint channels;
+   guint samplerate;
+   guint buffer_size;
+@@ -378,46 +380,62 @@
+ 
+   application_context = ags_soundcard_get_application_context(AGS_SOUNDCARD(soundcard));
+ 
+-  /*  */
+   ags_soundcard_get_presets(AGS_SOUNDCARD(soundcard),
+ 			    &channels,
+ 			    &samplerate,
+ 			    &buffer_size,
+ 			    &format);
+-  
+-  ags_soundcard_set_presets(AGS_SOUNDCARD(soundcard),
+-			    channels,
+-			    set_samplerate->samplerate,
+-			    buffer_size,
+-			    format);
+ 
+   /* reset soundcards */
+   list = ags_sound_provider_get_soundcard(AGS_SOUND_PROVIDER(application_context));
+ 
+-  while(list != NULL){
+-    if(list->data != soundcard){
+-      guint target_channels;
+-      guint target_samplerate;
+-      guint target_buffer_size;
+-      guint target_format;
+-
+-      ags_soundcard_get_presets(AGS_SOUNDCARD(list->data),
+-				&target_channels,
+-				&target_samplerate,
+-				&target_buffer_size,
+-				&target_format);
++  if(soundcard == list->data){
++    /* reset soundcards if applied to first soundcard */
++    ags_soundcard_set_presets(AGS_SOUNDCARD(soundcard),
++			      channels,
++			      set_samplerate->samplerate,
++			      buffer_size,
++			      format);
++
++    /* reset depending soundcards */
++    while(list != NULL){
++      if(list->data != soundcard){
++	guint target_channels;
++	guint target_samplerate;
++	guint target_buffer_size;
++	guint target_format;
++
++	ags_soundcard_get_presets(AGS_SOUNDCARD(list->data),
++				  &target_channels,
++				  &target_samplerate,
++				  &target_buffer_size,
++				  &target_format);
+       
+ 
+-      ags_soundcard_set_presets(AGS_SOUNDCARD(soundcard),
+-				target_channels,
+-				target_samplerate,
+-				buffer_size * (target_samplerate / set_samplerate->samplerate),
+-				target_format);
++	ags_soundcard_set_presets(AGS_SOUNDCARD(soundcard),
++				  target_channels,
++				  target_samplerate,
++				  buffer_size * (target_samplerate / set_samplerate->samplerate),
++				  target_format);
++      }
++
++      list = list->next;
+     }
++    
++    /* reset thread frequency */
++    thread_frequency = set_samplerate->samplerate / buffer_size + AGS_SOUNDCARD_DEFAULT_OVERCLOCK;
+ 
+-    list = list->next;
++    ags_main_loop_change_frequency(AGS_MAIN_LOOP(application_context->main_loop),
++				   thread_frequency);
++  }else{
++    /* it is not first soundcard */
++    ags_soundcard_set_presets(AGS_SOUNDCARD(soundcard),
++			      channels,
++			      set_samplerate->samplerate,
++			      buffer_size * (samplerate / set_samplerate->samplerate),
++			      format);
+   }
+-
++  
+   /* AgsAudio */
+   list = ags_soundcard_get_audio(AGS_SOUNDCARD(soundcard));
+ 
diff --git a/debian/patches/series b/debian/patches/series
index 9811bdd..c1d1ecc 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,3 +1,5 @@
+fix-set-buffer-size.patch
+fix-set-samplerate.patch
 fix-record-midi-audio-run.patch
 fix-audio-loop.patch
 fix-main-loop-c.patch

-- 
gsequencer packaging



More information about the pkg-multimedia-commits mailing list