[FFmpeg-cvslog] lavd/pulse_audio_enc: add pointer checks

Lukasz Marek git at videolan.org
Wed Apr 30 14:41:57 CEST 2014


ffmpeg | branch: master | Lukasz Marek <lukasz.m.luki2 at gmail.com> | Wed Apr 30 00:23:14 2014 +0200| [a1e5be5c1a0c98206a1ae034d278702f5c8ef2a3] | committer: Lukasz Marek

lavd/pulse_audio_enc: add pointer checks

Signed-off-by: Lukasz Marek <lukasz.m.luki2 at gmail.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=a1e5be5c1a0c98206a1ae034d278702f5c8ef2a3
---

 libavdevice/pulse_audio_enc.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/libavdevice/pulse_audio_enc.c b/libavdevice/pulse_audio_enc.c
index 8acbe8b..b8c77db 100644
--- a/libavdevice/pulse_audio_enc.c
+++ b/libavdevice/pulse_audio_enc.c
@@ -692,8 +692,10 @@ static void pulse_get_output_timestamp(AVFormatContext *h, int stream, int64_t *
     pa_threaded_mainloop_lock(s->mainloop);
     pa_stream_get_latency(s->stream, &latency, &neg);
     pa_threaded_mainloop_unlock(s->mainloop);
-    *wall = av_gettime();
-    *dts = s->timestamp - (neg ? -latency : latency);
+    if (wall)
+        *wall = av_gettime();
+    if (dts)
+        *dts = s->timestamp - (neg ? -latency : latency);
 }
 
 static int pulse_get_device_list(AVFormatContext *h, AVDeviceInfoList *device_list)



More information about the ffmpeg-cvslog mailing list