mirror of
				https://gitlab.freedesktop.org/pipewire/pipewire.git
				synced 2025-11-03 09:01:54 -05:00 
			
		
		
		
	gst: only return the custom flag when in _render()
Make a custom ACQUIRE flag and if it's set, return the custom error when the pool is empty.
This commit is contained in:
		
							parent
							
								
									c7ccc5abca
								
							
						
					
					
						commit
						d36a867788
					
				
					 2 changed files with 8 additions and 4 deletions
				
			
		| 
						 | 
					@ -168,11 +168,14 @@ acquire_buffer (GstBufferPool * pool, GstBuffer ** buffer,
 | 
				
			||||||
      break;
 | 
					      break;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (params && (params->flags & GST_BUFFER_POOL_ACQUIRE_FLAG_DONTWAIT))
 | 
					    if (params) {
 | 
				
			||||||
 | 
					      if (params->flags & GST_BUFFER_POOL_ACQUIRE_FLAG_DONTWAIT)
 | 
				
			||||||
        goto no_more_buffers;
 | 
					        goto no_more_buffers;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (p->paused)
 | 
					      if ((params->flags & GST_BUFFER_POOL_ACQUIRE_FLAG_LAST) &&
 | 
				
			||||||
 | 
						      p->paused)
 | 
				
			||||||
        goto paused;
 | 
					        goto paused;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    GST_WARNING_OBJECT (pool, "failed to dequeue buffer: %s", strerror(errno));
 | 
					    GST_WARNING_OBJECT (pool, "failed to dequeue buffer: %s", strerror(errno));
 | 
				
			||||||
    g_cond_wait (&p->cond, GST_OBJECT_GET_LOCK (pool));
 | 
					    g_cond_wait (&p->cond, GST_OBJECT_GET_LOCK (pool));
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -873,6 +873,7 @@ gst_pipewire_sink_render (GstBaseSink * bsink, GstBuffer * buffer)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      pw_thread_loop_unlock (pwsink->stream->core->loop);
 | 
					      pw_thread_loop_unlock (pwsink->stream->core->loop);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      params.flags = GST_BUFFER_POOL_ACQUIRE_FLAG_LAST;
 | 
				
			||||||
      res = gst_buffer_pool_acquire_buffer (GST_BUFFER_POOL_CAST (pwsink->stream->pool),
 | 
					      res = gst_buffer_pool_acquire_buffer (GST_BUFFER_POOL_CAST (pwsink->stream->pool),
 | 
				
			||||||
          &b, ¶ms);
 | 
					          &b, ¶ms);
 | 
				
			||||||
      if (res == GST_FLOW_CUSTOM_ERROR_1) {
 | 
					      if (res == GST_FLOW_CUSTOM_ERROR_1) {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue