[vlc-commits] demux: libmp4: add rtng atom
Francois Cartegnie
git at videolan.org
Thu Oct 16 20:05:22 CEST 2014
vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Thu Oct 16 18:57:59 2014 +0200| [f01de99032803a999e69baf80d900c3d764eb764] | committer: Francois Cartegnie
demux: libmp4: add rtng atom
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=f01de99032803a999e69baf80d900c3d764eb764
---
modules/demux/mp4/libmp4.c | 1 +
modules/demux/mp4/libmp4.h | 1 +
modules/demux/mp4/meta.c | 21 +++++++++++++++++++++
3 files changed, 23 insertions(+)
diff --git a/modules/demux/mp4/libmp4.c b/modules/demux/mp4/libmp4.c
index 15088bb..f270b55 100644
--- a/modules/demux/mp4/libmp4.c
+++ b/modules/demux/mp4/libmp4.c
@@ -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 */
diff --git a/modules/demux/mp4/libmp4.h b/modules/demux/mp4/libmp4.h
index 17b39f2..2d65d5a 100644
--- a/modules/demux/mp4/libmp4.h
+++ b/modules/demux/mp4/libmp4.h
@@ -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' )
diff --git a/modules/demux/mp4/meta.c b/modules/demux/mp4/meta.c
index 5e4dd9f..ce1c2b7 100644
--- a/modules/demux/mp4/meta.c
+++ b/modules/demux/mp4/meta.c
@@ -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 &&
More information about the vlc-commits
mailing list