File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -177,6 +177,10 @@ - (void)startTasksForDevice:(NSString *)deviceName
177177
178178- (void )dispatchedStartRtlsdrTasksForFrequencies : (NSArray *)frequenciesArray category : (NSDictionary *)categoryDictionary device : (NSString *)audioInputDeviceName
179179{
180+ // All of the "Listen" button actions eventually call this method
181+
182+ [self checkIcecastAndEZStream ];
183+
180184 // Create TaskItem for the audio source, send lpcm data to stdout at specified sample rate
181185
182186 NSArray * audioOutputFilterStringArray = [self .audioOutputFilterString componentsSeparatedByString: @" " ];
@@ -737,6 +741,30 @@ - (void)radioTaskReceivedStderrData:(NSNotification *)notif
737741 [fh waitForDataInBackgroundAndNotify ];
738742}
739743
744+ // ==================================================================================
745+ // checkIcecastAndEZStream
746+ // ==================================================================================
747+
748+ - (void )checkIcecastAndEZStream
749+ {
750+ BOOL restartServices = NO ;
751+
752+ if (self.appDelegate .icecastController .icecastTask == NULL )
753+ {
754+ restartServices = YES ;
755+ }
756+
757+ if (self.appDelegate .ezStreamController .ezStreamTaskPipelineManager .taskPipelineStatus != kTaskPipelineStatusRunning )
758+ {
759+ restartServices = YES ;
760+ }
761+
762+ if (restartServices == YES )
763+ {
764+ [self .appDelegate restartServices ];
765+ }
766+ }
767+
740768// ==================================================================================
741769// retuneTaskForFrequency:
742770// ==================================================================================
Original file line number Diff line number Diff line change 402402 {
403403 var holdAudioSrc = audioPlayer . src ;
404404
405+ /*
405406 if (audioPlayer.paused == true)
406407 {
407408 updateSrcForAudioElement(audioPlayer);
410411 {
411412 seekToEndForAudioElement(audioPlayer);
412413 }
414+ */
415+
416+ audioPlayer . pause ( ) ;
417+ //seekToEndForAudioElement(audioPlayer);
418+ emptyBufferDataForAudioPlayer ( audioPlayer ) ;
419+ updateSrcForAudioElement ( audioPlayer ) ;
413420
414421 audioPlayer . autoplay = true ;
415422 audioPlayer . load ( ) ;
You can’t perform that action at this time.
0 commit comments