diff options
Diffstat (limited to 'src/pulse')
-rw-r--r-- | src/pulse/channelmap.h | 6 | ||||
-rw-r--r-- | src/pulse/client-conf.h | 2 | ||||
-rw-r--r-- | src/pulse/context.c | 4 | ||||
-rw-r--r-- | src/pulse/def.h | 18 | ||||
-rw-r--r-- | src/pulse/internal.h | 4 | ||||
-rw-r--r-- | src/pulse/introspect.h | 6 | ||||
-rw-r--r-- | src/pulse/mainloop.h | 2 | ||||
-rw-r--r-- | src/pulse/proplist.h | 2 | ||||
-rw-r--r-- | src/pulse/pulseaudio.h | 2 | ||||
-rw-r--r-- | src/pulse/sample.h | 4 | ||||
-rw-r--r-- | src/pulse/stream.c | 50 | ||||
-rw-r--r-- | src/pulse/subscribe.h | 2 | ||||
-rw-r--r-- | src/pulse/timeval.h | 2 |
13 files changed, 50 insertions, 54 deletions
diff --git a/src/pulse/channelmap.h b/src/pulse/channelmap.h index eef0ac17..d4db45b0 100644 --- a/src/pulse/channelmap.h +++ b/src/pulse/channelmap.h @@ -50,7 +50,7 @@ * \li pa_channel_map_init_stereo() - Create a standard stereo mapping. * \li pa_channel_map_init_auto() - Create a standard channel map for a specific number of channels * \li pa_channel_map_init_extend() - Similar to - * pa_channel_map_init_auto() but synthesize a channel map if noone + * pa_channel_map_init_auto() but synthesize a channel map if no * predefined one is known for the specified number of channels. * * \section conv_sec Convenience Functions @@ -251,7 +251,7 @@ typedef struct pa_channel_map { * pa_channel_map_valid() will fail for it. */ pa_channel_map* pa_channel_map_init(pa_channel_map *m); -/** Initialize the specified channel map for monoaural audio and return a pointer to it */ +/** Initialize the specified channel map for monaural audio and return a pointer to it */ pa_channel_map* pa_channel_map_init_mono(pa_channel_map *m); /** Initialize the specified channel map for stereophonic audio and return a pointer to it */ @@ -282,7 +282,7 @@ const char* pa_channel_position_to_pretty_string(pa_channel_position_t pos); * it might become part of an ABI. */ #define PA_CHANNEL_MAP_SNPRINT_MAX 336 -/** Make a humand readable string from the specified channel map */ +/** Make a human readable string from the specified channel map */ char* pa_channel_map_snprint(char *s, size_t l, const pa_channel_map *map); /** Parse a channel position list or well-known mapping name into a diff --git a/src/pulse/client-conf.h b/src/pulse/client-conf.h index 78844a12..ab97dc6a 100644 --- a/src/pulse/client-conf.h +++ b/src/pulse/client-conf.h @@ -38,7 +38,7 @@ typedef struct pa_client_conf { pa_client_conf *pa_client_conf_new(void); void pa_client_conf_free(pa_client_conf *c); -/* Load the configuration data from the speicified file, overwriting +/* Load the configuration data from the specified file, overwriting * the current settings in *c. When the filename is NULL, the * default client configuration file name is used. */ int pa_client_conf_load(pa_client_conf *c, const char *filename); diff --git a/src/pulse/context.c b/src/pulse/context.c index 28d17191..991a886f 100644 --- a/src/pulse/context.c +++ b/src/pulse/context.c @@ -364,10 +364,10 @@ static void pstream_memblock_callback(pa_pstream *p, uint32_t channel, int64_t o if ((s = pa_dynarray_get(c->record_streams, channel))) { if (chunk->memblock) { - pa_memblockq_seek(s->record_memblockq, offset, seek); + pa_memblockq_seek(s->record_memblockq, offset, seek, TRUE); pa_memblockq_push_align(s->record_memblockq, chunk); } else - pa_memblockq_seek(s->record_memblockq, offset+chunk->length, seek); + pa_memblockq_seek(s->record_memblockq, offset+chunk->length, seek, TRUE); if (s->read_callback) { size_t l; diff --git a/src/pulse/def.h b/src/pulse/def.h index cae08942..d5bbefe3 100644 --- a/src/pulse/def.h +++ b/src/pulse/def.h @@ -71,7 +71,7 @@ typedef enum pa_stream_state { PA_STREAM_UNCONNECTED, /**< The stream is not yet connected to any sink or source */ PA_STREAM_CREATING, /**< The stream is being created */ PA_STREAM_READY, /**< The stream is established, you may pass audio data to it now */ - PA_STREAM_FAILED, /**< An error occured that made the stream invalid */ + PA_STREAM_FAILED, /**< An error occurred that made the stream invalid */ PA_STREAM_TERMINATED /**< The stream has been terminated cleanly */ } pa_stream_state_t; @@ -216,7 +216,7 @@ typedef enum pa_stream_flags { * sink/device. Useful if you use any of the PA_STREAM_FIX_ flags * and want to make sure that resampling never takes place -- * which might happen if the stream is moved to another - * sink/source whith a different sample spec/channel map. Only + * sink/source with a different sample spec/channel map. Only * supported when the server is at least PA 0.9.8. It is ignored * on older servers. \since 0.9.8 */ @@ -250,7 +250,7 @@ typedef enum pa_stream_flags { * asking for less new data than this value will be made to the * client it will also guarantee that requests are generated as * early as this limit is reached. This flag should only be set in - * very few situations where compatiblity with a fragment-based + * very few situations where compatibility with a fragment-based * playback model needs to be kept and the client applications * cannot deal with data requests that are delayed to the latest * moment possible. (Usually these are programs that use usleep() @@ -326,12 +326,12 @@ typedef struct pa_buffer_attr { * plus the playback buffer size is configured to this value. Set * PA_STREAM_ADJUST_LATENCY if you are interested in adjusting the * overall latency. Don't set it if you are interested in - * configuring the server-sider per-stream playback buffer + * configuring the server-side per-stream playback buffer * size. */ uint32_t prebuf; /**< Playback only: pre-buffering. The server does not start with - * playback before at least prebug bytes are available in the + * playback before at least prebuf bytes are available in the * buffer. It is recommended to set this to (uint32_t) -1, which * will initialize this to the same value as tlength, whatever * that may be. Initialize to 0 to enable manual start/stop @@ -352,7 +352,7 @@ typedef struct pa_buffer_attr { uint32_t fragsize; /**< Recording only: fragment size. The server sends data in - * blocks of fragsize bytes size. Large values deminish + * blocks of fragsize bytes size. Large values diminish * interactivity with other operations on the connection context * but decrease control overhead. It is recommended to set this to * (uint32_t) -1, which will initialize this to a value that is @@ -392,7 +392,7 @@ enum { PA_ERR_NOEXTENSION, /**< Extension does not exist. \since 0.9.12 */ PA_ERR_OBSOLETE, /**< Obsolete functionality. \since 0.9.15 */ PA_ERR_NOTIMPLEMENTED, /**< Missing implementation. \since 0.9.15 */ - PA_ERR_FORKED, /**< The caler forked without calling execve() and tried to reuse the context. \since 0.9.15 */ + PA_ERR_FORKED, /**< The caller forked without calling execve() and tried to reuse the context. \since 0.9.15 */ PA_ERR_MAX /**< Not really an error but the first invalid error code */ }; @@ -490,7 +490,7 @@ typedef enum pa_subscription_event_type { /**< Event type: Sample cache item */ PA_SUBSCRIPTION_EVENT_SERVER = 0x0007U, - /**< Event type: Global server change, only occuring with PA_SUBSCRIPTION_EVENT_CHANGE. */ + /**< Event type: Global server change, only occurring with PA_SUBSCRIPTION_EVENT_CHANGE. */ /** \cond fulldocs */ PA_SUBSCRIPTION_EVENT_AUTOLOAD = 0x0008U, @@ -576,7 +576,7 @@ typedef struct pa_timing_info { /**< Non-zero if the local and the remote machine have * synchronized clocks. If synchronized clocks are detected * transport_usec becomes much more reliable. However, the code - * that detects synchronized clocks is very limited und unreliable + * that detects synchronized clocks is very limited and unreliable * itself. */ pa_usec_t sink_usec; diff --git a/src/pulse/internal.h b/src/pulse/internal.h index cf362d99..344e6399 100644 --- a/src/pulse/internal.h +++ b/src/pulse/internal.h @@ -140,7 +140,7 @@ struct pa_stream { uint32_t syncid; uint32_t stream_index; - uint32_t requested_bytes; + int64_t requested_bytes; pa_buffer_attr buffer_attr; uint32_t device_index; @@ -160,7 +160,7 @@ struct pa_stream { uint32_t write_index_not_before; uint32_t read_index_not_before; - /* Data about individual timing update correctoins */ + /* Data about individual timing update corrections */ pa_index_correction write_index_corrections[PA_MAX_WRITE_INDEX_CORRECTIONS]; int current_write_index_correction; diff --git a/src/pulse/introspect.h b/src/pulse/introspect.h index d7ef1c0c..117880c8 100644 --- a/src/pulse/introspect.h +++ b/src/pulse/introspect.h @@ -454,7 +454,7 @@ typedef struct pa_sink_input_info { pa_cvolume volume; /**< The volume of this sink input */ pa_usec_t buffer_usec; /**< Latency due to buffering in sink input, see pa_latency_info for details */ pa_usec_t sink_usec; /**< Latency of the sink device, see pa_latency_info for details */ - const char *resample_method; /**< Thre resampling method used by this sink input. */ + const char *resample_method; /**< The resampling method used by this sink input. */ const char *driver; /**< Driver name */ int mute; /**< Stream muted \since 0.9.7 */ pa_proplist *proplist; /**< Property list \since 0.9.11 */ @@ -501,7 +501,7 @@ typedef struct pa_source_output_info { pa_channel_map channel_map; /**< Channel map */ pa_usec_t buffer_usec; /**< Latency due to buffering in the source output, see pa_latency_info for details. */ pa_usec_t source_usec; /**< Latency of the source device, see pa_latency_info for details. */ - const char *resample_method; /**< Thre resampling method used by this source output. */ + const char *resample_method; /**< The resampling method used by this source output. */ const char *driver; /**< Driver name */ pa_proplist *proplist; /**< Property list \since 0.9.11 */ } pa_source_output_info; @@ -539,7 +539,7 @@ pa_operation* pa_context_kill_source_output(pa_context *c, uint32_t idx, pa_cont * any new release. */ typedef struct pa_stat_info { uint32_t memblock_total; /**< Currently allocated memory blocks */ - uint32_t memblock_total_size; /**< Currentl total size of allocated memory blocks */ + uint32_t memblock_total_size; /**< Current total size of allocated memory blocks */ uint32_t memblock_allocated; /**< Allocated memory blocks during the whole lifetime of the daemon */ uint32_t memblock_allocated_size; /**< Total size of all memory blocks allocated during the whole lifetime of the daemon */ uint32_t scache_size; /**< Total size of all sample cache entries. */ diff --git a/src/pulse/mainloop.h b/src/pulse/mainloop.h index 3a03ac9a..4a83ebe8 100644 --- a/src/pulse/mainloop.h +++ b/src/pulse/mainloop.h @@ -50,7 +50,7 @@ struct pollfd; * * -# Prepare - Build a list of file descriptors * that need to be monitored and calculate the next timeout. - * -# Poll - Execute the actuall poll() system call. + * -# Poll - Execute the actual poll() system call. * -# Dispatch - Dispatch any events that have fired. * * When using the main loop, the application can either execute each diff --git a/src/pulse/proplist.h b/src/pulse/proplist.h index d5f5bc04..2e7e5ad0 100644 --- a/src/pulse/proplist.h +++ b/src/pulse/proplist.h @@ -259,7 +259,7 @@ int pa_proplist_get(pa_proplist *p, const char *key, const void **data, size_t * /** Update mode enum for pa_proplist_update(). \since 0.9.11 */ typedef enum pa_update_mode { PA_UPDATE_SET - /**< Replace the entirey property list with the new one. Don't keep + /**< Replace the entire property list with the new one. Don't keep * any of the old data around */, PA_UPDATE_MERGE diff --git a/src/pulse/pulseaudio.h b/src/pulse/pulseaudio.h index 5086783d..aa369e69 100644 --- a/src/pulse/pulseaudio.h +++ b/src/pulse/pulseaudio.h @@ -59,7 +59,7 @@ * \section intro_sec Introduction * * This document describes the client API for the PulseAudio sound - * server. The API comes in two flavours to accomodate different styles + * server. The API comes in two flavours to accommodate different styles * of applications and different needs in complexity: * * \li The complete but somewhat complicated to use asynchronous API diff --git a/src/pulse/sample.h b/src/pulse/sample.h index aef34b6b..138f13cf 100644 --- a/src/pulse/sample.h +++ b/src/pulse/sample.h @@ -71,7 +71,7 @@ * * \section chan_sec Channels * - * PulseAudio supports up to 32 individiual channels. The order of the + * PulseAudio supports up to 32 individual channels. The order of the * channels is up to the application, but they must be continous. To map * channels to speakers, see \ref channelmap. * @@ -221,7 +221,7 @@ typedef enum pa_sample_format { #define PA_SAMPLE_FLOAT32 PA_SAMPLE_FLOAT32NE /** \cond fulldocs */ -/* Allow clients to check with #ifdef for thse sample formats */ +/* Allow clients to check with #ifdef for these sample formats */ #define PA_SAMPLE_U8 PA_SAMPLE_U8 #define PA_SAMPLE_ALAW PA_SAMPLE_ALAW #define PA_SAMPLE_ULAW PA_SAMPLE_ULAW diff --git a/src/pulse/stream.c b/src/pulse/stream.c index 16342cad..339a89e5 100644 --- a/src/pulse/stream.c +++ b/src/pulse/stream.c @@ -380,20 +380,13 @@ static void check_smoother_status(pa_stream *s, pa_bool_t aposteriori, pa_bool_t x -= s->timing_info.transport_usec; else x += s->timing_info.transport_usec; - - if (s->direction == PA_STREAM_PLAYBACK) - /* it takes a while until the pause/resume is actually - * audible */ - x += s->timing_info.sink_usec; - else - /* Data froma while back will be dropped */ - x -= s->timing_info.source_usec; } if (s->suspended || s->corked || force_stop) pa_smoother_pause(s->smoother, x); else if (force_start || s->buffer_attr.prebuf == 0) - pa_smoother_resume(s->smoother, x); + pa_smoother_resume(s->smoother, x, TRUE); + /* Please note that we have no idea if playback actually started * if prebuf is non-zero! */ @@ -729,7 +722,7 @@ void pa_command_request(pa_pdispatch *pd, uint32_t command, uint32_t tag, pa_tag s->requested_bytes += bytes; if (s->requested_bytes > 0 && s->write_callback) - s->write_callback(s, s->requested_bytes, s->write_userdata); + s->write_callback(s, (size_t) s->requested_bytes, s->write_userdata); finish: pa_context_unref(c); @@ -826,7 +819,7 @@ static void create_stream_complete(pa_stream *s) { pa_stream_set_state(s, PA_STREAM_READY); if (s->requested_bytes > 0 && s->write_callback) - s->write_callback(s, s->requested_bytes, s->write_userdata); + s->write_callback(s, (size_t) s->requested_bytes, s->write_userdata); if (s->flags & PA_STREAM_AUTO_TIMING_UPDATE) { struct timeval tv; @@ -874,6 +867,7 @@ static void automatic_buffer_attr(pa_stream *s, pa_buffer_attr *attr, const pa_s void pa_create_stream_callback(pa_pdispatch *pd, uint32_t command, uint32_t tag, pa_tagstruct *t, void *userdata) { pa_stream *s = userdata; + uint32_t requested_bytes; pa_assert(pd); pa_assert(s); @@ -893,11 +887,13 @@ void pa_create_stream_callback(pa_pdispatch *pd, uint32_t command, uint32_t tag, if (pa_tagstruct_getu32(t, &s->channel) < 0 || s->channel == PA_INVALID_INDEX || ((s->direction != PA_STREAM_UPLOAD) && (pa_tagstruct_getu32(t, &s->stream_index) < 0 || s->stream_index == PA_INVALID_INDEX)) || - ((s->direction != PA_STREAM_RECORD) && pa_tagstruct_getu32(t, &s->requested_bytes) < 0)) { + ((s->direction != PA_STREAM_RECORD) && pa_tagstruct_getu32(t, &requested_bytes) < 0)) { pa_context_fail(s->context, PA_ERR_PROTOCOL); goto finish; } + s->requested_bytes = (int64_t) requested_bytes; + if (s->context->version >= 9) { if (s->direction == PA_STREAM_PLAYBACK) { if (pa_tagstruct_getu32(t, &s->buffer_attr.maxlength) < 0 || @@ -1061,14 +1057,17 @@ static int create_stream( if (flags & PA_STREAM_INTERPOLATE_TIMING) { pa_usec_t x; - if (s->smoother) - pa_smoother_free(s->smoother); - - s->smoother = pa_smoother_new(SMOOTHER_ADJUST_TIME, SMOOTHER_HISTORY_TIME, !(flags & PA_STREAM_NOT_MONOTONIC), SMOOTHER_MIN_HISTORY); - x = pa_rtclock_usec(); - pa_smoother_set_time_offset(s->smoother, x); - pa_smoother_pause(s->smoother, x); + + pa_assert(!s->smoother); + s->smoother = pa_smoother_new( + SMOOTHER_ADJUST_TIME, + SMOOTHER_HISTORY_TIME, + !(flags & PA_STREAM_NOT_MONOTONIC), + TRUE, + SMOOTHER_MIN_HISTORY, + x, + TRUE); } if (!dev) @@ -1258,12 +1257,9 @@ int pa_stream_write( if (free_cb && pa_pstream_get_shm(s->context->pstream)) free_cb((void*) data); - if (length < s->requested_bytes) - s->requested_bytes -= (uint32_t) length; - else - s->requested_bytes = 0; - - /* FIXME!!! ^^^ will break when offset is != 0 and mode is not RELATIVE*/ + /* This is obviously wrong since we ignore the seeking index . But + * that's OK, the server side applies the same error */ + s->requested_bytes -= (seek == PA_SEEK_RELATIVE ? offset : 0) + (int64_t) length; if (s->direction == PA_STREAM_PLAYBACK) { @@ -1359,7 +1355,7 @@ size_t pa_stream_writable_size(pa_stream *s) { PA_CHECK_VALIDITY_RETURN_ANY(s->context, s->state == PA_STREAM_READY, PA_ERR_BADSTATE, (size_t) -1); PA_CHECK_VALIDITY_RETURN_ANY(s->context, s->direction != PA_STREAM_RECORD, PA_ERR_BADSTATE, (size_t) -1); - return s->requested_bytes; + return s->requested_bytes > 0 ? (size_t) s->requested_bytes : 0; } size_t pa_stream_readable_size(pa_stream *s) { @@ -1623,7 +1619,7 @@ static void stream_get_timing_info_callback(pa_pdispatch *pd, uint32_t command, pa_smoother_put(o->stream->smoother, u, calc_time(o->stream, TRUE)); if (i->playing) - pa_smoother_resume(o->stream->smoother, x); + pa_smoother_resume(o->stream->smoother, x, TRUE); } } diff --git a/src/pulse/subscribe.h b/src/pulse/subscribe.h index a93510ad..44ed24ae 100644 --- a/src/pulse/subscribe.h +++ b/src/pulse/subscribe.h @@ -35,7 +35,7 @@ * \section overv_sec Overview * * The application can be notified, asynchronously, whenever the internal - * layout of the server changes. Possible notifications are desribed in the + * layout of the server changes. Possible notifications are described in the * \ref pa_subscription_event_type and \ref pa_subscription_mask * enumerations. * diff --git a/src/pulse/timeval.h b/src/pulse/timeval.h index 2b3faf16..651da953 100644 --- a/src/pulse/timeval.h +++ b/src/pulse/timeval.h @@ -60,7 +60,7 @@ struct timeval *pa_gettimeofday(struct timeval *tv); * structs. */ pa_usec_t pa_timeval_diff(const struct timeval *a, const struct timeval *b) PA_GCC_PURE; -/** Compare the two timeval structs and return 0 when equal, negative when a < b, positive otherwse */ +/** Compare the two timeval structs and return 0 when equal, negative when a < b, positive otherwise */ int pa_timeval_cmp(const struct timeval *a, const struct timeval *b) PA_GCC_PURE; /** Return the time difference between now and the specified timestamp */ |