History

Add public function sf_get_channels(). Suggested by Max Flax.

Erik de Castro Lopo committed 13 years ago

Commit 28afc791 parent c3b66182 files · +22 −1Browse files

Unified · Split

2 files
  1. src/samplerate.c +15 −1
  2. src/samplerate.h +7 −0
src/samplerate.c+15−1
@@ -1,5 +1,5 @@
1/*1/*
2** Copyright (C) 2002-2012 Erik de Castro Lopo <erikd@mega-nerd.com>2** Copyright (C) 2002-2013 Erik de Castro Lopo <erikd@mega-nerd.com>
3**3**
4** This program is free software; you can redistribute it and/or modify4** This program is free software; you can redistribute it and/or modify
5** it under the terms of the GNU General Public License as published by5** it under the terms of the GNU General Public License as published by
@@ -289,6 +289,20 @@ src_set_ratio (SRC_STATE *state, double new_ratio) · 283 unmodified lines
289 return SRC_ERR_NO_ERROR ;289 return SRC_ERR_NO_ERROR ;
290} /* src_set_ratio */290} /* src_set_ratio */
291 291
292int
293src_get_channels (SRC_STATE *state)
294{ SRC_PRIVATE *psrc ;
295
296 psrc = (SRC_PRIVATE*) state ;
297
298 if (psrc == NULL)
299 return SRC_ERR_BAD_STATE ;
300 if (psrc->vari_process == NULL || psrc->const_process == NULL)
301 return SRC_ERR_BAD_PROC_PTR ;
302
303 return psrc->channels ;
304} /* src_get_channels */
305
292int306int
293src_reset (SRC_STATE *state)307src_reset (SRC_STATE *state)
294{ SRC_PRIVATE *psrc ;308{ SRC_PRIVATE *psrc ;
src/samplerate.h+7−0
@@ -131,6 +131,13 @@ const char *src_get_version (void) ; · 130 unmodified lines
131 131
132int src_set_ratio (SRC_STATE *state, double new_ratio) ;132int src_set_ratio (SRC_STATE *state, double new_ratio) ;
133 133
134/*
135** Get the current channel count.
136** Returns negative on error, positive channel count otherwise
137*/
138
139int src_get_channels (SRC_STATE *state) ;
140
134/*141/*
135** Reset the internal SRC state.142** Reset the internal SRC state.
136** Does not modify the quality settings.143** Does not modify the quality settings.

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t