Commit af3ab245 authored by François Cartegnie's avatar François Cartegnie 🤞
Browse files

demux: libmp4: add support for disk meta

parent 5dacc81c
......@@ -3712,6 +3712,7 @@ static const struct
{ ATOM_0xa9wrt, MP4_ReadBox_0xa9xxx, MP4_FreeBox_0xa9xxx, ATOM_ilst },
{ ATOM_chpl, MP4_ReadBox_chpl, MP4_FreeBox_chpl, ATOM_ilst },
{ ATOM_covr, MP4_ReadBoxContainer, MP4_FreeBox_Common, ATOM_ilst },
{ ATOM_disk, MP4_ReadBox_Metadata, MP4_FreeBox_Common, ATOM_ilst },
{ ATOM_gnre, MP4_ReadBox_Metadata, MP4_FreeBox_Common, ATOM_ilst },
{ ATOM_trkn, MP4_ReadBox_Metadata, MP4_FreeBox_Common, ATOM_ilst },
......
......@@ -279,6 +279,7 @@
#define ATOM_0xa9xpd VLC_FOURCC( 0xa9, 'x', 'p', 'd' )
#define ATOM_0xa9xyz VLC_FOURCC( 0xa9, 'x', 'y', 'z' )
#define ATOM_chpl VLC_FOURCC( 'c', 'h', 'p', 'l' )
#define ATOM_disk VLC_FOURCC( 'd', 'i', 's', 'k' )
#define ATOM_WLOC VLC_FOURCC( 'W', 'L', 'O', 'C' )
#define ATOM_meta VLC_FOURCC( 'm', 'e', 't', 'a' )
......
......@@ -242,6 +242,20 @@ static void SetupmdirMeta( vlc_meta_t *p_meta, MP4_Box_t *p_box )
/* XXX Becarefull p_udta can have box that are not 0xa9xx */
switch( p_box->i_type )
{
case ATOM_disk:
{
const MP4_Box_t *p_data = MP4_BoxGet( p_box, "data" );
if ( p_data && BOXDATA(p_data) && BOXDATA(p_data)->i_blob >= 6 &&
BOXDATA(p_data)->e_wellknowntype == DATA_WKT_RESERVED )
{
char psz_utf[5 + 5 + 4];
snprintf( psz_utf, sizeof( psz_utf ), "%"PRIu16" / %"PRIu16,
GetWBE(&BOXDATA(p_data)->p_blob[2]),
GetWBE(&BOXDATA(p_data)->p_blob[4]) );
vlc_meta_AddExtra( p_meta, N_("Disc"), psz_utf );
}
break;
}
case ATOM_gnre:
{
const MP4_Box_t *p_data = MP4_BoxGet( p_box, "data" );
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment