X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=osx_writer.c;h=2af553db4386561ff58cc1652be235f30f8f551a;hp=9ea7ad454aafce0588a00a33f4122914e65f45ee;hb=db02b614d1231685e64b27b4838c7cd699e51790;hpb=b829b61f516298a0de3907cd4c30aef189dd8dd4 diff --git a/osx_writer.c b/osx_writer.c index 9ea7ad45..2af553db 100644 --- a/osx_writer.c +++ b/osx_writer.c @@ -50,6 +50,7 @@ struct private_osx_writer_data { sem_t *semaphore; osx_buffer *from; /* Current buffers */ osx_buffer *to; + unsigned samplerate; }; @@ -181,6 +182,8 @@ static int osx_writer_open(struct writer_node *wn) AudioStreamBasicDescription format; char s[10]; int m, ret; + struct writer_node_group *wng = wn->wng; + struct osx_write_args_info *conf = wn->conf; wn->private_data = powd; /* where did that default audio output go? */ @@ -209,7 +212,11 @@ static int osx_writer_open(struct writer_node *wn) * AND you want the DefaultOutputUnit to do any format conversions * necessary from your format to the device's format. */ - format.mSampleRate = 44100.0; /* The sample rate of the audio stream */ + if (!conf->samplerate_given && wng->samplerate) + powd->samplerate = *wng->samplerate; + else + powd->samplerate = conf->samplerate_arg; + format.mSampleRate = powd->samplerate; /* The specific encoding type of audio stream*/ format.mFormatID = kAudioFormatLinearPCM; /* flags specific to each format */