mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-10-29 05:40:27 -04:00
gst: do some extra checks
This commit is contained in:
parent
37ae4e80c3
commit
c86673b557
2 changed files with 11 additions and 3 deletions
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue