Properly enter loop if starting point is 0, i.E undefined. (#844)
* Fix channel 0 being ignored * Allow music to properly loop * Added channel index. Co-authored-by: Leifa♥ <26681464+TrickyLeifa@users.noreply.github.com>
This commit is contained in:
		
							parent
							
								
									90ff911376
								
							
						
					
					
						commit
						4a2f19433d
					
				@ -219,19 +219,19 @@ void AOMusicPlayer::set_looping(bool loop_song, int channel)
 | 
			
		||||
    loop_sync[channel] = 0;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  if (loop_start[channel] > 0) {
 | 
			
		||||
    if (loop_end[channel] > 0 && (loop_end[channel] > loop_start[channel]))
 | 
			
		||||
  if (loop_start[channel] >= 0) {
 | 
			
		||||
    if (loop_start[channel] < loop_end[channel])
 | 
			
		||||
    {
 | 
			
		||||
      //Loop when the endpoint is reached.
 | 
			
		||||
      loop_sync[channel] = BASS_ChannelSetSync(
 | 
			
		||||
          m_stream_list[channel], BASS_SYNC_END | BASS_SYNC_MIXTIME,
 | 
			
		||||
          m_stream_list[channel], BASS_SYNC_POS | BASS_SYNC_MIXTIME,
 | 
			
		||||
          loop_end[channel], loopProc, &loop_start[channel]);
 | 
			
		||||
    }
 | 
			
		||||
    else
 | 
			
		||||
    {
 | 
			
		||||
      //Loop when the end of the file is reached.
 | 
			
		||||
      loop_sync[channel] = BASS_ChannelSetSync(
 | 
			
		||||
          m_stream_list[channel], BASS_SYNC_POS | BASS_SYNC_MIXTIME,
 | 
			
		||||
          m_stream_list[channel], BASS_SYNC_END | BASS_SYNC_MIXTIME,
 | 
			
		||||
          0, loopProc, &loop_start[channel]);
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user