size_t mapsize;
size_t fpos;
int32_t track;
- mp4ff_t *mp4ff;
+ struct mp4ff *mp4ff;
mp4AudioSpecificConfig masc;
- mp4ff_callback_t cb;
+ struct mp4ff_callback cb;
};
static uint32_t aac_afh_read_cb(void *user_data, void *dest, uint32_t want)
return 0;
}
-static int32_t aac_afh_get_track(mp4ff_t *mp4ff, mp4AudioSpecificConfig *masc)
+static int32_t aac_afh_get_track(struct mp4ff *mp4ff, mp4AudioSpecificConfig *masc)
{
int32_t i, rc, num_tracks = mp4ff_total_tracks(mp4ff);
free(c);
}
-/**
- * Libmp4ff function to reposition the file to the given sample.
- *
- * \param f The opaque handle returned by mp4ff_open_read().
- * \param track The number of the (audio) track.
- * \param sample Destination.
- *
- * We need this function to obtain the offset of the sample within the audio
- * file. Unfortunately, it is not exposed in the mp4ff header.
- *
- * \return This function always returns 0.
- */
-int32_t mp4ff_set_sample_position(mp4ff_t *f, const int32_t track, const int32_t sample);
-
static int aac_afh_get_chunk(uint32_t chunk_num, void *afh_context,
const char **buf, uint32_t *len)
{
size_t offset;
assert(chunk_num <= INT_MAX);
- /* this function always returns zero */
mp4ff_set_sample_position(c->mp4ff, c->track, chunk_num);
offset = c->fpos;
- ss = mp4ff_read_sample_getsize(c->mp4ff, c->track, chunk_num);
+ ss = mp4ff_get_sample_size(c->mp4ff, c->track, chunk_num);
if (ss <= 0)
return -E_MP4FF_BAD_SAMPLE;
assert(ss + offset <= c->mapsize);
return 1;
}
-static void _aac_afh_get_taginfo(const mp4ff_t *mp4ff, struct taginfo *tags)
+static void _aac_afh_get_taginfo(const struct mp4ff *mp4ff, struct taginfo *tags)
{
mp4ff_meta_get_artist(mp4ff, &tags->artist);
mp4ff_meta_get_title(mp4ff, &tags->title);
return ftruncate(fd, offset);
}
-static void replace_tag(mp4ff_tag_t *tag, const char *new_val, bool *found)
+static void replace_tag(struct mp4ff_tag *tag, const char *new_val, bool *found)
{
free(tag->value);
tag->value = para_strdup(new_val);
*found = true;
}
-static void add_tag(mp4ff_metadata_t *md, const char *item, const char *value)
+static void add_tag(struct mp4ff_metadata *md, const char *item, const char *value)
{
md->tags[md->count].item = para_strdup(item);
md->tags[md->count].value = para_strdup(value);
{
int ret, i;
int32_t rv;
- mp4ff_metadata_t metadata;
- mp4ff_t *mp4ff;
- mp4ff_callback_t cb = {
+ struct mp4ff_metadata metadata;
+ struct mp4ff *mp4ff;
+ struct mp4ff_callback cb = {
.read = aac_afh_meta_read_cb,
.seek = aac_afh_meta_seek_cb,
.write = aac_afh_meta_write_cb,
metadata.count = rv;
PARA_NOTICE_LOG("%d metadata item(s) found\n", rv);
- metadata.tags = para_malloc((metadata.count + 5) * sizeof(mp4ff_tag_t));
+ metadata.tags = para_malloc((metadata.count + 5) * sizeof(struct mp4ff_tag));
for (i = 0; i < metadata.count; i++) {
- mp4ff_tag_t *tag = metadata.tags + i;
+ struct mp4ff_tag *tag = metadata.tags + i;
ret = -E_MP4FF_META_READ;
if (!mp4ff_meta_get_by_index(mp4ff, i, &tag->item, &tag->value))