mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2026-02-18 22:05:37 -05:00
drop the PA_SOURCE_CAN_SUSPEND and PA_SINK_CAN_SUSPEND flags, since they were a bad idea in the first place. All sinks/sources are now *required* to handle suspending in one way or another. Luckily all current sink/source implementations handle it fine anyway.
git-svn-id: file:///home/lennart/svn/public/pulseaudio/branches/lennart@1894 fefdeb5f-60dc-0310-8127-8f9354f1896f
This commit is contained in:
parent
77ed60ce4c
commit
ba322a49e1
12 changed files with 196 additions and 214 deletions
|
|
@ -300,16 +300,14 @@ typedef enum pa_seek_mode {
|
|||
typedef enum pa_sink_flags {
|
||||
PA_SINK_HW_VOLUME_CTRL = 1, /**< Supports hardware volume control */
|
||||
PA_SINK_LATENCY = 2, /**< Supports latency querying */
|
||||
PA_SINK_HARDWARE = 4, /**< Is a hardware sink of some kind, in contrast to "virtual"/software sinks \since 0.9.3 */
|
||||
PA_SINK_CAN_SUSPEND = 8 /**< Can suspend \since 0.9.7 */
|
||||
PA_SINK_HARDWARE = 4 /**< Is a hardware sink of some kind, in contrast to "virtual"/software sinks \since 0.9.3 */
|
||||
} pa_sink_flags_t;
|
||||
|
||||
/** Special source flags. \since 0.8 */
|
||||
typedef enum pa_source_flags {
|
||||
PA_SOURCE_HW_VOLUME_CTRL = 1, /**< Supports hardware volume control */
|
||||
PA_SOURCE_LATENCY = 2, /**< Supports latency querying */
|
||||
PA_SOURCE_HARDWARE = 4, /**< Is a hardware source of some kind, in contrast to "virtual"/software source \since 0.9.3 */
|
||||
PA_SOURCE_CAN_SUSPEND = 8 /**< Can suspend \since 0.9.7 */
|
||||
PA_SOURCE_HARDWARE = 4 /**< Is a hardware source of some kind, in contrast to "virtual"/software source \since 0.9.3 */
|
||||
} pa_source_flags_t;
|
||||
|
||||
/** A generic free() like callback prototype */
|
||||
|
|
|
|||
|
|
@ -423,7 +423,7 @@ static void create_stream_complete(pa_stream *s) {
|
|||
tv.tv_usec += LATENCY_IPOL_INTERVAL_USEC; /* every 100 ms */
|
||||
pa_assert(!s->auto_timing_update_event);
|
||||
s->auto_timing_update_event = s->mainloop->time_new(s->mainloop, &tv, &auto_timing_update_callback, s);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void pa_create_stream_callback(pa_pdispatch *pd, uint32_t command, PA_GCC_UNUSED uint32_t tag, pa_tagstruct *t, void *userdata) {
|
||||
|
|
@ -497,7 +497,7 @@ void pa_create_stream_callback(pa_pdispatch *pd, uint32_t command, PA_GCC_UNUSED
|
|||
s->state = PA_STREAM_READY;
|
||||
request_auto_timing_update(s, 1);
|
||||
s->state = PA_STREAM_CREATING;
|
||||
|
||||
|
||||
} else
|
||||
create_stream_complete(s);
|
||||
|
||||
|
|
@ -540,12 +540,12 @@ static int create_stream(
|
|||
if (attr)
|
||||
s->buffer_attr = *attr;
|
||||
else {
|
||||
/* half a second */
|
||||
/* half a second, with minimum request of 10 ms */
|
||||
s->buffer_attr.tlength = pa_bytes_per_second(&s->sample_spec)/2;
|
||||
s->buffer_attr.maxlength = (s->buffer_attr.tlength*3)/2;
|
||||
s->buffer_attr.minreq = s->buffer_attr.tlength/100;
|
||||
s->buffer_attr.minreq = s->buffer_attr.tlength/50;
|
||||
s->buffer_attr.prebuf = s->buffer_attr.tlength - s->buffer_attr.minreq;
|
||||
s->buffer_attr.fragsize = s->buffer_attr.tlength/100;
|
||||
s->buffer_attr.fragsize = s->buffer_attr.tlength/50;
|
||||
}
|
||||
|
||||
if (!dev)
|
||||
|
|
@ -921,7 +921,7 @@ static void stream_get_timing_info_callback(pa_pdispatch *pd, uint32_t command,
|
|||
}
|
||||
|
||||
/* First, let's complete the initialization, if necessary. */
|
||||
if (o->stream->state == PA_STREAM_CREATING)
|
||||
if (o->stream->state == PA_STREAM_CREATING)
|
||||
create_stream_complete(o->stream);
|
||||
|
||||
if (o->stream->latency_update_callback)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue