Skip to content
Browse files

Fixed some memory leaks. Fixed the background playback issue.

  • Loading branch information...
1 parent 1ce0a24 commit 47ab580ef59b334fa06307834544420da52163af @yoyofr committed Feb 17, 2012
View
4 dumb/src/src/helpers/memfile.c
@@ -77,7 +77,9 @@ static long dumb_memfile_getnc(char *ptr, long n, void *f)
static void dumb_memfile_close(void *f)
{
- free(f);
+ MEMFILE *m = (MEMFILE *)(mem_dumbfile->file);
+ free(m);
+ free(mem_dumbfile);
}
static void *dumb_memfile_open(const char *filename)
View
12 modizer/Classes/ModizMusicPlayer.mm
@@ -993,6 +993,7 @@ -(BOOL) iPhoneDrv_PlayStart {
UInt32 err;
UInt32 i;
+ AudioQueueStop( mAudioQueue, TRUE );
/*
* Enqueue all the allocated buffers before starting the playback.
* The audio callback will be called as soon as one buffer becomes
@@ -1029,6 +1030,15 @@ -(BOOL) iPhoneDrv_PlayStart {
return 1;
}
+-(BOOL) iPhoneDrv_LittlePlayStart {
+ UInt32 err;
+
+ bGlobalAudioPause=2;
+ err = AudioQueueStart( mAudioQueue, NULL );
+
+ return 1;
+}
+
-(void) iPhoneDrv_PlayWaitStop {
int counter=0;
mQueueIsBeingStopped = TRUE;
@@ -3346,6 +3356,8 @@ -(int) LoadModule:(NSString*)_filePath defaultMODPLAYER:(int)defaultMODPLAYER sl
mplayer_error_msg[0]=0;
mSingleSubMode=singleSubMode;
+
+ [self iPhoneDrv_LittlePlayStart];
if (archiveMode==0) {
extension = [_filePath pathExtension];
View
9 modizer/Classes/ModizerConstants.h
@@ -14,8 +14,8 @@
#define DEFAULT_WAIT_TIME_MS 0.001 //in s
#define DEFAULT_WAIT_TIME_UADE_MS 0.001 //in s
-//#define STATISTICS_URL @"http://localhost:8080"
-#define STATISTICS_URL @"https://modizerdb.appspot.com"
+#define STATISTICS_URL @"http://localhost:8080"
+//#define STATISTICS_URL @"https://modizerdb.appspot.com"
#define USERGUIDE_URL @"UserGuide"
#define WORLDCHARTS_DEFAULTLIST @"ListALL"
@@ -32,15 +32,15 @@
#define PLAYBACK_FREQ 44100
#define SOUND_BUFFER_SIZE_SAMPLE PLAYBACK_FREQ/30
-#define SOUND_BUFFER_NB 60 //1second
+#define SOUND_BUFFER_NB 60 //2seconds
#define SPECTRUM_BANDS 64
#define LOG2_SPECTRUM_BANDS 6
#define BEAT_THRESHOLD_MIN 256
#define BEAT_THRESHOLD_FACTOR 2.0f
-#define SND_THREAD_PRIO 1.00f
+#define SND_THREAD_PRIO 0.9f
#define SND_BUFFER_CURRENTTIME_FIX 1000
@@ -152,7 +152,6 @@ VSS,WB,ML,MOD15_ST-IV,AGI,TPU,QPA,SQT,QTS"
#define SUPPORTED_FILETYPE_WMIDI @"MID,MIDI"
-
#define extAMIGAList @"AST,AHX,THX,ADPCM,AMC,ABK,AAM,ALP,AON,AON4,AON8,ADSC,MOD_ADSC4,BSS,BD,BDS,UDS,KRIS,CIN,CORE,CUS,CUST,CUSTOM,CM,RK,RKB,DZ,MKIIO,DL,DL_DELI,DLN,DH,DW,DWOLD,DLM2,DM2,DLM1,DM1,DSR,DB,DIGI,DSC,DSS,DNS,EMS,EMSV6,EX,FC13,FC3,FC,FC14,FC4,FRED,GRAY,BFC,BSI,FC-BSI,FP,FW,GLUE,GM,EA,MG,HD,HIPC,SOC,EMOD,QC,IMS,DUM,IS,IS20,JAM,JC,JMF,JCB,JCBO,JPN,JPND,JP,JT,MON_OLD,JO,HIP,MCMD,SOG,HIP7,S7G,HST,KH,POWT,PT,LME,MON,MFP,HN,MTP2,THN,MC,MCR,MCO,MK2,MKII,AVP,MW,MAX,MCMD_ORG,MED,MMD0,MMD1,MMD2,MSO,MD,MMDC,DMU,MUG,DMU2,MUG2,MA,MM4,MM8,MMS,NTP,TWO,OCTAMED,OKT,ONE,DAT,PS,SNK,PVP,PAP,PSA,MOD_DOC,MOD15,MOD15_MST,MOD_NTK,MOD_NTK1,MOD_NTK2,MOD_NTKAMP,MOD_FLT4,MOD,MOD_COMP,!PM!,40A,40B,41A,50A,60A,61A,AC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,MSC,MTK,RAD,RAW,RIX,ROL,SA2,SAT,SCI,SNG,XAD,XMS,XSM"
#define extC64ChipList @"SID,AHX,HVL"
View
13 modizer/Classes/RootViewControllerHVSC.mm
@@ -2170,12 +2170,15 @@ - (void)dealloc {
free(search_dbHVSC_entries_data);
}
- for (int i=0;i<search_dbHVSC_nb_entries;i++) {
-
+ if (indexTitles) {
+ [indexTitles release];
+ indexTitles=nil;
}
-
- if (indexTitles) [indexTitles release];
- if (indexTitlesDownload) [indexTitlesDownload release];
+ if (indexTitlesDownload) {
+ [indexTitlesDownload release];
+ indexTitlesDownload=nil;
+ }
+
if (mFileMngr) {
[mFileMngr release];
View
12 modizer/Classes/RootViewControllerIphone.mm
@@ -6756,12 +6756,14 @@ - (void)dealloc {
free(search_dbHVSC_entries_data);
}
- for (int i=0;i<search_dbHVSC_nb_entries;i++) {
-
+ if (indexTitles) {
+ [indexTitles release];
+ indexTitles=nil;
+ }
+ if (indexTitlesDownload) {
+ [indexTitlesDownload release];
+ indexTitlesDownload=nil;
}
-
- if (indexTitles) [indexTitles release];
- if (indexTitlesDownload) [indexTitlesDownload release];
if (mFileMngr) {
[mFileMngr release];
View
4 modizer/Classes/RootViewControllerLocalBrowser.mm
@@ -2004,12 +2004,12 @@ - (void)dealloc {
if (indexTitles) {
- indexTitles=nil;
[indexTitles release];
+ indexTitles=nil;
}
if (indexTitlesSpace) {
- indexTitlesSpace=nil;
[indexTitlesSpace release];
+ indexTitlesSpace=nil;
}
if (mFileMngr) {
View
16 modizer/Classes/RootViewControllerMODLAND.mm
@@ -2707,8 +2707,20 @@ - (void)dealloc {
free(search_db_entries_data);
}
- if (indexTitles) [indexTitles release];
- if (indexTitlesDownload) [indexTitlesDownload release];
+ if (indexTitles) {
+ [indexTitles release];
+ indexTitles=nil;
+ }
+ if (indexTitlesDownload) {
+ [indexTitlesDownload release];
+ indexTitlesDownload=nil;
+ }
+
+ if (mFileMngr) {
+ [mFileMngr release];
+ mFileMngr=nil;
+ }
+
[super dealloc];
}
View
11 modizer/Classes/RootViewControllerPlaylist.mm
@@ -2495,8 +2495,15 @@ - (void)dealloc {
free(search_local_entries_data);
}
- if (indexTitles) [indexTitles release];
- if (indexTitlesDownload) [indexTitlesDownload release];
+ if (indexTitles) {
+ [indexTitles release];
+ indexTitles=nil;
+ }
+ if (indexTitlesDownload) {
+ [indexTitlesDownload release];
+ indexTitlesDownload=nil;
+ }
+
if (mFileMngr) {
[mFileMngr release];
View
BIN ...deproj/project.xcworkspace/xcuserdata/ymagnien.xcuserdatad/UserInterfaceState.xcuserstate
Binary file not shown.

0 comments on commit 47ab580

Please sign in to comment.
Something went wrong with that request. Please try again.