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

demux: libmp4: add rtng atom

parent 0beed024
......@@ -3717,6 +3717,7 @@ static const struct
{ 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_rtng, MP4_ReadBox_Metadata, MP4_FreeBox_Common, ATOM_ilst },
{ ATOM_trkn, MP4_ReadBox_Metadata, MP4_FreeBox_Common, ATOM_ilst },
/* udta */
......
......@@ -288,6 +288,7 @@
#define ATOM_ilst VLC_FOURCC( 'i', 'l', 's', 't' )
#define ATOM_cnID VLC_FOURCC( 'c', 'n', 'I', 'D' )
#define ATOM_covr VLC_FOURCC( 'c', 'o', 'v', 'r' )
#define ATOM_rtng VLC_FOURCC( 'r', 't', 'n', 'g' )
#define ATOM_chap VLC_FOURCC( 'c', 'h', 'a', 'p' )
#define ATOM_SDLN VLC_FOURCC( 'S', 'D', 'L', 'N' )
......
......@@ -292,6 +292,27 @@ static void SetupmdirMeta( vlc_meta_t *p_meta, MP4_Box_t *p_box )
}
break;
}
case ATOM_rtng:
{
if ( p_data && BOXDATA(p_data) && BOXDATA(p_data)->i_blob >= 1 )
{
const char *psz_rating;
switch( *BOXDATA(p_data)->p_blob )
{
case 0x4:
psz_rating = N_("Explicit");
break;
case 0x2:
psz_rating = N_("Clean");
break;
default:
case 0x0:
psz_rating = N_("None");
break;
}
vlc_meta_AddExtra( p_meta, N_("Rating"), psz_rating );
}
}
case ATOM_trkn:
{
if ( p_data && BOXDATA(p_data) && BOXDATA(p_data)->i_blob >= 4 &&
......
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