rename pa_simple_get_playback_latency() to pa_simple_get_latency() and allow its usage on capture streams

git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@939 fefdeb5f-60dc-0310-8127-8f9354f1896f
This commit is contained in:
Lennart Poettering 2006-05-20 14:59:02 +00:00
parent acc6552356
commit cc61b57a32
3 changed files with 4 additions and 6 deletions

View file

@ -423,14 +423,12 @@ unlock_and_fail:
return -1; return -1;
} }
pa_usec_t pa_simple_get_playback_latency(pa_simple *p, int *rerror) { pa_usec_t pa_simple_get_latency(pa_simple *p, int *rerror) {
pa_usec_t t; pa_usec_t t;
int negative; int negative;
assert(p); assert(p);
CHECK_VALIDITY_RETURN_ANY(rerror, p->direction == PA_STREAM_PLAYBACK, PA_ERR_BADSTATE, (pa_usec_t) -1);
pa_threaded_mainloop_lock(p->mainloop); pa_threaded_mainloop_lock(p->mainloop);
for (;;) { for (;;) {

View file

@ -136,7 +136,7 @@ int pa_simple_drain(pa_simple *s, int *error);
int pa_simple_read(pa_simple *s, void*data, size_t length, int *error); int pa_simple_read(pa_simple *s, void*data, size_t length, int *error);
/** Return the playback latency. \since 0.5 */ /** Return the playback latency. \since 0.5 */
pa_usec_t pa_simple_get_playback_latency(pa_simple *s, int *error); pa_usec_t pa_simple_get_latency(pa_simple *s, int *error);
/** Flush the playback buffer. \since 0.5 */ /** Flush the playback buffer. \since 0.5 */
int pa_simple_flush(pa_simple *s, int *error); int pa_simple_flush(pa_simple *s, int *error);

View file

@ -78,8 +78,8 @@ int main(PA_GCC_UNUSED int argc, char*argv[]) {
#if 0 #if 0
pa_usec_t latency; pa_usec_t latency;
if ((latency = pa_simple_get_playback_latency(s, &error)) == (pa_usec_t) -1) { if ((latency = pa_simple_get_latency(s, &error)) == (pa_usec_t) -1) {
fprintf(stderr, __FILE__": pa_simple_get_playback_latency() failed: %s\n", pa_strerror(error)); fprintf(stderr, __FILE__": pa_simple_get_latency() failed: %s\n", pa_strerror(error));
goto finish; goto finish;
} }