ref: 682d2900f6c76b2cb43cf6d18c722b8f9aed3b01
parent: 265b40c258001c69ae1f652484a54c87a52b128a
author: Jean-Marc Valin <[email protected]>
date: Wed Sep 8 14:01:02 EDT 2010
Frame packing (now it compiles)
--- a/src/framepack.c
+++ b/src/framepack.c
@@ -71,15 +71,18 @@
return count;
else
return -1;
- } else if (sz == 6)
+ } else /* if (sz == 6 || sz == 7) */
{
/* Many packets, different sizes */
int count = 0;
int pos = 1;
int bytes = 1;
+ int extra = 0;
+ if (sz==7)
+ extra = 1;
while (bytes < len)
{
- int tmp=1;
+ int tmp=extra+1;
int flen = decode_length(packet+pos, len-bytes);
if (flen==-1)
return -1;
@@ -93,16 +96,24 @@
return -1;
else
return count;
- } else {
-
}
}
#define MAX_FRAMES 256
-int hybrid_merge_packets(unsigned char **packets, int *len, unsigned *output, int maxlen)
+int hybrid_merge_packets(unsigned char **packets, int *plen, int nb_packets,
+ unsigned *output, int maxlen)
{
+ int i;
unsigned char cfg[MAX_FRAMES];
- unsigned char len[MAX_FRAMES];
+ unsigned char flen[MAX_FRAMES];
int nb_frames=0;
+ for (i=0;i<nb_packets;i++)
+ {
+ int tmp = count_frames(packets[i], plen[i]);
+ if (tmp<=0)
+ return -1;
+ nb_frames += tmp;
+ }
+ return nb_frames;
}