spa: fix an C++ invalid type conversion

In file included from spa/tests/test-cpp.cpp:49:
../spa/include/spa/param/latency-utils.h: In function ‘int spa_latency_parse(const spa_pod*, spa_latency_info*)’:
../spa/include/spa/param/latency-utils.h:95:25: error: invalid conversion from ‘int’ to ‘spa_direction’ [-fpermissive]
   95 |         info->direction &= 1;
      |         ~~~~~~~~~~~~~~~~^~~~
      |                         |
      |                         int
This commit is contained in:
Peter Hutterer 2021-06-04 13:38:49 +10:00
parent 2a8b7594bc
commit 98503a84b3

View file

@ -92,7 +92,7 @@ spa_latency_parse(const struct spa_pod *latency, struct spa_latency_info *info)
SPA_PARAM_LATENCY_minNs, SPA_POD_OPT_Long(&info->min_ns), SPA_PARAM_LATENCY_minNs, SPA_POD_OPT_Long(&info->min_ns),
SPA_PARAM_LATENCY_maxNs, SPA_POD_OPT_Long(&info->max_ns))) < 0) SPA_PARAM_LATENCY_maxNs, SPA_POD_OPT_Long(&info->max_ns))) < 0)
return res; return res;
info->direction &= 1; info->direction = (enum spa_direction)(info->direction & 1);
return 0; return 0;
} }