- /* One more available input port */
- muxer_comp->available_input_ports++;
- BT_LOGD("Leaving disconnected input port available for future connections: "
- "comp-addr=%p, muxer-comp-addr=%p, port-addr=%p, "
- "port-name=\"%s\", avail-input-port-count=%zu",
- self_component, muxer_comp, port, bt_port_get_name(port),
- muxer_comp->available_input_ports);
+ status = bt_self_component_port_input_message_iterator_seek_beginning(
+ upstream_msg_iter->msg_iter);
+ if (status != BT_MESSAGE_ITERATOR_STATUS_OK) {
+ goto end;
+ }
+
+ empty_message_queue(upstream_msg_iter);
+ }
+
+ /* Seek all previously active upstream iterators */
+ for (i = 0; i < muxer_msg_iter->active_muxer_upstream_msg_iters->len;
+ i++) {
+ struct muxer_upstream_msg_iter *upstream_msg_iter =
+ muxer_msg_iter->active_muxer_upstream_msg_iters->pdata[i];
+
+ status = bt_self_component_port_input_message_iterator_seek_beginning(
+ upstream_msg_iter->msg_iter);
+ if (status != BT_MESSAGE_ITERATOR_STATUS_OK) {
+ goto end;
+ }
+
+ empty_message_queue(upstream_msg_iter);
+ }
+
+ /* Make them all active */
+ for (i = 0; i < muxer_msg_iter->ended_muxer_upstream_msg_iters->len;
+ i++) {
+ struct muxer_upstream_msg_iter *upstream_msg_iter =
+ muxer_msg_iter->ended_muxer_upstream_msg_iters->pdata[i];
+
+ g_ptr_array_add(muxer_msg_iter->active_muxer_upstream_msg_iters,
+ upstream_msg_iter);
+ muxer_msg_iter->ended_muxer_upstream_msg_iters->pdata[i] = NULL;
+ }
+
+ g_ptr_array_remove_range(muxer_msg_iter->ended_muxer_upstream_msg_iters,
+ 0, muxer_msg_iter->ended_muxer_upstream_msg_iters->len);
+ muxer_msg_iter->last_returned_ts_ns = INT64_MIN;
+ muxer_msg_iter->clock_class_expectation =
+ MUXER_MSG_ITER_CLOCK_CLASS_EXPECTATION_ANY;
+
+end:
+ return status;