Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
8cba4462
Commit
8cba4462
authored
May 18, 2010
by
Jean-Baptiste Kempf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MP4: support for gnre atom
Ref #3630
parent
5a6ee796
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
42 additions
and
0 deletions
+42
-0
modules/demux/mp4/libmp4.c
modules/demux/mp4/libmp4.c
+28
-0
modules/demux/mp4/libmp4.h
modules/demux/mp4/libmp4.h
+8
-0
modules/demux/mp4/mp4.c
modules/demux/mp4/mp4.c
+6
-0
No files found.
modules/demux/mp4/libmp4.c
View file @
8cba4462
...
@@ -1152,6 +1152,33 @@ static int MP4_ReadBox_enda( stream_t *p_stream, MP4_Box_t *p_box )
...
@@ -1152,6 +1152,33 @@ static int MP4_ReadBox_enda( stream_t *p_stream, MP4_Box_t *p_box )
MP4_READBOX_EXIT
(
1
);
MP4_READBOX_EXIT
(
1
);
}
}
static
int
MP4_ReadBox_gnre
(
stream_t
*
p_stream
,
MP4_Box_t
*
p_box
)
{
MP4_Box_data_gnre_t
*
p_gnre
;
MP4_READBOX_ENTER
(
MP4_Box_data_gnre_t
);
p_gnre
=
p_box
->
data
.
p_gnre
;
uint32_t
i_data_len
;
uint32_t
i_data_tag
;
MP4_GET4BYTES
(
i_data_len
);
MP4_GETFOURCC
(
i_data_tag
);
if
(
i_data_len
<
10
||
i_data_tag
!=
VLC_FOURCC
(
'd'
,
'a'
,
't'
,
'a'
)
)
MP4_READBOX_EXIT
(
0
);
uint32_t
i_version
;
uint32_t
i_reserved
;
MP4_GET4BYTES
(
i_version
);
MP4_GET4BYTES
(
i_reserved
);
MP4_GET2BYTES
(
p_gnre
->
i_genre
);
#ifdef MP4_VERBOSE
msg_Dbg
(
p_stream
,
"read box:
\"
gnre
\"
genre=%i"
,
p_gnre
->
i_genre
);
#endif
MP4_READBOX_EXIT
(
1
);
}
static
int
MP4_ReadBox_sample_soun
(
stream_t
*
p_stream
,
MP4_Box_t
*
p_box
)
static
int
MP4_ReadBox_sample_soun
(
stream_t
*
p_stream
,
MP4_Box_t
*
p_box
)
{
{
unsigned
int
i
;
unsigned
int
i
;
...
@@ -2571,6 +2598,7 @@ static const struct
...
@@ -2571,6 +2598,7 @@ static const struct
{
FOURCC_avcC
,
MP4_ReadBox_avcC
,
MP4_FreeBox_avcC
},
{
FOURCC_avcC
,
MP4_ReadBox_avcC
,
MP4_FreeBox_avcC
},
{
FOURCC_dac3
,
MP4_ReadBox_dac3
,
MP4_FreeBox_Common
},
{
FOURCC_dac3
,
MP4_ReadBox_dac3
,
MP4_FreeBox_Common
},
{
FOURCC_enda
,
MP4_ReadBox_enda
,
MP4_FreeBox_Common
},
{
FOURCC_enda
,
MP4_ReadBox_enda
,
MP4_FreeBox_Common
},
{
FOURCC_gnre
,
MP4_ReadBox_gnre
,
MP4_FreeBox_Common
},
/* Nothing to do with this box */
/* Nothing to do with this box */
{
FOURCC_mdat
,
MP4_ReadBoxSkip
,
MP4_FreeBox_Common
},
{
FOURCC_mdat
,
MP4_ReadBoxSkip
,
MP4_FreeBox_Common
},
...
...
modules/demux/mp4/libmp4.h
View file @
8cba4462
...
@@ -121,6 +121,7 @@
...
@@ -121,6 +121,7 @@
#define FOURCC_dac3 VLC_FOURCC( 'd', 'a', 'c', '3' )
#define FOURCC_dac3 VLC_FOURCC( 'd', 'a', 'c', '3' )
#define FOURCC_dec3 VLC_FOURCC( 'd', 'e', 'c', '3' )
#define FOURCC_dec3 VLC_FOURCC( 'd', 'e', 'c', '3' )
#define FOURCC_enda VLC_FOURCC( 'e', 'n', 'd', 'a' )
#define FOURCC_enda VLC_FOURCC( 'e', 'n', 'd', 'a' )
#define FOURCC_gnre VLC_FOURCC( 'g', 'n', 'r', 'e' )
#define FOURCC_zlib VLC_FOURCC( 'z', 'l', 'i', 'b' )
#define FOURCC_zlib VLC_FOURCC( 'z', 'l', 'i', 'b' )
#define FOURCC_SVQ1 VLC_FOURCC( 'S', 'V', 'Q', '1' )
#define FOURCC_SVQ1 VLC_FOURCC( 'S', 'V', 'Q', '1' )
...
@@ -879,6 +880,12 @@ typedef struct
...
@@ -879,6 +880,12 @@ typedef struct
}
MP4_Box_data_enda_t
;
}
MP4_Box_data_enda_t
;
typedef
struct
{
uint16_t
i_genre
;
}
MP4_Box_data_gnre_t
;
/*
/*
typedef struct MP4_Box_data__s
typedef struct MP4_Box_data__s
{
{
...
@@ -914,6 +921,7 @@ typedef union MP4_Box_data_s
...
@@ -914,6 +921,7 @@ typedef union MP4_Box_data_s
MP4_Box_data_avcC_t
*
p_avcC
;
MP4_Box_data_avcC_t
*
p_avcC
;
MP4_Box_data_dac3_t
*
p_dac3
;
MP4_Box_data_dac3_t
*
p_dac3
;
MP4_Box_data_enda_t
*
p_enda
;
MP4_Box_data_enda_t
*
p_enda
;
MP4_Box_data_gnre_t
*
p_gnre
;
MP4_Box_data_stsz_t
*
p_stsz
;
MP4_Box_data_stsz_t
*
p_stsz
;
MP4_Box_data_stz2_t
*
p_stz2
;
MP4_Box_data_stz2_t
*
p_stz2
;
...
...
modules/demux/mp4/mp4.c
View file @
8cba4462
...
@@ -41,6 +41,7 @@
...
@@ -41,6 +41,7 @@
#include "libmp4.h"
#include "libmp4.h"
#include "drms.h"
#include "drms.h"
#include "../../meta_engine/id3genres.h"
/*****************************************************************************
/*****************************************************************************
* Module descriptor
* Module descriptor
...
@@ -903,6 +904,11 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
...
@@ -903,6 +904,11 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
SET
(
vlc_meta_SetGenre
);
SET
(
vlc_meta_SetGenre
);
break
;
break
;
case
FOURCC_gnre
:
if
(
p_0xa9xxx
->
data
.
p_gnre
->
i_genre
<
NUM_GENRES
)
vlc_meta_SetGenre
(
p_meta
,
ppsz_genres
[
p_0xa9xxx
->
data
.
p_gnre
->
i_genre
]
);
break
;
case
FOURCC_0xa9alb
:
/* Album */
case
FOURCC_0xa9alb
:
/* Album */
SET
(
vlc_meta_SetAlbum
);
SET
(
vlc_meta_SetAlbum
);
break
;
break
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment