diff --git a/pinos/gst/gstpinosclock.c b/pinos/gst/gstpinosclock.c index 0a03992e9..8e8583dc1 100644 --- a/pinos/gst/gstpinosclock.c +++ b/pinos/gst/gstpinosclock.c @@ -50,7 +50,11 @@ gst_pinos_clock_get_internal_time (GstClock * clock) pinos_stream_get_time (pclock->stream, &t); - result = gst_util_uint64_scale_int (t.ticks, GST_SECOND, t.rate); + if (t.rate) + result = gst_util_uint64_scale_int (t.ticks, GST_SECOND, t.rate); + else + result = GST_CLOCK_TIME_NONE; + GST_DEBUG ("%"PRId64", %d %"PRId64, t.ticks, t.rate, result); return result; diff --git a/pinos/gst/gstpinosdeviceprovider.c b/pinos/gst/gstpinosdeviceprovider.c index 04212d786..807b1bf26 100644 --- a/pinos/gst/gstpinosdeviceprovider.c +++ b/pinos/gst/gstpinosdeviceprovider.c @@ -207,13 +207,17 @@ new_node (const PinosNodeInfo *info) type = GST_PINOS_DEVICE_TYPE_SINK; for (i = 0; i < info->n_input_formats; i++) { - gst_caps_append (caps, gst_caps_from_format (info->input_formats[i])); + GstCaps *c1 = gst_caps_from_format (info->input_formats[i]); + if (c1) + gst_caps_append (caps, c1); } } else if (info->max_outputs > 0 && info->max_inputs == 0) { type = GST_PINOS_DEVICE_TYPE_SOURCE; for (i = 0; i < info->n_output_formats; i++) { - gst_caps_append (caps, gst_caps_from_format (info->output_formats[i])); + GstCaps *c1 = gst_caps_from_format (info->output_formats[i]); + if (c1) + gst_caps_append (caps, c1); } } else { type = GST_PINOS_DEVICE_TYPE_UNKNOWN;