Torna indietro   Hardware Upgrade Forum > Software > Linux, Unix, OS alternativi

DJI Osmo Pocket 4: la gimbal camera tascabile cresce e ha nuovi controlli fisici
DJI Osmo Pocket 4: la gimbal camera tascabile cresce e ha nuovi controlli fisici
DJI porta un importante aggiornamento alla sua linea di gimbal camera tascabili con Osmo Pocket 4: sensore CMOS da 1 pollice rinnovato, gamma dinamica a 14 stop, profilo colore D-Log a 10 bit, slow motion a 4K/240fps e 107 GB di archiviazione integrata. Un prodotto pensato per i creator avanzati, ma che convince anche per l'uso quotidiano
Sony INZONE H6 Air: il primo headset open-back di Sony per giocatori
Sony INZONE H6 Air: il primo headset open-back di Sony per giocatori
Il primo headset open-back della linea INZONE arriva a 200 euro con driver derivati dalle cuffie da studio MDR-MV1 e un peso record di soli 199 grammi
Nutanix cambia pelle: dall’iperconvergenza alla piattaforma full stack per cloud ibrido e IA
Nutanix cambia pelle: dall’iperconvergenza alla piattaforma full stack per cloud ibrido e IA
Al .NEXT 2026 di Chicago, Nutanix ha mostrato quanto sia cambiata: una piattaforma software che gestisce VM, container e carichi di lavoro IA ovunque, dall’on-premise al cloud pubblico. Con un’esecuzione rapidissima sulle partnership e sulla migrazione da VMware
Tutti gli articoli Tutte le news

Vai al Forum
Rispondi
 
Strumenti
Old 19-10-2009, 23:12   #1
Janky
Senior Member
 
L'Avatar di Janky
 
Iscritto dal: Feb 2004
Città: Lecco/Milano
Messaggi: 2863
Usare un diff

dunque...io ho questo diff...

come faccio a farlo funzionare correttamente?

Codice:
diff –git a/Classes/Radio.h b/Classes/Radio.h
index 32f6b4a..5a358f7 100644
— a/Classes/Radio.h
+++ b/Classes/Radio.h
@@ -63,6 +63,9 @@ typedef struct {
UIAlertView *alert;
iPhoneRadioAppDelegate *appDelegate;
AQPlayerState audioState;
+
+	BOOL ICECast; //true when IceCast Stream, false for ShoutCast
+
}

-(id)init;
diff –git a/Classes/Radio.m b/Classes/Radio.m
index f661960..9f9b319 100644
— a/Classes/Radio.m
+++ b/Classes/Radio.m
@@ -341,12 +341,72 @@ void interruptionListenerCallback (void	*inUserData, UInt32 interruptionState) {
}
}

+//
+// Added By Sébastien Stormacq
+// ShoutCast support
+//
+
+-(int)parseShoutCastHeaders:(NSData*)buffer {
+
+	streamHeaders = [[NSMutableDictionary alloc] init];
+
+	NSString* rawHeader = [[NSString alloc] initWithData:buffer encoding:NSASCIIStringEncoding];
+	NSString* DELIMITER = @”\r\n”;
+	NSString* END_OF_HEADER_DELIMITER = @”\r\n\r\n”;
+
+	NSArray* lines = [rawHeader componentsSeparatedByString:DELIMITER];
+	for(NSString* line in lines) {
+	 //NSLog(@”line = %@”, line);
+
+	 //did we reach the last line ?
+	 if ([line isEqualToString:@""])
+	 break;
+	 else {
+
+	 NSRange range = [line rangeOfString:@":"];
+	 if (range.location != NSNotFound) {
+	 NSString* key = [line substringToIndex:range.location];
+	 NSString* value = [line substringFromIndex:range.location+1];
+
+	 [streamHeaders setValue:value forKey:key];
+	 }
+	 }
+	}
+
+	int result = [rawHeader rangeOfString:END_OF_HEADER_DELIMITER].location + [END_OF_HEADER_DELIMITER length];
+
+	NSLog(@”ICECAST Headers = %@”, streamHeaders);
+	NSLog(@”ICECAST startOfData = %d”, result);
+
+	[rawHeader release];
+
+	return result;
+}
+//
+// end of addition
+//
+
+#pragma mark NSURLConnection callBacks
+
-(void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response {
NSHTTPURLResponse *u = (NSHTTPURLResponse *)response;
NSLog(@”HTTP Response = %u”, [u statusCode]);
-
-	streamHeaders = [u allHeaderFields];
- [streamHeaders retain];
+
+	//
+	// Modified By Sébastien Stormacq
+	// ShoutCast support
+	//
+	if ([[u allHeaderFields] objectForKey:@”Ice-Audio-Info”] != nil) {
+	 ICECast = YES;
+	 streamHeaders = [u allHeaderFields];
+	 [streamHeaders retain];
+	} else {
+	 //likely a shout cast stream
+	 ICECast = NO;
+	}
+	//
+	// end of modifications
+	//

NSLog(@”HTTP Response Headers = %@”, streamHeaders);
}
@@ -355,14 +415,42 @@ void interruptionListenerCallback (void	*inUserData, UInt32 interruptionState) {
//	NSLog(@”didReceiveData %u bytes”, [data length]);
int length = [data length];
const char *bytes = (const char *)[data bytes];
+
+	int positionOfFirstData;
+
if (!icyInterval) {
-	 icyInterval = [[streamHeaders objectForKey:@"Icy-Metaint"] intValue];
+
+	 if (ICECast) {
+	 icyInterval = [[streamHeaders objectForKey:@"Icy-Metaint"] intValue];
+
+	 //
+	 // Added By Sébastien Stormacq
+	 // ShoutCast support
+	 //
+	 } else {
+	 //parse first bytes until empty line to read ShoutCast headers
+	 positionOfFirstData = [self parseShoutCastHeaders:data];
+	 icyInterval = [[streamHeaders objectForKey:@"icy-metaint"] intValue];
+
+	 //for ICECast, remove the text header from first data block
+	 NSRange range;
+	 range.location = positionOfFirstData;
+	 range.length = [data length] – positionOfFirstData;
+	 //NSLog(@”range = %d, %d”, range.location, range.length);
+
+	 NSData* subData = [data subdataWithRange:range];
+	 length = [subData length];
+	 bytes = (const char *)[subData bytes];
+	 //NSLog(@”Pruned Data %u bytes\n—\n%@\n—”, length, [NSString stringWithCString:bytes length:length]);
+	 }
+	 //
+	 // End of additions
+	 //
+
NSLog(@”ICY INTERVAL = %u”, icyInterval);
-	 [self fillcurrentPacket:bytes withLength:length];
-	}
-	else {
-	 [self fillcurrentPacket:bytes withLength:length];
}
+
+	[self fillcurrentPacket:bytes withLength:length];
}

-(void)reconnect {
diff –git a/Classes/iPhoneRadioAppDelegate.m b/Classes/iPhoneRadioAppDelegate.m
index 2c4dd35..2eba747 100644
— a/Classes/iPhoneRadioAppDelegate.m
+++ b/Classes/iPhoneRadioAppDelegate.m
@@ -54,7 +54,9 @@
[window makeKeyAndVisible];

radio = [[Radio alloc] init];
-	[radio connect:@"http://stream.radiojavan.com/radiojavan" withDelegate:self withGain:(0.5)];
+	//[radio connect:@"http://stream.radiojavan.com/radiojavan" withDelegate:self withGain:(0.5)];
+	 [radio connect:@"http://stream.radiovazogasy.com:8001" withDelegate:self withGain:(0.5)];
+
}


è per modificare il codice di un'applicazione per iphone

grazie mille
__________________
C'era un moscerino sul tuo schermo
Janky è offline   Rispondi citando il messaggio o parte di esso
Old 20-10-2009, 08:14   #2
sacarde
Senior Member
 
Iscritto dal: Apr 2004
Messaggi: 9516
http://digilander.libero.it/uzappi/L...x-patches.html
sacarde è offline   Rispondi citando il messaggio o parte di esso
Old 21-10-2009, 22:43   #3
Janky
Senior Member
 
L'Avatar di Janky
 
Iscritto dal: Feb 2004
Città: Lecco/Milano
Messaggi: 2863
ok.. mettiamo che io ho sul Desktop la cartella a/Classes, con all'interno tutti i vari file da patchare...

devo creare una cartella b/Classes o la crea lui in automatico??

ho provato a crearla io stesso e ho lanciato il comando, questo è l'output:

Codice:
missing header for unified diff at line 5 of patch
can't find file to patch at input line 5
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|diff –git a/Classes/Radio.h b/Classes/Radio.h
|index 32f6b4a..5a358f7 100644
|— a/Classes/Radio.h
|+++ b/Classes/Radio.h
--------------------------
File to patch:
e si blocca quindi aspettando che gli passo il file da patchare, ho inserito quindi

Codice:
/Users/janky/Desktop/a/Classes/Radio.h
però ricevo sto errore:

Codice:
patching file /Users/janky/Desktop/a/Classes/Radio.h
patch: **** malformed patch at line 14: diff –git a/Classes/Radio.m b/Classes/Radio.m
è sbagliato il diff o sbaglio io qualcosa?

grazie!
__________________
C'era un moscerino sul tuo schermo
Janky è offline   Rispondi citando il messaggio o parte di esso
Old 22-10-2009, 13:14   #4
sacarde
Senior Member
 
Iscritto dal: Apr 2004
Messaggi: 9516
prova a eseguirlo da dentro: /Users/janky/Desktop
sacarde è offline   Rispondi citando il messaggio o parte di esso
 Rispondi


DJI Osmo Pocket 4: la gimbal camera tascabile cresce e ha nuovi controlli fisici DJI Osmo Pocket 4: la gimbal camera tascabile cr...
Sony INZONE H6 Air: il primo headset open-back di Sony per giocatori Sony INZONE H6 Air: il primo headset open-back d...
Nutanix cambia pelle: dall’iperconvergenza alla piattaforma full stack per cloud ibrido e IA Nutanix cambia pelle: dall’iperconvergenza alla ...
Recensione Xiaomi Pad 8 Pro: potenza bruta e HyperOS 3 per sfidare la fascia alta Recensione Xiaomi Pad 8 Pro: potenza bruta e Hyp...
NZXT H9 Flow RGB+, Kraken Elite 420 e F140X: abbiamo provato il tris d'assi di NZXT NZXT H9 Flow RGB+, Kraken Elite 420 e F140X: abb...
Opera Browser Connector: ChatGPT e Claud...
Nuova Opel Astra: maturità elettr...
Il film di Call of Duty ha finalmente un...
Tra nuove mappe e modalità: Battl...
Narwal Flow 2 ufficiale: 31000 Pa di asp...
GPT-Rosalind: OpenAI lancia il suo primo...
Meta aumenta i prezzi dei visori Meta Qu...
Metro 2039 annunciato con un trailer di ...
UMC aumenterà i prezzi dei wafer ...
Intel rafforza la divisione Foundry: arr...
Apple MacBook Pro 16'' M4 Max a 3.499€: ...
Apple ignora la crisi? Gli iPhone 18 Pro...
Claude Opus 4.7 è disponibile: Anthropic...
OnePlus conferma i rumor: la console por...
Netflix guarda al futuro: prezzi pi&ugra...
Chromium
GPU-Z
OCCT
LibreOffice Portable
Opera One Portable
Opera One 106
CCleaner Portable
CCleaner Standard
Cpu-Z
Driver NVIDIA GeForce 546.65 WHQL
SmartFTP
Trillian
Google Chrome Portable
Google Chrome 120
VirtualBox
Tutti gli articoli Tutte le news Tutti i download

Strumenti

Regole
Non Puoi aprire nuove discussioni
Non Puoi rispondere ai messaggi
Non Puoi allegare file
Non Puoi modificare i tuoi messaggi

Il codice vB è On
Le Faccine sono On
Il codice [IMG] è On
Il codice HTML è Off
Vai al Forum


Tutti gli orari sono GMT +1. Ora sono le: 10:33.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
Served by www3v