mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-10-29 05:40:23 -04:00
introduce sink input and source output limits
git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@170 fefdeb5f-60dc-0310-8127-8f9354f1896f
This commit is contained in:
parent
0205fc57bb
commit
50f592b67c
7 changed files with 20 additions and 8 deletions
3
doc/todo
3
doc/todo
|
|
@ -13,7 +13,8 @@
|
|||
- cleanup tagstruct and modargs (add s32, pa_volume_t, pa_usec_t)
|
||||
- remove all gcc warnings
|
||||
- esd compatible startup script or personality
|
||||
- limit number of concurrent streams
|
||||
- add total sample size to stat
|
||||
- implement streamed file playbacj
|
||||
|
||||
** later ***
|
||||
- xmlrpc/http
|
||||
|
|
|
|||
|
|
@ -69,11 +69,7 @@ static int ring_bell(struct userdata *u, int percent) {
|
|||
return -1;
|
||||
}
|
||||
|
||||
if (pa_scache_play_item(u->core, u->scache_item, s, percent*2) < 0) {
|
||||
fprintf(stderr, __FILE__": Failed to play sample\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
pa_scache_play_item(u->core, u->scache_item, s, percent*2);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -110,10 +110,10 @@ pa_volume_t pa_volume_from_dB(double f);
|
|||
double pa_volume_to_dB(pa_volume_t v);
|
||||
|
||||
#ifdef INFINITY
|
||||
#define PA_DECIBEL_MININFTY -INFINITY
|
||||
#define PA_DECIBEL_MININFTY (-INFINITY)
|
||||
#else
|
||||
/** This value is used as minus infinity when using pa_volume_{to,from}_dB(). \since 0.4 */
|
||||
#define PA_DECIBEL_MININFTY -200
|
||||
#define PA_DECIBEL_MININFTY (-200)
|
||||
#endif
|
||||
|
||||
PA_C_DECL_END
|
||||
|
|
|
|||
|
|
@ -42,6 +42,11 @@ struct pa_sink_input* pa_sink_input_new(struct pa_sink *s, const char *name, con
|
|||
char st[256];
|
||||
assert(s && spec);
|
||||
|
||||
if (pa_idxset_ncontents(s->inputs) >= PA_MAX_INPUTS_PER_SINK) {
|
||||
fprintf(stderr, __FILE__": Failed to create sink input: too many inputs per sink.\n");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (!pa_sample_spec_equal(spec, &s->sample_spec))
|
||||
if (!(resampler = pa_resampler_new(spec, &s->sample_spec, s->core->memblock_stat)))
|
||||
return NULL;
|
||||
|
|
|
|||
|
|
@ -31,6 +31,8 @@ struct pa_sink;
|
|||
#include "idxset.h"
|
||||
#include "source.h"
|
||||
|
||||
#define PA_MAX_INPUTS_PER_SINK 6
|
||||
|
||||
struct pa_sink {
|
||||
uint32_t index;
|
||||
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@
|
|||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#include <assert.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
|
@ -37,6 +38,11 @@ struct pa_source_output* pa_source_output_new(struct pa_source *s, const char *n
|
|||
int r;
|
||||
assert(s && spec);
|
||||
|
||||
if (pa_idxset_ncontents(s->outputs) >= PA_MAX_OUTPUTS_PER_SOURCE) {
|
||||
fprintf(stderr, __FILE__": Failed to create source output: too many outputs per source.\n");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (!pa_sample_spec_equal(&s->sample_spec, spec))
|
||||
if (!(resampler = pa_resampler_new(&s->sample_spec, spec, s->core->memblock_stat)))
|
||||
return NULL;
|
||||
|
|
|
|||
|
|
@ -32,6 +32,8 @@ struct pa_source;
|
|||
#include "memchunk.h"
|
||||
#include "sink.h"
|
||||
|
||||
#define PA_MAX_OUTPUTS_PER_SOURCE 16
|
||||
|
||||
struct pa_source {
|
||||
uint32_t index;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue