mod_musicindex  1.4.1
playlist-mp4.c File Reference

MP4 files management system. More...

#include "playlist.h"
#include "playlist-mp4.h"
#include <mp4v2/mp4v2.h>

Go to the source code of this file.

Functions

static short mp4_ext_check (const char *const filename)
 Checks for valid MP4 filename extension.
mu_entmake_mp4_entry (request_rec *r, apr_pool_t *pool, FILE *const in, const char *const filename)
 Fills in the information fields about MP4 data.

Detailed Description

MP4 files management system.

Author
Thibaut Varene
Version
Revision:
1010
Date
2004-2005
2007
2010-2011

This file contains everything needed to produce music entries from MP4 files.

Warning
I'm not actually sure raw AAC files are properly handled.

Definition in file playlist-mp4.c.

Function Documentation

mu_ent* make_mp4_entry ( request_rec *  r,
apr_pool_t pool,
FILE *const  in,
const char *const  filename 
)

Fills in the information fields about MP4 data.

This function reads the mp4 metadata (using libmp4) from the MP4 file in and fills in the struct mu_ent fields accordingly. The code is based on sample files from mpeg4ip/libmp4v2.

Parameters
rApache request_rec struct to handle log writings (debugging)
poolPool
inMP4 file to parse (closed on normal exit)
filenamecurrent filename
Returns
When possible, struct mu_ent correctly set up, file stream closed.
Todo:
handle old AAC files that use id3 tags.

Definition at line 74 of file playlist-mp4.c.

References mu_ent::album, apr_pstrdup, mu_ent::artist, mu_ent::bitrate, mu_ent::date, EF_VBR, mu_ent::filetype, mu_ent::flags, mu_ent::freq, FT_MP4, mu_ent::genre, mu_ent::length, MI_QUICKPL, mp4_ext_check(), mu_ent::mtime, musicindex_module, NEW_ENT, mu_config::options, mu_ent::posn, mu_ent::size, mu_ent::title, and mu_ent::track.

static short mp4_ext_check ( const char *const  filename)
inlinestatic

Checks for valid MP4 filename extension.

Parameters
filenameThe filename to check.
Todo:
see if we can just rely on the trackType test.
Returns
TRUE when the extension is correct, FALSE otherwise.

Definition at line 48 of file playlist-mp4.c.

References FALSE, and TRUE.

Referenced by make_mp4_entry().