-
- for (i = padd->table_pos; i < padd->nsamples; i++) {
- ret = read_int32(padd, &padd->table[i]);
- if (ret < 0)
- return -1;
- PARA_DEBUG_LOG("sample #%d: %d\n", i, padd->table[i]);
- padd->table_pos++;
- }
- return 1;
-
-}
-int find_stsz(struct private_mp4dec_data *padd)
-{
- int ret;
-
- for (; padd->consumed < padd->inbuf_len; padd->consumed++) {
- char *p = padd->inbuf + padd->consumed;
-
- if (p[0] != 's' || p[1] != 't' || p[2] != 's' || p[3] != 'z')
- continue;
- PARA_INFO_LOG("found stsz: %d\n", padd->consumed);
- padd->consumed += 12;
- ret = -E_STSZ;
- if (read_int32(padd, &padd->nsamples) < 0)
- goto out;
- PARA_INFO_LOG("num samples: %d\n", padd->nsamples);
- padd->table = para_malloc(padd->nsamples * sizeof(int));
- return 1;
- }
- ret = -E_STSZ;
-out:
- return ret;
-}
-#endif
-
-static int fill_offset_table(struct private_mp4dec_data *padd)
-{
- int i, ret;
-
- for (i = padd->offset_pos; i < padd->noffsets; i++) {
- ret = read_int32(padd, &padd->offset[i]);
- if (ret < 0)
- return -1;
- PARA_DEBUG_LOG("offset #%d: %d\n", i, padd->offset[i]);
- padd->offset_pos++;
- }
- return 1;
-}
-
-static int find_stco(struct private_mp4dec_data *padd)
-{
- int ret;
-
- for (; padd->consumed < padd->inbuf_len; padd->consumed++) {
- char *p = padd->inbuf + padd->consumed;
-
- if (p[0] != 's' || p[1] != 't' || p[2] != 'c' || p[3] != 'o')
- continue;
- PARA_INFO_LOG("found stco: %d\n", padd->consumed);
- padd->consumed += 8;
- ret = read_int32(padd, &padd->noffsets);
- padd->offset = para_malloc(padd->noffsets * sizeof(int));
- PARA_INFO_LOG("num entries: %d\n", padd->noffsets);
- return 1;
- }
- return -E_STCO;
-}
-
-static ssize_t mp4dec(char *inbuffer, size_t len, struct filter_node *fn)
-{
- struct private_mp4dec_data *padd = fn->private_data;
- struct filter_chain_info *fci = fn->fci;
- unsigned long rate = 0;
- unsigned char channels = 0;
- int i, ret, nbytes;