#include "para.h"
#include "mp4.h"
-#define USE_TAGGING
int32_t mp4ff_total_tracks(const mp4ff_t * f)
{
return f->total_tracks;
d = (uint8_t) data[3];
result = (a << 24) | (b << 16) | (c << 8) | d;
- //if (result > 0 && result < 8) result = 8;
-
return (int32_t) result;
}
*header_size = 16;
size = mp4ff_read_int64(f);
}
- //printf("%c%c%c%c\n", atom_header[4], atom_header[5], atom_header[6], atom_header[7]);
-
*atom_type = mp4ff_atom_name_to_type(atom_header[4], atom_header[5],
atom_header[6], atom_header[7]);
return size;
{
switch (atom_type) {
case ATOM_EDTS:
-// case ATOM_MDIA:
-// case ATOM_MINF:
case ATOM_DRMS:
case ATOM_SINF:
case ATOM_SCHI:
-// case ATOM_STBL:
-// case ATOM_STSD:
case ATOM_STTS:
case ATOM_STSZ:
case ATOM_STZ2:
case ATOM_STCO:
case ATOM_STSC:
-// case ATOM_CTTS:
case ATOM_FRMA:
case ATOM_IVIV:
case ATOM_PRIV:
done = 1;
}
} else if (parent_atom_type == ATOM_TRACK || parent_atom_type == ATOM_DISC) {
- /* if (!done && subsize - header_size >= 8 + 8) */
- /* modified by AJS */
if (!done && (subsize - header_size) >= (sizeof (char) + sizeof (uint8_t) * 3 + sizeof (uint32_t) + /* version + flags + reserved */
+(parent_atom_type == ATOM_TRACK ? sizeof (uint16_t) : 0) /* leading uint16_t if ATOM_TRACK */
+sizeof (uint16_t) /* track / disc */
} else if (atom_type == ATOM_MDHD) {
/* track header */
mp4ff_read_mdhd(f);
-#ifdef USE_TAGGING
} else if (atom_type == ATOM_META) {
/* iTunes Metadata box */
mp4ff_read_meta(f, size);
-#endif
}
mp4ff_set_position(f, dest_position);
f->file_size += size;
f->last_atom = atom_type;
- if (atom_type == ATOM_MDAT && f->moov_read) {
- /* moov atom is before mdat, we can stop reading when mdat is encountered */
- /* file position will stay at beginning of mdat data */
-// break;
- }
-
if (atom_type == ATOM_MOOV && size > header_size) {
f->moov_read = 1;
f->moov_offset = mp4ff_position(f) - header_size;
free(ff->track[i]->ctts_sample_count);
if (ff->track[i]->ctts_sample_offset)
free(ff->track[i]->ctts_sample_offset);
-#ifdef ITUNES_DRM
- if (ff->track[i]->p_drms)
- drms_free(ff->track[i]->p_drms);
-#endif
free(ff->track[i]);
}
}
-#ifdef USE_TAGGING
mp4ff_tag_delete(&(ff->tags));
-#endif
if (ff)
free(ff);
{"\xA9" "day", "date"},
{"\xA9" "too", "tool"},
{"\xA9" "cmt", "comment"},
-// {"\xA9" "gen","genre"},
{"cpil", "compilation"},
-// {"trkn","track"},
-// {"disk","disc"},
-// {"gnre","genre"},
{"covr", "cover"},
- /* added by AJS */
{"aART", "album_artist"},
};
static void membuffer_write_std_tag(membuffer * buf, const char *name,
const char *value)
{
- /* added by AJS */
uint32_t flags = 1;
/* special check for compilation flag */