mirror of
				https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
				synced 2025-11-03 09:01:50 -05:00 
			
		
		
		
	fix source volume adjustment: copy memchunk before changing the volume of it
git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@572 fefdeb5f-60dc-0310-8127-8f9354f1896f
This commit is contained in:
		
							parent
							
								
									708c650ad1
								
							
						
					
					
						commit
						57713350d7
					
				
					 1 changed files with 10 additions and 5 deletions
				
			
		| 
						 | 
					@ -33,6 +33,7 @@
 | 
				
			||||||
#include <polypcore/xmalloc.h>
 | 
					#include <polypcore/xmalloc.h>
 | 
				
			||||||
#include <polypcore/core-subscribe.h>
 | 
					#include <polypcore/core-subscribe.h>
 | 
				
			||||||
#include <polypcore/log.h>
 | 
					#include <polypcore/log.h>
 | 
				
			||||||
 | 
					#include <polypcore/sample-util.h>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include "source.h"
 | 
					#include "source.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -182,11 +183,15 @@ void pa_source_post(pa_source*s, const pa_memchunk *chunk) {
 | 
				
			||||||
    pa_source_ref(s);
 | 
					    pa_source_ref(s);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (!pa_cvolume_is_norm(&s->sw_volume)) {
 | 
					    if (!pa_cvolume_is_norm(&s->sw_volume)) {
 | 
				
			||||||
        pa_memchunk_make_writable(chunk, s->core->memblock_stat, 0);
 | 
					        pa_memchunk vchunk = *chunk;
 | 
				
			||||||
        pa_volume_memchunk(chunk, &s->sample_spec, &s->sw_volume);
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
        
 | 
					        
 | 
				
			||||||
    pa_idxset_foreach(s->outputs, do_post, (void*) chunk);
 | 
					        pa_memblock_ref(vchunk.memblock);
 | 
				
			||||||
 | 
					        pa_memchunk_make_writable(&vchunk, s->core->memblock_stat, 0);
 | 
				
			||||||
 | 
					        pa_volume_memchunk(&vchunk, &s->sample_spec, &s->sw_volume);
 | 
				
			||||||
 | 
					        pa_idxset_foreach(s->outputs, do_post, &vchunk);
 | 
				
			||||||
 | 
					        pa_memblock_unref(vchunk.memblock);
 | 
				
			||||||
 | 
					    } else
 | 
				
			||||||
 | 
					        pa_idxset_foreach(s->outputs, do_post, (void*) chunk);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    pa_source_unref(s);
 | 
					    pa_source_unref(s);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue