mirror of
				https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
				synced 2025-11-03 09:01:50 -05:00 
			
		
		
		
	scache: when playing a sample from the cache make sure not queue them up when the sink is suspended
libcanberra already sets the appropriate flags for uncached sample streams, we now need to make sure to set them for cached samples too.
This commit is contained in:
		
							parent
							
								
									180589511d
								
							
						
					
					
						commit
						f9b9579cf4
					
				
					 5 changed files with 31 additions and 19 deletions
				
			
		| 
						 | 
				
			
			@ -351,7 +351,12 @@ int pa_scache_play_item(pa_core *c, const char *name, pa_sink *sink, pa_volume_t
 | 
			
		|||
    if (p)
 | 
			
		||||
        pa_proplist_update(merged, PA_UPDATE_REPLACE, p);
 | 
			
		||||
 | 
			
		||||
    if (pa_play_memchunk(sink, &e->sample_spec, &e->channel_map, &e->memchunk, pass_volume ? &r : NULL, merged, sink_input_idx) < 0)
 | 
			
		||||
    if (pa_play_memchunk(sink,
 | 
			
		||||
                         &e->sample_spec, &e->channel_map,
 | 
			
		||||
                         &e->memchunk,
 | 
			
		||||
                         pass_volume ? &r : NULL,
 | 
			
		||||
                         merged,
 | 
			
		||||
                         PA_SINK_INPUT_NO_CREATE_ON_SUSPEND|PA_SINK_INPUT_KILL_ON_SUSPEND, sink_input_idx) < 0)
 | 
			
		||||
        goto fail;
 | 
			
		||||
 | 
			
		||||
    pa_proplist_free(merged);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -173,7 +173,8 @@ pa_sink_input* pa_memblockq_sink_input_new(
 | 
			
		|||
        const pa_channel_map *map,
 | 
			
		||||
        pa_memblockq *q,
 | 
			
		||||
        pa_cvolume *volume,
 | 
			
		||||
        pa_proplist *p) {
 | 
			
		||||
        pa_proplist *p,
 | 
			
		||||
        pa_sink_input_flags_t flags) {
 | 
			
		||||
 | 
			
		||||
    memblockq_stream *u = NULL;
 | 
			
		||||
    pa_sink_input_new_data data;
 | 
			
		||||
| 
						 | 
				
			
			@ -198,6 +199,7 @@ pa_sink_input* pa_memblockq_sink_input_new(
 | 
			
		|||
    pa_sink_input_new_data_set_channel_map(&data, map);
 | 
			
		||||
    pa_sink_input_new_data_set_volume(&data, volume);
 | 
			
		||||
    pa_proplist_update(data.proplist, PA_UPDATE_REPLACE, p);
 | 
			
		||||
    data.flags |= flags;
 | 
			
		||||
 | 
			
		||||
    pa_sink_input_new(&u->sink_input, sink->core, &data);
 | 
			
		||||
    pa_sink_input_new_data_done(&data);
 | 
			
		||||
| 
						 | 
				
			
			@ -237,6 +239,7 @@ int pa_play_memblockq(
 | 
			
		|||
        pa_memblockq *q,
 | 
			
		||||
        pa_cvolume *volume,
 | 
			
		||||
        pa_proplist *p,
 | 
			
		||||
        pa_sink_input_flags_t flags,
 | 
			
		||||
        uint32_t *sink_input_index) {
 | 
			
		||||
 | 
			
		||||
    pa_sink_input *i;
 | 
			
		||||
| 
						 | 
				
			
			@ -245,7 +248,7 @@ int pa_play_memblockq(
 | 
			
		|||
    pa_assert(ss);
 | 
			
		||||
    pa_assert(q);
 | 
			
		||||
 | 
			
		||||
    if (!(i = pa_memblockq_sink_input_new(sink, ss, map, q, volume, p)))
 | 
			
		||||
    if (!(i = pa_memblockq_sink_input_new(sink, ss, map, q, volume, p, flags)))
 | 
			
		||||
        return -1;
 | 
			
		||||
 | 
			
		||||
    pa_sink_input_put(i);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -31,7 +31,8 @@ pa_sink_input* pa_memblockq_sink_input_new(
 | 
			
		|||
        const pa_channel_map *map,
 | 
			
		||||
        pa_memblockq *q,
 | 
			
		||||
        pa_cvolume *volume,
 | 
			
		||||
        pa_proplist *p);
 | 
			
		||||
        pa_proplist *p,
 | 
			
		||||
        pa_sink_input_flags_t flags);
 | 
			
		||||
 | 
			
		||||
void pa_memblockq_sink_input_set_queue(pa_sink_input *i, pa_memblockq *q);
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -42,6 +43,7 @@ int pa_play_memblockq(
 | 
			
		|||
        pa_memblockq *q,
 | 
			
		||||
        pa_cvolume *cvolume,
 | 
			
		||||
        pa_proplist *p,
 | 
			
		||||
        pa_sink_input_flags_t flags,
 | 
			
		||||
        uint32_t *sink_input_index);
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -43,6 +43,7 @@ int pa_play_memchunk(
 | 
			
		|||
        const pa_memchunk *chunk,
 | 
			
		||||
        pa_cvolume *volume,
 | 
			
		||||
        pa_proplist *p,
 | 
			
		||||
        pa_sink_input_flags_t flags,
 | 
			
		||||
        uint32_t *sink_input_index) {
 | 
			
		||||
 | 
			
		||||
    pa_memblockq *q;
 | 
			
		||||
| 
						 | 
				
			
			@ -59,7 +60,7 @@ int pa_play_memchunk(
 | 
			
		|||
 | 
			
		||||
    pa_assert_se(pa_memblockq_push(q, chunk) >= 0);
 | 
			
		||||
 | 
			
		||||
    if ((r = pa_play_memblockq(sink, ss, map, q, volume, p, sink_input_index)) < 0) {
 | 
			
		||||
    if ((r = pa_play_memblockq(sink, ss, map, q, volume, p, flags, sink_input_index)) < 0) {
 | 
			
		||||
        pa_memblockq_free(q);
 | 
			
		||||
        return r;
 | 
			
		||||
    }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -32,6 +32,7 @@ int pa_play_memchunk(
 | 
			
		|||
        const pa_memchunk *chunk,
 | 
			
		||||
        pa_cvolume *cvolume,
 | 
			
		||||
        pa_proplist *p,
 | 
			
		||||
        pa_sink_input_flags_t flags,
 | 
			
		||||
        uint32_t *sink_input_index);
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue