mirror of
				https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
				synced 2025-11-03 09:01:50 -05:00 
			
		
		
		
	Move the encoding loop around a bit such that it does not grab the data and keep it for the next loop iteration.
git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/coling@2481 fefdeb5f-60dc-0310-8127-8f9354f1896f
This commit is contained in:
		
							parent
							
								
									3767cdb6d1
								
							
						
					
					
						commit
						6c1dd6e54b
					
				
					 1 changed files with 12 additions and 10 deletions
				
			
		| 
						 | 
					@ -216,6 +216,7 @@ static void thread_func(void *userdata) {
 | 
				
			||||||
                    ssize_t l;
 | 
					                    ssize_t l;
 | 
				
			||||||
                    void *p;
 | 
					                    void *p;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                    if (u->encoded_memchunk.length <= 0) {
 | 
				
			||||||
                        if (u->raw_memchunk.length <= 0) {
 | 
					                        if (u->raw_memchunk.length <= 0) {
 | 
				
			||||||
                            if (u->raw_memchunk.memblock)
 | 
					                            if (u->raw_memchunk.memblock)
 | 
				
			||||||
                                pa_memblock_unref(u->raw_memchunk.memblock);
 | 
					                                pa_memblock_unref(u->raw_memchunk.memblock);
 | 
				
			||||||
| 
						 | 
					@ -223,10 +224,11 @@ static void thread_func(void *userdata) {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                            /* Grab unencoded data */
 | 
					                            /* Grab unencoded data */
 | 
				
			||||||
                            pa_sink_render(u->sink, u->block_size, &u->raw_memchunk);
 | 
					                            pa_sink_render(u->sink, u->block_size, &u->raw_memchunk);
 | 
				
			||||||
 | 
					                            p = pa_memblock_acquire(u->raw_memchunk.memblock);
 | 
				
			||||||
 | 
					                            pa_memblock_release(u->raw_memchunk.memblock);
 | 
				
			||||||
                        }
 | 
					                        }
 | 
				
			||||||
                        pa_assert(u->raw_memchunk.length > 0);
 | 
					                        pa_assert(u->raw_memchunk.length > 0);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                    if (u->encoded_memchunk.length <= 0) {
 | 
					 | 
				
			||||||
                        /* Encode it */
 | 
					                        /* Encode it */
 | 
				
			||||||
                        size_t rl = u->raw_memchunk.length;
 | 
					                        size_t rl = u->raw_memchunk.length;
 | 
				
			||||||
                        u->encoding_overhead += u->next_encoding_overhead;
 | 
					                        u->encoding_overhead += u->next_encoding_overhead;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue