source/sink: Don't let pa_{sink, source}_get_latency_within_thread() return -1 if process_msg() fails

None of the callers checks the return value anyway. Return the offset only
if message processing fails. This is in preparation for the next patch.
This commit is contained in:
Georg Chini 2017-04-17 19:48:37 +02:00
parent 65f7ca4414
commit a5fccd4645
2 changed files with 2 additions and 4 deletions

View file

@ -1549,8 +1549,7 @@ pa_usec_t pa_sink_get_latency_within_thread(pa_sink *s) {
/* FIXME: We probably should make this a proper vtable callback instead of going through process_msg() */ /* FIXME: We probably should make this a proper vtable callback instead of going through process_msg() */
if (o->process_msg(o, PA_SINK_MESSAGE_GET_LATENCY, &usec, 0, NULL) < 0) o->process_msg(o, PA_SINK_MESSAGE_GET_LATENCY, &usec, 0, NULL);
return -1;
/* usec is unsigned, so check that the offset can be added to usec without /* usec is unsigned, so check that the offset can be added to usec without
* underflowing. */ * underflowing. */

View file

@ -1144,8 +1144,7 @@ pa_usec_t pa_source_get_latency_within_thread(pa_source *s) {
/* FIXME: We probably should make this a proper vtable callback instead of going through process_msg() */ /* FIXME: We probably should make this a proper vtable callback instead of going through process_msg() */
if (o->process_msg(o, PA_SOURCE_MESSAGE_GET_LATENCY, &usec, 0, NULL) < 0) o->process_msg(o, PA_SOURCE_MESSAGE_GET_LATENCY, &usec, 0, NULL);
return -1;
/* usec is unsigned, so check that the offset can be added to usec without /* usec is unsigned, so check that the offset can be added to usec without
* underflowing. */ * underflowing. */