All pastes #794821 Raw Edit

Unnamed

public text v1 · immutable
#794821 ·published 2007-11-23 13:10 UTC
rendered paste body
Index: sbc/sbc.c
===================================================================
RCS file: /cvsroot/bluez/utils/sbc/sbc.c,v
retrieving revision 1.24
diff -u -3 -p -u -r1.24 sbc.c
--- sbc/sbc.c	13 Nov 2007 20:59:17 -0000	1.24
+++ sbc/sbc.c	23 Nov 2007 12:58:11 -0000
@@ -1404,6 +1404,11 @@ int sbc_get_frame_length(sbc_t *sbc)
 	return ret;
 }
 
+int sbc_get_frame_duration(sbc_t *sbc)
+{
+	return (1.0f * sbc->blocks * sbc->subbands / sbc->rate) * 1000000;
+}
+
 int sbc_get_codesize(sbc_t *sbc)
 {
 	return sbc->subbands * sbc->blocks * sbc->channels * 2;
Index: sbc/sbc.h
===================================================================
RCS file: /cvsroot/bluez/utils/sbc/sbc.h,v
retrieving revision 1.8
diff -u -3 -p -u -r1.8 sbc.h
--- sbc/sbc.h	13 Nov 2007 20:04:12 -0000	1.8
+++ sbc/sbc.h	23 Nov 2007 12:58:11 -0000
@@ -57,6 +57,7 @@ int sbc_decode(sbc_t *sbc, void *input, 
 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);