r25228 - in /packages/unstable/gnome-dvb-daemon/debian: changelog patches/epg_threads.patch patches/series

sre-guest at users.alioth.debian.org sre-guest at users.alioth.debian.org
Fri Oct 1 09:10:12 UTC 2010


Author: sre-guest
Date: Fri Oct  1 09:10:11 2010
New Revision: 25228

URL: http://svn.debian.org/wsvn/pkg-gnome/?sc=1&rev=25228
Log:
patch for epg threading issue

Added:
    packages/unstable/gnome-dvb-daemon/debian/patches/epg_threads.patch
Modified:
    packages/unstable/gnome-dvb-daemon/debian/changelog
    packages/unstable/gnome-dvb-daemon/debian/patches/series

Modified: packages/unstable/gnome-dvb-daemon/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-gnome/packages/unstable/gnome-dvb-daemon/debian/changelog?rev=25228&op=diff
==============================================================================
--- packages/unstable/gnome-dvb-daemon/debian/changelog [utf-8] (original)
+++ packages/unstable/gnome-dvb-daemon/debian/changelog [utf-8] Fri Oct  1 09:10:11 2010
@@ -1,3 +1,10 @@
+gnome-dvb-daemon (1:0.1.19-2) unstable; urgency=low
+
+  * add patch for epg threading issue
+  * increment epoch to overwrite 0.1.21 upload in unstable
+
+ -- Sebastian Reichel <elektranox at gmail.com>  Fri, 01 Oct 2010 09:53:50 +0200
+
 gnome-dvb-daemon (0.1.19-1) unstable; urgency=low
 
   * New upstream release:

Added: packages/unstable/gnome-dvb-daemon/debian/patches/epg_threads.patch
URL: http://svn.debian.org/wsvn/pkg-gnome/packages/unstable/gnome-dvb-daemon/debian/patches/epg_threads.patch?rev=25228&op=file
==============================================================================
--- packages/unstable/gnome-dvb-daemon/debian/patches/epg_threads.patch (added)
+++ packages/unstable/gnome-dvb-daemon/debian/patches/epg_threads.patch [utf-8] Fri Oct  1 09:10:11 2010
@@ -1,0 +1,676 @@
+From: Sebastian Pölsterl <sebp at k-d-w.org>
+Subject: Fix threading issue in EPG
+ This patch fixes a segfault when using the EPG with
+ multiple DVB cards.
+Origin: https://bugs.launchpad.net/gnome-dvb-daemon/+bug/642388/+attachment/1654875/+files/epg_threads.patch
+Bug: https://bugs.launchpad.net/gnome-dvb-daemon/+bug/642388
+Bug-Debian: http://bugs.debian.org/591388
+
+diff -Nur gnome-dvb-daemon-0.1.19/src/database/sqlite/SqliteConfigTimersStore.vala gnome-dvb-daemon-0.1.19.new/src/database/sqlite/SqliteConfigTimersStore.vala
+--- gnome-dvb-daemon-0.1.19/src/database/sqlite/SqliteConfigTimersStore.vala	2010-05-13 13:19:58.000000000 +0200
++++ gnome-dvb-daemon-0.1.19.new/src/database/sqlite/SqliteConfigTimersStore.vala	2010-10-01 10:19:19.000000000 +0200
+@@ -237,7 +237,6 @@
+             while (statement.step () == Sqlite.ROW) {
+                 int group_id = statement.column_int (0);
+ 
+-                this.select_devices_statement.reset ();
+                 if (this.select_devices_statement.bind_int (1, group_id) != Sqlite.OK) {
+                     this.throw_last_error ();
+                     continue;
+@@ -269,6 +268,7 @@
+                         devs.add (Device.new_with_type (adapter, frontend));
+                     }
+                 }
++                this.select_devices_statement.reset ();
+ 
+                 // No devices for this group
+                 if (ref_dev == null) {
+@@ -295,8 +295,7 @@
+         
+             string channels = dev_group.Channels.channels_file.get_path ();
+             string recdir = dev_group.RecordingsDirectory.get_path ();
+-        
+-            this.insert_group_statement.reset ();
++
+             if (this.insert_group_statement.bind_int (1, (int)dev_group.Id) != Sqlite.OK
+                 || this.insert_group_statement.bind_int (2, (int)dev_group.Type) != Sqlite.OK
+                 || this.insert_group_statement.bind_text (3, channels) != Sqlite.OK
+@@ -308,49 +307,49 @@
+             
+             this.begin_transaction ();
+             if (this.insert_group_statement.step () != Sqlite.DONE) {
+-                this.throw_last_error ();
++                this.throw_last_error_reset (this.insert_group_statement);
+                 return false;
+-            }
++            }        
++            this.insert_group_statement.reset ();
+             
+             foreach (Device dev in dev_group)
+                 this.add_device_to_group (dev, dev_group);
+-            
++
+             this.end_transaction ();
+-                
++
+             return true;
+         }
+         
+         public bool remove_device_group (DeviceGroup devgroup) throws SqlError {
+-            this.delete_group_statement.reset ();
+             if (this.delete_group_statement.bind_int (1, (int)devgroup.Id) != Sqlite.OK) {
+                 this.throw_last_error ();
+                 return false;
+             }
+-            
+-            this.delete_group_devices_statement.reset ();
++
+             if (this.delete_group_devices_statement.bind_int (1, (int)devgroup.Id) != Sqlite.OK) {
+                 this.throw_last_error ();
+                 return false;
+             }
+-            
++
+             this.begin_transaction ();
+             if (this.delete_group_statement.step () != Sqlite.DONE) {
+-                this.throw_last_error ();
++                this.throw_last_error_reset (this.delete_group_statement);
+                 return false;
+             }
++            this.delete_group_statement.reset ();
+ 
+             if (this.delete_group_devices_statement.step () != Sqlite.DONE) {
+-                this.throw_last_error ();
++                this.throw_last_error_reset (this.delete_group_devices_statement);
+                 return false;
+-            }
++            }            
++            this.delete_group_devices_statement.reset ();
++
+             this.end_transaction ();
+             
+             return true;
+         }
+ 
+         public bool get_parent_group (uint adapter, uint frontend, out uint group_id) throws SqlError {
+-            this.select_group_of_device_statement.reset ();
+-
+             if (this.select_group_of_device_statement.bind_int (1, (int)adapter) != Sqlite.OK
+                 || this.select_group_of_device_statement.bind_int (2, (int)frontend) != Sqlite.OK)
+             {
+@@ -363,12 +362,12 @@
+                 group_id = this.select_group_of_device_statement.column_int (0);
+                 ret = true;
+             }
++            this.select_group_of_device_statement.reset ();
+ 
+             return ret;
+         }
+         
+         public bool contains_group (uint group_id) throws SqlError {
+-            this.contains_group_statement.reset ();
+             if (this.contains_group_statement.bind_int (1, (int)group_id) != Sqlite.OK)
+             {
+                 this.throw_last_error ();
+@@ -379,14 +378,14 @@
+             while (this.contains_group_statement.step () == Sqlite.ROW) {
+                 c = this.contains_group_statement.column_int (0);
+             }
+-            
++            this.contains_group_statement.reset ();
++
+             return (c > 0);
+         }
+         
+         public bool add_device_to_group (Device dev, DeviceGroup devgroup)
+                throws SqlError
+         {
+-            this.insert_device_statement.reset ();
+             if (this.insert_device_statement.bind_int (1, (int)devgroup.Id) != Sqlite.OK
+                 || this.insert_device_statement.bind_int (2, (int)dev.Adapter) != Sqlite.OK
+                 || this.insert_device_statement.bind_int (3, (int)dev.Frontend) != Sqlite.OK)
+@@ -396,16 +395,17 @@
+             }
+             
+             if (this.insert_device_statement.step () != Sqlite.DONE) {
+-                this.throw_last_error ();
++                this.throw_last_error_reset (this.insert_device_statement);
+                 return false;
+             }
++            this.insert_device_statement.reset ();
++
+             return true;
+         }
+         
+         public bool remove_device_from_group (Device dev, DeviceGroup devgroup)
+                 throws SqlError
+         {
+-            this.delete_device_statement.reset ();
+             if (this.delete_device_statement.bind_int (1, (int)dev.Adapter) != Sqlite.OK
+                 || this.delete_device_statement.bind_int (2, (int)dev.Frontend) != Sqlite.OK)
+             {
+@@ -414,9 +414,11 @@
+             }
+             
+             if (this.delete_device_statement.step () != Sqlite.DONE) {
+-                this.throw_last_error ();
++                this.throw_last_error_reset (this.delete_device_statement);
+                 return false;
+             }
++            this.delete_device_statement.reset ();
++
+             return true;
+         }
+         
+@@ -424,8 +426,7 @@
+                 throws SqlError
+         {
+             Gee.List<Timer> timers = new ArrayList<Timer> ();
+-            
+-            this.select_timers_statement.reset ();
++
+             if (this.select_timers_statement.bind_int (1, (int)dev.Id) != Sqlite.OK) {
+                 this.throw_last_error ();
+                 return timers;
+@@ -450,8 +451,9 @@
+                     minute, duration);
+                 timer.EventID = event_id;
+                 timers.add (timer);
+-            }
+-            
++            }            
++            this.select_timers_statement.reset ();
++
+             return timers;
+         }
+         
+@@ -459,8 +461,7 @@
+                 throws SqlError
+         {
+             if (this.contains_timer (timer.Id)) return false;
+-            
+-            this.insert_timer_statement.reset ();
++
+             uint[] start = timer.get_start_time ();
+             if (this.insert_timer_statement.bind_int (1, (int)timer.Id) != Sqlite.OK
+                 || this.insert_timer_statement.bind_int (2, (int)dev.Id) != Sqlite.OK
+@@ -478,17 +479,17 @@
+             }
+             
+             if (this.insert_timer_statement.step () != Sqlite.DONE) {
+-                this.throw_last_error ();
++                this.throw_last_error_reset (this.insert_timer_statement);
+                 return false;
+-            }
++            }            
++            this.insert_timer_statement.reset ();
++
+             return true;
+         }
+         
+         public bool remove_timer_from_device_group (uint timer_id,
+                 DeviceGroup dev) throws SqlError
+         {
+-            this.delete_timer_statement.reset ();
+-            
+             if (this.delete_timer_statement.bind_int (1, (int)timer_id) != Sqlite.OK)
+             {
+                 this.throw_last_error ();
+@@ -496,17 +497,17 @@
+             }
+             
+             if (this.delete_timer_statement.step () != Sqlite.DONE) {
+-                this.throw_last_error ();
++                this.throw_last_error_reset (this.delete_timer_statement);
+                 return false;
+             }
++            this.delete_timer_statement.reset ();
++
+             return true;
+         }
+         
+         public bool remove_all_timers_from_device_group (uint group_id)
+                 throws SqlError 
+         {
+-            this.delete_group_timers_statement.reset ();
+-            
+             if (this.delete_group_timers_statement.bind_int (1, (int)group_id) != Sqlite.OK)
+             {
+                 this.throw_last_error ();
+@@ -514,14 +515,15 @@
+             }
+             
+             if (this.delete_group_timers_statement.step () != Sqlite.DONE) {
+-                this.throw_last_error ();
++                this.throw_last_error_reset (this.delete_group_timers_statement);
+                 return false;
+             }
++            this.delete_group_timers_statement.reset ();
++
+             return true;
+         }
+         
+         public bool contains_timer (uint timer_id) throws SqlError {
+-            this.contains_timer_statement.reset ();
+             if (this.contains_timer_statement.bind_int (1, (int)timer_id) != Sqlite.OK)
+             {
+                 this.throw_last_error ();
+@@ -532,12 +534,12 @@
+             while (this.contains_timer_statement.step () == Sqlite.ROW) {
+                 c = this.contains_timer_statement.column_int (0);
+             }
++            this.contains_timer_statement.reset ();
+             
+             return (c > 0);
+         }
+         
+         public bool update_from_group (DeviceGroup devgroup) throws SqlError {
+-            this.update_group_statement.reset ();
+             if (this.update_group_statement.bind_int (1, (int)devgroup.Type) != Sqlite.OK
+                 || this.update_group_statement.bind_text (2, devgroup.Channels.channels_file.get_path ()) != Sqlite.OK
+                 || this.update_group_statement.bind_text (3, devgroup.RecordingsDirectory.get_path ()) != Sqlite.OK
+@@ -549,30 +551,30 @@
+             }
+             
+             if (this.update_group_statement.step () != Sqlite.DONE) {
+-                this.throw_last_error ();
++                this.throw_last_error_reset (this.update_group_statement);
+                 return false;
+             }
++            this.update_group_statement.reset ();
++
+             return true;
+         }
+ 
+         public bool add_channel_group (string name, out int channel_group_id) throws SqlError {
+-            this.insert_channel_group_statement.reset ();
+             if (this.insert_channel_group_statement.bind_text (1, name) != Sqlite.OK)
+             {
+                 this.throw_last_error ();
+                 return false;
+             }
+             if (this.insert_channel_group_statement.step () != Sqlite.DONE) {
+-                this.throw_last_error ();
++                this.throw_last_error_reset (this.insert_channel_group_statement);
+                 return false;
+             }
+             channel_group_id = (int)this.db.last_insert_rowid ();
++            this.insert_channel_group_statement.reset ();
+             return true;
+         }
+ 
+         public bool remove_channel_group (int group_id) throws SqlError {
+-            this.delete_channel_group_statement.reset ();
+-            this.remove_all_channel_group_statement.reset ();
+             if (this.delete_channel_group_statement.bind_int (1, group_id) != Sqlite.OK)
+             {
+                 this.throw_last_error ();
+@@ -587,14 +589,16 @@
+             this.begin_transaction ();
+             if (this.delete_channel_group_statement.step () != Sqlite.DONE)
+             {
+-                this.throw_last_error ();
++                this.throw_last_error_reset (this.delete_channel_group_statement);
+                 return false;
+             }
++            this.delete_channel_group_statement.reset ();
+             if (this.remove_all_channel_group_statement.step () != Sqlite.DONE)
+             {
+-                this.throw_last_error ();
++                this.throw_last_error_reset (this.remove_all_channel_group_statement);
+                 return false;
+             }
++            this.remove_all_channel_group_statement.reset ();
+             this.end_transaction ();
+ 
+             return true;
+@@ -603,8 +607,6 @@
+         public Gee.List<ChannelGroup> get_channel_groups ()
+                 throws SqlError
+         {
+-            this.select_channel_groups_statement.reset ();
+-
+             ArrayList<ChannelGroup> groups = new ArrayList<ChannelGroup> ();
+             while (this.select_channel_groups_statement.step () == Sqlite.ROW) {
+                 int group_id = this.select_channel_groups_statement.column_int (0);
+@@ -612,14 +614,14 @@
+                 ChannelGroup group = new ChannelGroup (group_id, group_name);
+                 groups.add (group);
+             }
++            this.select_channel_groups_statement.reset ();
++
+             return groups;
+         }
+ 
+         public Gee.List<uint> get_channels_of_group (uint dev_group_id,
+                 int channel_group_id) throws SqlError
+         {
+-            this.select_channels_statement.reset ();
+-
+             if (this.select_channels_statement.bind_int (1, (int)dev_group_id) != Sqlite.OK
+                 || this.select_channels_statement.bind_int (2, channel_group_id) != Sqlite.OK)
+             {
+@@ -630,6 +632,8 @@
+             while (this.select_channels_statement.step () == Sqlite.ROW) {
+                 channels.add (this.select_channels_statement.column_int (0));
+             }
++            this.select_channels_statement.reset ();
++
+             return channels;
+         }
+ 
+@@ -637,7 +641,6 @@
+                  throws SqlError
+         {
+             // Check if channel is already in group
+-            this.add_channel_group_statement.reset ();
+             if (this.add_channel_group_statement.bind_int (1, (int)channel.Sid) != Sqlite.OK
+                 || this.add_channel_group_statement.bind_int (2, (int)channel.GroupId) != Sqlite.OK
+                 || this.add_channel_group_statement.bind_int (3, group_id) != Sqlite.OK)
+@@ -646,16 +649,16 @@
+                 return false;
+             }
+             if (this.add_channel_group_statement.step () != Sqlite.DONE) {
+-                this.throw_last_error ();
++                this.throw_last_error_reset (this.add_channel_group_statement);
+                 return false;
+             }
++            this.add_channel_group_statement.reset ();
+             return true;
+         }
+ 
+         public bool remove_channel_from_group (Channel channel, int group_id)
+                  throws SqlError
+         {
+-            this.remove_channel_group_statement.reset ();
+             if (this.remove_channel_group_statement.bind_int (1, (int)channel.Sid) != Sqlite.OK
+                 || this.remove_channel_group_statement.bind_int (2, (int)channel.GroupId) != Sqlite.OK
+                 || this.remove_channel_group_statement.bind_int (3, group_id) != Sqlite.OK)
+@@ -664,9 +667,10 @@
+                 return false;
+             }
+             if (this.remove_channel_group_statement.step () != Sqlite.DONE) {
+-                this.throw_last_error ();
++                this.throw_last_error_reset (this.remove_channel_group_statement);
+                 return false;
+             }
++            this.remove_channel_group_statement.reset ();
+             return true;
+         }
+     }
+diff -Nur gnome-dvb-daemon-0.1.19/src/database/sqlite/SqliteDatabase.vala gnome-dvb-daemon-0.1.19.new/src/database/sqlite/SqliteDatabase.vala
+--- gnome-dvb-daemon-0.1.19/src/database/sqlite/SqliteDatabase.vala	2010-05-07 19:35:42.000000000 +0200
++++ gnome-dvb-daemon-0.1.19.new/src/database/sqlite/SqliteDatabase.vala	2010-10-01 10:19:19.000000000 +0200
+@@ -130,6 +130,11 @@
+             this.exec_sql ("END;");
+         }
+ 
++        protected void throw_last_error_reset (Statement stmnt) throws SqlError {
++            stmnt.reset ();
++            this.throw_last_error ();
++        }
++
+         protected void throw_last_error (string? errmsg=null) throws SqlError {
+             int code = this.db.errcode ();
+             string msg;
+@@ -138,7 +143,7 @@
+             } else {
+                 msg = errmsg;
+             }
+-            
++
+             switch (code) {
+                 case 1: throw new SqlError.ERROR (msg);
+                 case 2: throw new SqlError.INTERNAL (msg);
+diff -Nur gnome-dvb-daemon-0.1.19/src/database/sqlite/SqliteEPGStore.vala gnome-dvb-daemon-0.1.19.new/src/database/sqlite/SqliteEPGStore.vala
+--- gnome-dvb-daemon-0.1.19/src/database/sqlite/SqliteEPGStore.vala	2010-05-22 20:02:26.000000000 +0200
++++ gnome-dvb-daemon-0.1.19.new/src/database/sqlite/SqliteEPGStore.vala	2010-10-01 10:19:19.000000000 +0200
+@@ -146,8 +146,6 @@
+             if (julian_start <= 0) return false;
+             
+             if (this.contains_event (event, channel_sid, group_id)) {
+-                this.update_event_statement.reset ();
+-                
+                 if (this.update_event_statement.bind_double (1, julian_start) != Sqlite.OK
+                         || this.update_event_statement.bind_int (2, (int)event.duration) != Sqlite.OK
+                         || this.update_event_statement.bind_int (3, (int)event.running_status) != Sqlite.OK
+@@ -163,12 +161,12 @@
+                 }
+                 
+                 if (this.update_event_statement.step () != Sqlite.DONE) {
+-                    this.throw_last_error ();
++                    this.throw_last_error_reset (this.update_event_statement);
+                     return false;
+                 }
++
++                this.update_event_statement.reset ();
+             } else {
+-                this.insert_event_statement.reset ();
+-                
+                 if (this.insert_event_statement.bind_int (1, (int)group_id) != Sqlite.OK
+                         || this.insert_event_statement.bind_int (2, (int)channel_sid) != Sqlite.OK
+                         || this.insert_event_statement.bind_int (3, (int)event.id) != Sqlite.OK
+@@ -184,9 +182,11 @@
+                 }
+                 
+                 if (this.insert_event_statement.step () != Sqlite.DONE) {
+-                    this.throw_last_error ();
++                    this.throw_last_error_reset (this.insert_event_statement);
+                     return false;
+                 }
++
++                this.insert_event_statement.reset ();
+             }
+             return true;
+         }
+@@ -194,8 +194,6 @@
+         public Event? get_event (uint event_id, uint channel_sid,
+                 uint group_id) throws SqlError
+         {
+-            this.select_event_statement.reset ();
+-            
+             if (this.select_event_statement.bind_int (1, (int)group_id) != Sqlite.OK
+                     || this.select_event_statement.bind_int (2, (int)channel_sid) != Sqlite.OK
+                     || this.select_event_statement.bind_int (3, (int)event_id) != Sqlite.OK) {
+@@ -206,20 +204,23 @@
+             int rc = this.select_event_statement.step ();
+             
+             if (rc != Sqlite.ROW && rc != Sqlite.DONE) {
+-                this.throw_last_error ();
++                this.throw_last_error_reset (this.select_event_statement);
+                 return null;
+             }
+             
+             // ROW means there's data, DONE means there's none
+-            if (rc == Sqlite.DONE) return null;
+-            else return this.create_event_from_statement (this.select_event_statement);
++            Event? event = null;
++            if (rc != Sqlite.DONE) {
++                event = this.create_event_from_statement (this.select_event_statement);
++            }                
++            this.select_event_statement.reset ();
++
++            return event;
+         }
+         
+         public bool remove_event (uint event_id, uint channel_sid,
+                 uint group_id) throws SqlError
+         {
+-            this.delete_event_statement.reset ();
+-            
+             if (this.delete_event_statement.bind_int (1, (int)group_id) != Sqlite.OK
+                     || this.delete_event_statement.bind_int (2, (int)channel_sid) != Sqlite.OK
+                     || this.delete_event_statement.bind_int (3, (int)event_id) != Sqlite.OK) {
+@@ -228,17 +229,18 @@
+             }
+             
+             if (this.delete_event_statement.step () != Sqlite.DONE) {
+-                this.throw_last_error ();
++                this.throw_last_error_reset (this.delete_event_statement);
+                 return false;
+             }
+-            
++  
++            this.delete_event_statement.reset ();
++                      
+             return true;
+         }
+ 
+         public bool remove_events_older_than (Event event, uint channel_sid,
+                 uint group_id) throws SqlError
+         {
+-            this.delete_expired_events.reset ();
+             time_t timestamp = event.get_end_timestamp ();
+ 
+             if (this.delete_expired_events.bind_int64 (1, timestamp) != Sqlite.OK
+@@ -250,17 +252,17 @@
+             }
+ 
+             if (this.delete_expired_events.step () != Sqlite.DONE) {
+-                this.throw_last_error ();
++                this.throw_last_error_reset (this.delete_expired_events);
+                 return false;
+             }
+ 
++            this.delete_expired_events.reset ();
++
+             return true;
+         }
+         
+         public bool contains_event (Event event, uint channel_sid, uint group_id) throws SqlError
+         {
+-            this.has_event_statement.reset ();
+-            
+             if (this.has_event_statement.bind_int (1, (int)group_id) != Sqlite.OK
+                     || this.has_event_statement.bind_int (2, (int)channel_sid) != Sqlite.OK
+                     || this.has_event_statement.bind_int (3, (int)event.id) != Sqlite.OK) {
+@@ -272,7 +274,9 @@
+             while (this.has_event_statement.step () == Sqlite.ROW) {
+                 c = this.has_event_statement.column_int (0);
+             }
+-            
++     
++            this.has_event_statement.reset ();
++                   
+             return (c > 0);
+         }
+         
+@@ -301,18 +305,18 @@
+         }
+         
+         public bool remove_events_of_group (uint group_id) throws SqlError {
+-            this.delete_events_group.reset ();
+-            
+             if (this.delete_events_group.bind_int (1, (int)group_id) != Sqlite.OK) {
+                 this.throw_last_error ();
+                 return false;
+             }
+             
+             if (this.delete_events_group.step () != Sqlite.DONE) {
+-                this.throw_last_error ();
++                this.throw_last_error_reset (this.delete_events_group);
+                 return false;
+             }
+             
++            this.delete_events_group.reset ();
++            
+             return true;
+         }
+ 
+@@ -366,8 +370,7 @@
+ 
+         private double to_julian (uint year, uint month, uint day,
+                 uint hour, uint minute, uint second) throws SqlError {
+-            
+-            this.to_julian_statement.reset ();
++
+             string datetime_str = "%04u-%02u-%02u %02u:%02u:%02u".printf (
+                 year, month, day, hour, minute, second);
+             
+@@ -382,7 +385,11 @@
+                 return 0;
+             }
+             
+-            return this.to_julian_statement.column_double (0);
++            double val = this.to_julian_statement.column_double (0);
++            
++            this.to_julian_statement.reset ();
++
++            return val;
+         }
+ 
+     }
+diff -Nur gnome-dvb-daemon-0.1.19/src/Schedule.vala gnome-dvb-daemon-0.1.19.new/src/Schedule.vala
+--- gnome-dvb-daemon-0.1.19/src/Schedule.vala	2010-05-21 17:45:08.000000000 +0200
++++ gnome-dvb-daemon-0.1.19.new/src/Schedule.vala	2010-10-01 10:23:41.000000000 +0200
+@@ -58,7 +58,9 @@
+     
+         // Use weak to avoid ref cycle
+         public weak Channel channel {get; construct;}
+-    
++
++        private static StaticRecMutex mutex = StaticRecMutex ();
++
+         private Sequence<EventElement> events;
+         private Map<uint, weak SequenceIter<EventElement>> event_id_map;
+         private EPGStore epgstore;
+@@ -172,40 +174,41 @@
+             if (event.has_expired ()) return;
+             
+             lock (this.events) {
+-                this.store_event (event);
++                try {
++                    this.store_event (event);
++                } catch (SqlError e) {
++                    critical ("%s", e.message);
++                }
+             }
+         }
+ 
+         public void add_all (Collection<Event> new_events) {
+             lock (this.events) {
+                 try {
++                    mutex.lock ();
+                     ((database.sqlite.SqliteDatabase)this.epgstore).begin_transaction ();
++
++                    foreach (Event event in new_events) {
++                        if (!event.has_expired ())
++                            this.store_event (event);
++                    }
++
++                    ((database.sqlite.SqliteDatabase)this.epgstore).end_transaction ();                    
+                 } catch (SqlError e) {
+                     critical ("%s", e.message);
+-                }
+-                foreach (Event event in new_events) {
+-                    if (!event.has_expired ())
+-                        this.store_event (event);
+-                }
+-                try {
+-                    ((database.sqlite.SqliteDatabase)this.epgstore).end_transaction ();
+-                } catch (SqlError e) {
+-                    critical ("%s", e.message);
++                } finally {
++                    mutex.unlock ();
+                 }
+             }
+         }
+ 
+-        private void store_event (Event event) {
++        private void store_event (Event event) throws SqlError {
++            this.epgstore.add_or_update_event (event, this.channel.Sid,
++                this.channel.GroupId);
++
+             if (!this.event_id_map.contains (event.id)) {
+                 this.create_and_add_event_element (event);
+             }
+-            
+-            try {
+-                this.epgstore.add_or_update_event (event, this.channel.Sid,
+-                    this.channel.GroupId);
+-            } catch (SqlError e) {
+-                critical ("%s", e.message);
+-            }
+         }
+         
+         /**

Modified: packages/unstable/gnome-dvb-daemon/debian/patches/series
URL: http://svn.debian.org/wsvn/pkg-gnome/packages/unstable/gnome-dvb-daemon/debian/patches/series?rev=25228&op=diff
==============================================================================
--- packages/unstable/gnome-dvb-daemon/debian/patches/series [utf-8] (original)
+++ packages/unstable/gnome-dvb-daemon/debian/patches/series [utf-8] Fri Oct  1 09:10:11 2010
@@ -1,0 +1,1 @@
+epg_threads.patch




More information about the pkg-gnome-commits mailing list