mirror of
				https://gitlab.freedesktop.org/pipewire/pipewire.git
				synced 2025-11-03 09:01:54 -05:00 
			
		
		
		
	example: fix buffer check
This commit is contained in:
		
							parent
							
								
									6d673cc77c
								
							
						
					
					
						commit
						5da6973863
					
				
					 1 changed files with 2 additions and 3 deletions
				
			
		| 
						 | 
					@ -158,10 +158,11 @@ static int on_source_ready(void *_data, int status)
 | 
				
			||||||
	struct spa_io_buffers *io = &data->source_output[0];
 | 
						struct spa_io_buffers *io = &data->source_output[0];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (io->status != SPA_STATUS_HAVE_DATA ||
 | 
						if (io->status != SPA_STATUS_HAVE_DATA ||
 | 
				
			||||||
	    io->buffer_id > MAX_BUFFERS)
 | 
						    io->buffer_id >= MAX_BUFFERS)
 | 
				
			||||||
		return -EINVAL;
 | 
							return -EINVAL;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	b = &data->buffers[io->buffer_id];
 | 
						b = &data->buffers[io->buffer_id];
 | 
				
			||||||
 | 
						io->status = SPA_STATUS_NEED_DATA;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	datas = b->buffer.datas;
 | 
						datas = b->buffer.datas;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -216,8 +217,6 @@ static int on_source_ready(void *_data, int status)
 | 
				
			||||||
			munmap(map, datas[0].maxsize + datas[0].mapoffset);
 | 
								munmap(map, datas[0].maxsize + datas[0].mapoffset);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	io->status = SPA_STATUS_NEED_DATA;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	if ((res = spa_node_process(data->source)) < 0)
 | 
						if ((res = spa_node_process(data->source)) < 0)
 | 
				
			||||||
		printf("got process error %d\n", res);
 | 
							printf("got process error %d\n", res);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue