mirror of
				https://gitlab.freedesktop.org/pipewire/pipewire.git
				synced 2025-11-03 09:01:54 -05:00 
			
		
		
		
	audiomixer: don't mix when no input
Give the app a chance to provide some input when there is nothing to mix anymore in process_output. alsa: fix buffer size
This commit is contained in:
		
							parent
							
								
									e864836300
								
							
						
					
					
						commit
						90ea120d3c
					
				
					 2 changed files with 4 additions and 4 deletions
				
			
		| 
						 | 
					@ -73,7 +73,7 @@ struct _SpaALSAMonitor {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  snd_ctl_t *ctl_hndl;
 | 
					  snd_ctl_t *ctl_hndl;
 | 
				
			||||||
  struct udev_device *dev;
 | 
					  struct udev_device *dev;
 | 
				
			||||||
  char card_name[64];
 | 
					  char card_name[16];
 | 
				
			||||||
  int dev_idx;
 | 
					  int dev_idx;
 | 
				
			||||||
  int stream_idx;
 | 
					  int stream_idx;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -144,7 +144,7 @@ fill_item (SpaALSAMonitor *this,
 | 
				
			||||||
  if (!(name && *name))
 | 
					  if (!(name && *name))
 | 
				
			||||||
    name = "Unknown";
 | 
					    name = "Unknown";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  snprintf (card_name, 63, "%s,%d", this->card_name, snd_pcm_info_get_device (dev_info));
 | 
					  snprintf (card_name, 64, "%s,%d", this->card_name, snd_pcm_info_get_device (dev_info));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  spa_pod_builder_add (&b,
 | 
					  spa_pod_builder_add (&b,
 | 
				
			||||||
    SPA_POD_TYPE_OBJECT, &f[0], 0, this->type.monitor.MonitorItem,
 | 
					    SPA_POD_TYPE_OBJECT, &f[0], 0, this->type.monitor.MonitorItem,
 | 
				
			||||||
| 
						 | 
					@ -261,7 +261,7 @@ open_card (SpaALSAMonitor *this, struct udev_device *dev)
 | 
				
			||||||
  if ((str = path_get_card_id (udev_device_get_property_value (dev, "DEVPATH"))) == NULL)
 | 
					  if ((str = path_get_card_id (udev_device_get_property_value (dev, "DEVPATH"))) == NULL)
 | 
				
			||||||
    return -1;
 | 
					    return -1;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  snprintf (this->card_name, 63, "hw:%s", str);
 | 
					  snprintf (this->card_name, 16, "hw:%s", str);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  if ((err = snd_ctl_open (&this->ctl_hndl, this->card_name, 0)) < 0) {
 | 
					  if ((err = snd_ctl_open (&this->ctl_hndl, this->card_name, 0)) < 0) {
 | 
				
			||||||
    spa_log_error (this->log, "can't open control for card %s: %s", this->card_name, snd_strerror (err));
 | 
					    spa_log_error (this->log, "can't open control for card %s: %s", this->card_name, snd_strerror (err));
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -780,7 +780,7 @@ spa_audiomixer_node_process_output (SpaNode *node)
 | 
				
			||||||
      if (port->io == NULL || port->n_buffers == 0)
 | 
					      if (port->io == NULL || port->n_buffers == 0)
 | 
				
			||||||
        continue;
 | 
					        continue;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      if (port->queued_bytes > 0 && port->queued_bytes < min_queued)
 | 
					      if (port->queued_bytes < min_queued)
 | 
				
			||||||
        min_queued = port->queued_bytes;
 | 
					        min_queued = port->queued_bytes;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    if (min_queued != SIZE_MAX && min_queued > 0) {
 | 
					    if (min_queued != SIZE_MAX && min_queued > 0) {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue