Browse Source

return null if jack_port_get_buffer() is used before jack_activate()

git-svn-id: svn+ssh://jackaudio.org/trunk/jack@4140 0c269be4-1314-0410-8aa9-9f06e86f4224
tags/0.120.1
paul 15 years ago
parent
commit
c22f9aecbb
1 changed files with 9 additions and 0 deletions
  1. +9
    -0
      libjack/port.c

+ 9
- 0
libjack/port.c View File

@@ -23,6 +23,7 @@
#include <math.h>

#include <config.h>
#include <sys/mman.h>

#include <jack/jack.h>
#include <jack/types.h>
@@ -564,6 +565,10 @@ jack_port_get_buffer (jack_port_t *port, jack_nframes_t nframes)
if (port->tied) {
return jack_port_get_buffer (port->tied, nframes);
}
if (port->client_segment_base == NULL || *port->client_segment_base == MAP_FAILED) {
return NULL;
}

return jack_output_port_buffer (port);
}
@@ -575,6 +580,10 @@ jack_port_get_buffer (jack_port_t *port, jack_nframes_t nframes)
*/
if ((node = port->connections) == NULL) {
if (port->client_segment_base == NULL || *port->client_segment_base == MAP_FAILED) {
return NULL;
}

/* no connections; return a zero-filled buffer */
return (void *) (*(port->client_segment_base) + port->type_info->zero_buffer_offset);
}


Loading…
Cancel
Save