music_pipe: added music_pipe_push()
Added music_pipe_allocate(), music_pipe_push() and music_pipe_cancel(). Those functions allow the caller (decoder thread in this case) to do its own chunk management. The functions music_pipe_flush() and music_pipe_tag() can now be removed.
This commit is contained in:
		@@ -98,6 +98,7 @@ static void decoder_run_song(const struct song *song, const char *uri)
 | 
			
		||||
	decoder.seeking = false;
 | 
			
		||||
	decoder.stream_tag = NULL;
 | 
			
		||||
	decoder.decoder_tag = NULL;
 | 
			
		||||
	decoder.chunk = NULL;
 | 
			
		||||
 | 
			
		||||
	dc.state = DECODE_STATE_START;
 | 
			
		||||
	dc.command = DECODE_COMMAND_NONE;
 | 
			
		||||
@@ -194,7 +195,10 @@ static void decoder_run_song(const struct song *song, const char *uri)
 | 
			
		||||
 | 
			
		||||
	pcm_convert_deinit(&decoder.conv_state);
 | 
			
		||||
 | 
			
		||||
	music_pipe_flush();
 | 
			
		||||
	/* flush the last chunk */
 | 
			
		||||
	if (decoder.chunk != NULL &&
 | 
			
		||||
	    decoder_flush_chunk(&decoder, NULL) != DECODE_COMMAND_NONE)
 | 
			
		||||
		music_pipe_cancel(decoder.chunk);
 | 
			
		||||
 | 
			
		||||
	if (close_instream)
 | 
			
		||||
		input_stream_close(&input_stream);
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user