From eecacb732f39da108cbf3f0cd702d86ccc2caf4f Mon Sep 17 00:00:00 2001 From: Benny Prijono Date: Wed, 24 Apr 2013 01:17:40 +0000 Subject: Re #1656: fixes incorporated from latest email feedback git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@4495 74dad513-b988-da41-8d7b-12977e46ad98 --- pjmedia/src/pjmedia-audiodev/bb10_dev.c | 47 ++++++++++++--------------------- 1 file changed, 17 insertions(+), 30 deletions(-) (limited to 'pjmedia') diff --git a/pjmedia/src/pjmedia-audiodev/bb10_dev.c b/pjmedia/src/pjmedia-audiodev/bb10_dev.c index 9dc2f276..5aaf1a24 100644 --- a/pjmedia/src/pjmedia-audiodev/bb10_dev.c +++ b/pjmedia/src/pjmedia-audiodev/bb10_dev.c @@ -442,9 +442,10 @@ static int pb_thread_func (void *arg) TRACE_((THIS_FILE, "pb_thread_func: size = %d ", size)); - pthread_getschedparam(pthread_self(), &policy, ¶m); - param.sched_priority = 18; - pthread_setschedparam (pthread_self(), policy, ¶m); + if (pthread_getschedparam(pthread_self(), &policy, ¶m) == 0) { + param.sched_priority = 18; + pthread_setschedparam (pthread_self(), policy, ¶m); + } pj_bzero (buf, size); tstamp.u64 = 0; @@ -537,9 +538,10 @@ static int ca_thread_func (void *arg) TRACE_((THIS_FILE, "ca_thread_func: size = %d ", size)); - pthread_getschedparam(pthread_self(), &policy, ¶m); - param.sched_priority = 18; - pthread_setschedparam (pthread_self(), policy, ¶m); + if (pthread_getschedparam(pthread_self(), &policy, ¶m) == 0) { + param.sched_priority = 18; + pthread_setschedparam (pthread_self(), policy, ¶m); + } pj_bzero (buf, size); tstamp.u64 = 0; @@ -720,20 +722,12 @@ static pj_status_t bb10_open_playback (struct bb10_stream *stream, } /* Required call from January 2013 gold OS release */ - if ((ret = snd_pcm_plugin_set_disable(stream->pb_pcm, - PLUGIN_DISABLE_MMAP)) < 0) - { - TRACE_((THIS_FILE, "snd_pcm_plugin_set_disable ret = %d", ret)); - return PJMEDIA_EAUD_SYSERR; - } + snd_pcm_plugin_set_disable(stream->pb_pcm, PLUGIN_DISABLE_MMAP); /* Required call from January 2013 gold OS release */ - if ((ret = snd_pcm_plugin_set_enable(stream->pb_pcm, - PLUGIN_ROUTING)) < 0) - { - TRACE_((THIS_FILE, "snd_pcm_plugin_set_enable ret = %d", ret)); - return PJMEDIA_EAUD_SYSERR; - } + /* Feedback on 24/04/2013: should not be used for "voice" port + snd_pcm_plugin_set_enable(stream->pb_pcm, PLUGIN_ROUTING); + */ memset (&pi, 0, sizeof (pi)); pi.channel = SND_PCM_CHANNEL_PLAYBACK; @@ -827,19 +821,12 @@ static pj_status_t bb10_open_capture (struct bb10_stream *stream, return PJMEDIA_EAUD_SYSERR; } /* Required call from January 2013 gold OS release */ - if ((ret = snd_pcm_plugin_set_disable (stream->ca_pcm, - PLUGIN_DISABLE_MMAP)) < 0) - { - TRACE_((THIS_FILE, "snd_pcm_plugin_set_disable failed: %d",ret)); - return PJMEDIA_EAUD_SYSERR; - } + snd_pcm_plugin_set_disable (stream->ca_pcm, PLUGIN_DISABLE_MMAP); + /* Required call from January 2013 gold OS release */ - if ((ret = snd_pcm_plugin_set_enable(stream->ca_pcm, - PLUGIN_ROUTING)) < 0) - { - TRACE_((THIS_FILE, "snd_pcm_plugin_set_enable failed: %d",ret)); - return PJMEDIA_EAUD_SYSERR; - } + /* Feedback on 24/04/2013: should not be used for "voice" port + snd_pcm_plugin_set_enable(stream->ca_pcm, PLUGIN_ROUTING); + */ /* sample reads the capabilities of the capture */ memset (&pi, 0, sizeof (pi)); -- cgit v1.2.3