Hello community,
here is the log from the commit of package aseqview
checked in at Thu Mar 29 18:16:34 CEST 2007.
--------
--- aseqview/aseqview.changes 2007-03-26 16:31:43.000000000 +0200
+++ /mounts/work_src_done/STABLE/aseqview/aseqview.changes 2007-03-29 16:49:24.000000000 +0200
@@ -1,0 +2,5 @@
+Thu Mar 29 16:49:16 CEST 2007 - tiwai@suse.de
+
+- fix races in thread mode
+
+-------------------------------------------------------------------
Old:
----
aseqview-0.2.4.tar.bz2
New:
----
aseqview-0.2.5.tar.bz2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ aseqview.spec ++++++
--- /var/tmp/diff_new_pack.S28417/_old 2007-03-29 18:16:11.000000000 +0200
+++ /var/tmp/diff_new_pack.S28417/_new 2007-03-29 18:16:11.000000000 +0200
@@ -1,5 +1,5 @@
#
-# spec file for package aseqview (Version 0.2.4)
+# spec file for package aseqview (Version 0.2.5)
#
# Copyright (c) 2007 SUSE LINUX Products GmbH, Nuernberg, Germany.
# This file and all modifications and additions to the pristine
@@ -13,7 +13,7 @@
Name: aseqview
BuildRequires: alsa-devel gtk2-devel update-desktop-files
Summary: ALSA Sequencer Event Viewer
-Version: 0.2.4
+Version: 0.2.5
Release: 1
License: GNU General Public License (GPL)
Group: Productivity/Multimedia/Sound/Midi
@@ -68,6 +68,8 @@
%{_datadir}/pixmaps/*.png
%changelog
+* Thu Mar 29 2007 - tiwai@suse.de
+- fix races in thread mode
* Mon Mar 26 2007 - tiwai@suse.de
- updated to version 0.2.4:
* Added MIDI Tunig Standard (MTS) feature
++++++ aseqview-0.2.4.tar.bz2 -> aseqview-0.2.5.tar.bz2 ++++++
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/aseqview-0.2.4/aseqview.c new/aseqview-0.2.5/aseqview.c
--- old/aseqview-0.2.4/aseqview.c 2007-03-26 14:42:40.000000000 +0200
+++ new/aseqview-0.2.5/aseqview.c 2007-03-29 16:28:20.000000000 +0200
@@ -115,6 +115,7 @@
UPDATE_STATUS,
NOTE_ON,
NOTE_OFF,
+ PIANO_RESET,
UPDATE_PGM,
UPDATE_MODE,
UPDATE_TEMPER_KEYSIG,
@@ -167,12 +168,13 @@
static void parse_sysex(port_status_t *, int, unsigned char *, int);
static int get_channel(unsigned char);
static void visualize_temper_type(midi_status_t *, int);
-static void reset_all(midi_status_t *);
+static void reset_all(midi_status_t *, int);
static void send_resets(channel_status_t *);
static int is_redirect(port_status_t *);
static void set_vel_bar_color(GtkWidget *, int, int);
static void av_channel_update(GtkWidget *, int, int);
static void av_note_update(GtkWidget *, int, int, int);
+static void av_piano_reset(GtkWidget *, int);
static void av_program_update(GtkWidget *, char *, int);
static void display_midi_mode(GtkWidget *, int);
static void display_temper_keysig(GtkWidget *, int);
@@ -277,22 +279,23 @@
port_add_callback(port->port, PORT_MIDI_EVENT_CB,
(port_callback_t) process_event, port);
}
- if (use_thread) {
+ if (use_thread)
av_ringbuf_init();
- pthread_create(&midi_thread, NULL, midi_loop, st);
- gtk_idle_add(idle_cb, st);
- } else {
- gdk_input_add(get_file_desc(st), GDK_INPUT_READ, handle_input, st);
- if (rt_prio)
- set_realtime_priority(SCHED_FIFO);
- }
/* explicit subscription to ports */
if (src_client >= 0 && src_client != SND_SEQ_ADDRESS_SUBSCRIBERS)
port_connect_from(st->ports[0].port, src_client, src_port);
if (do_output && dest_client >= 0
&& dest_client != SND_SEQ_ADDRESS_SUBSCRIBERS) {
port_connect_to(st->ports[0].port, dest_client, dest_port);
- reset_all(st);
+ reset_all(st, 0);
+ }
+ if (use_thread) {
+ pthread_create(&midi_thread, NULL, midi_loop, st);
+ gtk_idle_add(idle_cb, st);
+ } else {
+ gdk_input_add(get_file_desc(st), GDK_INPUT_READ, handle_input, st);
+ if (rt_prio)
+ set_realtime_priority(SCHED_FIFO);
}
gtk_main();
if (use_thread) {
@@ -361,7 +364,7 @@
#else
mode = (do_output) ? SND_SEQ_OPEN : SND_SEQ_OPEN_IN;
#endif
- st->client = port_client_new("MIDI Viewer", mode);
+ st->client = port_client_new("MIDI Viewer", mode, use_thread);
caps = SND_SEQ_PORT_CAP_WRITE | SND_SEQ_PORT_CAP_SUBS_WRITE;
if (do_output)
caps |= SND_SEQ_PORT_CAP_READ | SND_SEQ_PORT_CAP_SUBS_READ;
@@ -920,7 +923,7 @@
int type, snd_seq_event_t *ev, port_status_t *port)
{
if (port_num_subscription(p, SND_SEQ_QUERY_SUBS_READ) == 1)
- reset_all(port->main);
+ reset_all(port->main, use_thread);
return 0;
}
@@ -932,7 +935,7 @@
int type, snd_seq_event_t *ev, port_status_t *port)
{
if (port_num_subscription(p, SND_SEQ_QUERY_SUBS_WRITE) == 0)
- reset_all(port->main);
+ reset_all(port->main, use_thread);
return 0;
}
@@ -1271,7 +1274,7 @@
/*
* reset all stuff
*/
-static void reset_all(midi_status_t *st)
+static void reset_all(midi_status_t *st, int in_buf)
{
int p, i, j;
port_status_t *port;
@@ -1284,15 +1287,14 @@
chst = &port->ch[i];
all_sounds_off(chst, 0);
chst->is_drum = (i == 9) ? 1 : 0;
- set_vel_bar_color(chst->w_vel, chst->is_drum, 0);
- change_program(port, i, 0, 0);
- reset_controllers(chst, 0);
- change_pitch(port, i, 0, 0);
+ set_vel_bar_color(chst->w_vel, chst->is_drum, in_buf);
+ change_program(port, i, 0, in_buf);
+ reset_controllers(chst, in_buf);
+ change_pitch(port, i, 0, in_buf);
chst->temper_type = 0;
- display_temper_type(chst->w_temper_type, 0);
- if (chst->w_piano)
- for (j = 0; j < NUM_KEYS; j++)
- piano_note_off(PIANO(chst->w_piano), j);
+ display_temper_type(chst->w_temper_type, in_buf);
+ if (show_piano)
+ av_piano_reset(chst->w_piano, in_buf);
if (is_redirect(port))
send_resets(chst);
}
@@ -1379,6 +1381,19 @@
/*
*/
+static void av_piano_reset(GtkWidget *w, int in_buf)
+{
+ if (in_buf)
+ av_ringbuf_write(PIANO_RESET, w, 0);
+ else {
+ int i;
+ for (i = 0; i < NUM_KEYS; i++)
+ av_note_update(w, i, 0, 0);
+ }
+}
+
+/*
+ */
static void av_program_update(GtkWidget *w, char *progname, int in_buf)
{
if (in_buf)
@@ -1495,7 +1510,7 @@
*/
static gboolean idle_cb(gpointer data)
{
- int type;
+ int type, i;
GtkWidget *w;
long val;
@@ -1513,6 +1528,9 @@
case NOTE_OFF:
av_note_update(w, val, 0, 0);
break;
+ case PIANO_RESET:
+ av_piano_reset(w, 0);
+ break;
case UPDATE_PGM:
av_program_update(w, (char *) val, 0);
break;
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/aseqview-0.2.4/ChangeLog new/aseqview-0.2.5/ChangeLog
--- old/aseqview-0.2.4/ChangeLog 2007-03-26 16:23:20.000000000 +0200
+++ new/aseqview-0.2.5/ChangeLog 2007-03-29 15:55:21.000000000 +0200
@@ -1,3 +1,5 @@
+0.2.5 - Fix possible segfaults due to races in thread mode
+
0.2.4 - Added MIDI Tunig Standard (MTS) feature
by TAMUKI Shoichi