summaryrefslogtreecommitdiffstats
path: root/sbc
diff options
context:
space:
mode:
authorLuiz Augusto von Dentz <luiz.dentz@openbossa.org>2007-11-23 14:24:23 +0000
committerLuiz Augusto von Dentz <luiz.dentz@openbossa.org>2007-11-23 14:24:23 +0000
commit8db224b3cae791b950abcc826259ef342161f454 (patch)
tree6442101d6299bbcdc8df02d5a6d436daacf4a957 /sbc
parentf6f1a6c8a0a3293b799740617f04b245834d2412 (diff)
Introduce sbc_get_frame_duration.
Diffstat (limited to 'sbc')
-rw-r--r--sbc/sbc.c7
-rw-r--r--sbc/sbc.h3
2 files changed, 6 insertions, 4 deletions
diff --git a/sbc/sbc.c b/sbc/sbc.c
index 50af4a1e..c090dd83 100644
--- a/sbc/sbc.c
+++ b/sbc/sbc.c
@@ -1372,8 +1372,6 @@ int sbc_encode(sbc_t *sbc, void *input, int input_len, void *output,
if (written)
*written = framelen;
- sbc->duration = (1000000 * priv->frame.subbands * priv->frame.blocks) / sbc->rate;
-
return samples * sbc->channels * 2;
}
@@ -1404,6 +1402,11 @@ int sbc_get_frame_length(sbc_t *sbc)
return ret;
}
+int sbc_get_frame_duration(sbc_t *sbc)
+{
+ return (1000000 * sbc->blocks * sbc->subbands) / sbc->rate;
+}
+
int sbc_get_codesize(sbc_t *sbc)
{
return sbc->subbands * sbc->blocks * sbc->channels * 2;
diff --git a/sbc/sbc.h b/sbc/sbc.h
index 08c3e020..cdf0d83e 100644
--- a/sbc/sbc.h
+++ b/sbc/sbc.h
@@ -42,8 +42,6 @@ struct sbc_struct {
int bitpool;
int swap;
- unsigned long duration;
-
void *priv;
};
@@ -57,6 +55,7 @@ int sbc_decode(sbc_t *sbc, void *input, int input_len, void *output,
int sbc_encode(sbc_t *sbc, void *input, int input_len, void *output,
int output_len, int *written);
int sbc_get_frame_length(sbc_t *sbc);
+int sbc_get_frame_duration(sbc_t *sbc);
int sbc_get_codesize(sbc_t *sbc);
void sbc_finish(sbc_t *sbc);