pulsesink: handle NULL timing info

Don't crash when the timing info is not yet available.
This commit is contained in:
Wim Taymans 2009-04-10 21:31:06 +02:00 committed by Wim Taymans
parent b3d66d5e8d
commit 776b0ae8cb

View file

@ -1092,8 +1092,9 @@ gst_pulseringbuffer_commit (GstRingBuffer * buf, guint64 * sample,
/* check if we need to uncork after writing the samples */
if (pbuf->corked) {
const pa_timing_info *info = pa_stream_get_timing_info (pbuf->stream);
const pa_timing_info *info;
if ((info = pa_stream_get_timing_info (pbuf->stream))) {
GST_LOG_OBJECT (psink,
"read_index at %" G_GUINT64_FORMAT ", offset %" G_GINT64_FORMAT,
info->read_index, offset);
@ -1104,6 +1105,9 @@ gst_pulseringbuffer_commit (GstRingBuffer * buf, guint64 * sample,
if (!gst_pulsering_set_corked (pbuf, FALSE, FALSE))
goto uncork_failed;
}
} else {
GST_LOG_OBJECT (psink, "no timing info available yet");
}
}
}
/* we consumed all samples here */