You've already forked FFmpeg
							
							
				mirror of
				https://github.com/FFmpeg/FFmpeg.git
				synced 2025-10-30 23:18:11 +02:00 
			
		
		
		
	pulse: get latency only when needed
Signed-off-by: Federico Simoncelli <fsimonce@redhat.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
		
				
					committed by
					
						 Michael Niedermayer
						Michael Niedermayer
					
				
			
			
				
	
			
			
			
						parent
						
							b13d6c837f
						
					
				
				
					commit
					b53d6ce3fd
				
			| @@ -109,7 +109,6 @@ static int pulse_read_packet(AVFormatContext *s, AVPacket *pkt) | ||||
| { | ||||
|     PulseData *pd  = s->priv_data; | ||||
|     int res; | ||||
|     pa_usec_t latency; | ||||
|  | ||||
|     if (av_new_packet(pkt, pd->frame_size) < 0) { | ||||
|         return AVERROR(ENOMEM); | ||||
| @@ -122,13 +121,15 @@ static int pulse_read_packet(AVFormatContext *s, AVPacket *pkt) | ||||
|         return AVERROR(EIO); | ||||
|     } | ||||
|  | ||||
|     if ((latency = pa_simple_get_latency(pd->s, &res)) == (pa_usec_t) -1) { | ||||
|         av_log(s, AV_LOG_ERROR, "pa_simple_get_latency() failed: %s\n", | ||||
|                pa_strerror(res)); | ||||
|         return AVERROR(EIO); | ||||
|     } | ||||
|  | ||||
|     if (pd->pts == AV_NOPTS_VALUE) { | ||||
|         pa_usec_t latency; | ||||
|  | ||||
|         if ((latency = pa_simple_get_latency(pd->s, &res)) == (pa_usec_t) -1) { | ||||
|             av_log(s, AV_LOG_ERROR, "pa_simple_get_latency() failed: %s\n", | ||||
|                    pa_strerror(res)); | ||||
|             return AVERROR(EIO); | ||||
|         } | ||||
|  | ||||
|         pd->pts = -latency; | ||||
|     } | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user