commit be87ffbd851ece2ef592c9e567111da6bb9ce386
Author: phantomjinx <[email protected]>
Date: Sat Nov 27 15:54:52 2010 +0000
Minor filetype fixes and fix for a deadlock
* gp_itdb.c
* misc.c
* Removal oversight of mp4file includes
* Makefile.am
* Add m4a filetype plugin to extra dist
* file_convert.c
* Make the conversion scheduler function try the mutex lock rather than
blindly grabbing it. Since this function is called every 100ms then a
later attempt will be made.
* Missing unlock in conversion_convert_track causes deadlock.
libgtkpod/file_convert.c | 13 ++++++++++---
libgtkpod/gp_itdb.c | 1 -
libgtkpod/misc.c | 1 -
plugins/Makefile.am | 3 ++-
4 files changed, 12 insertions(+), 6 deletions(-)
---
diff --git a/libgtkpod/file_convert.c b/libgtkpod/file_convert.c
index 1912623..ae75a1f 100644
--- a/libgtkpod/file_convert.c
+++ b/libgtkpod/file_convert.c
@@ -1483,17 +1483,20 @@ static gboolean conversion_scheduler(gpointer data) {
gboolean result;
g_return_val_if_fail (data, FALSE);
- /* debug ("conversion_scheduler enter\n"); */
+ debug ("conversion_scheduler enter\n");
gdk_threads_enter();
- g_mutex_lock (conv->mutex);
+ if (! g_mutex_trylock(conv->mutex)) {
+ gdk_threads_leave();
+ return FALSE;
+ }
result = conversion_scheduler_unlocked(conv);
g_mutex_unlock (conv->mutex);
gdk_threads_leave();
- /* debug ("conversion_scheduler exit\n");*/
+ debug ("conversion_scheduler exit\n");
return result;
}
@@ -2036,11 +2039,14 @@ static gboolean conversion_convert_track(Conversion
*conv, ConvTrack *ctr) {
ctr->converted_file = NULL;
result = FALSE;
}
+
+ g_mutex_unlock (conv->mutex);
}
}
}
if (result == TRUE) { /* determine size of new file */
+ g_mutex_lock (conv->mutex);
struct stat statbuf;
if (g_stat(ctr->converted_file, &statbuf) == 0) {
ctr->converted_size = statbuf.st_size;
@@ -2054,6 +2060,7 @@ static gboolean conversion_convert_track(Conversion
*conv, ConvTrack *ctr) {
ctr->converted_file = NULL;
result = FALSE;
}
+ g_mutex_unlock (conv->mutex);
}
/* Fill in additional info (currently only gapless info for MP3s */
diff --git a/libgtkpod/gp_itdb.c b/libgtkpod/gp_itdb.c
index f5bdd83..0c0de3f 100644
--- a/libgtkpod/gp_itdb.c
+++ b/libgtkpod/gp_itdb.c
@@ -42,7 +42,6 @@
#include "file_convert.h"
#include "misc.h"
#include "misc_track.h"
-#include "mp4file.h"
#include "prefs.h"
#include "syncdir.h"
#include "autodetection.h"
diff --git a/libgtkpod/misc.c b/libgtkpod/misc.c
index 781d902..03ae28d 100644
--- a/libgtkpod/misc.c
+++ b/libgtkpod/misc.c
@@ -44,7 +44,6 @@ ffla | This program is distributed in the hope that it will
be useful,
#include "misc.h"
#include "prefs.h"
#include "misc_track.h"
-#include "mp4file.h"
#include "file_convert.h"
#define DEBUG_MISC 0
diff --git a/plugins/Makefile.am b/plugins/Makefile.am
index 02c8ad6..7764027 100644
--- a/plugins/Makefile.am
+++ b/plugins/Makefile.am
@@ -19,6 +19,7 @@ SUBDIRS = . \
filetype_flac \
filetype_wav \
filetype_video \
- filetype_mp4
+ filetype_mp4 \
+ filetype_m4a
# indent
------------------------------------------------------------------------------
Increase Visibility of Your 3D Game App & Earn a Chance To Win $500!
Tap into the largest installed PC base & get more eyes on your game by
optimizing for Intel(R) Graphics Technology. Get started today with the
Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs.
http://p.sf.net/sfu/intelisp-dev2dev
_______________________________________________
gtkpod-cvs2 mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gtkpod-cvs2