Unified · Split
| @@ -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 | 4 | ** This program is free software; you can redistribute it and/or modify |
| 5 | 5 | ** 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 | 289 | return SRC_ERR_NO_ERROR ; |
| 290 | 290 | } /* src_set_ratio */ |
| 291 | 291 | |
| 292 | +int | |
| 293 | +src_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 | + | |
| 292 | 306 | int |
| 293 | 307 | src_reset (SRC_STATE *state) |
| 294 | 308 | { SRC_PRIVATE *psrc ; |
| @@ -131,6 +131,13 @@ const char *src_get_version (void) ; · 130 unmodified lines | ||
| 131 | 131 | |
| 132 | 132 | int 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 | + | |
| 139 | +int src_get_channels (SRC_STATE *state) ; | |
| 140 | + | |
| 134 | 141 | /* |
| 135 | 142 | ** Reset the internal SRC state. |
| 136 | 143 | ** Does not modify the quality settings. |