stream: return -EIO when doing get_time in != STREAMING

The stream should be streaming before the get_time call is meaningful.

Various places in the code already check this an fall back to a default
value, we just need to return an error here.
This commit is contained in:
Wim Taymans 2026-02-12 12:20:14 +01:00
parent 12fb9ab831
commit 11d5e071ec
4 changed files with 8 additions and 5 deletions

View file

@ -151,7 +151,7 @@ static void test_create(void)
/* check id, only when connected */
spa_assert_se(pw_stream_get_node_id(stream) == SPA_ID_INVALID);
spa_assert_se(pw_stream_get_time_n(stream, &tm, sizeof(tm)) == 0);
spa_assert_se(pw_stream_get_time_n(stream, &tm, sizeof(tm)) == -EIO);
spa_assert_se(tm.now == 0);
spa_assert_se(tm.rate.num == 0);
spa_assert_se(tm.rate.denom == 0);