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
4bdcec38
Commit
4bdcec38
authored
Jun 11, 2012
by
Jean-Baptiste Kempf
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Vorbis: cosmetics
parent
065f6bb1
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
12 deletions
+12
-12
modules/demux/vorbis.h
modules/demux/vorbis.h
+12
-12
No files found.
modules/demux/vorbis.h
View file @
4bdcec38
...
@@ -119,7 +119,7 @@ static inline void vorbis_ParseComment( vlc_meta_t **pp_meta, const uint8_t *p_d
...
@@ -119,7 +119,7 @@ static inline void vorbis_ParseComment( vlc_meta_t **pp_meta, const uint8_t *p_d
for
(
;
i_comment
>
0
;
i_comment
--
)
for
(
;
i_comment
>
0
;
i_comment
--
)
{
{
char
*
psz
;
char
*
psz
_comment
;
if
(
i_data
<
4
)
if
(
i_data
<
4
)
break
;
break
;
n
=
GetDWLE
(
p_data
);
RM
(
4
);
n
=
GetDWLE
(
p_data
);
RM
(
4
);
...
@@ -128,25 +128,25 @@ static inline void vorbis_ParseComment( vlc_meta_t **pp_meta, const uint8_t *p_d
...
@@ -128,25 +128,25 @@ static inline void vorbis_ParseComment( vlc_meta_t **pp_meta, const uint8_t *p_d
if
(
n
<=
0
)
if
(
n
<=
0
)
continue
;
continue
;
psz
=
strndup
(
(
const
char
*
)
p_data
,
n
);
psz
_comment
=
strndup
(
(
const
char
*
)
p_data
,
n
);
RM
(
n
);
RM
(
n
);
EnsureUTF8
(
psz
);
EnsureUTF8
(
psz
_comment
);
#define IF_EXTRACT(txt,var) \
#define IF_EXTRACT(txt,var) \
if( !strncasecmp(psz, txt, strlen(txt)) ) \
if( !strncasecmp(psz
_comment
, txt, strlen(txt)) ) \
{ \
{ \
const char *oldval = vlc_meta_Get( p_meta, vlc_meta_ ## var ); \
const char *oldval = vlc_meta_Get( p_meta, vlc_meta_ ## var ); \
if( oldval && has##var) \
if( oldval && has##var) \
{ \
{ \
char * newval; \
char * newval; \
if( asprintf( &newval, "%s,%s", oldval, &psz[strlen(txt)] ) == -1 ) \
if( asprintf( &newval, "%s,%s", oldval, &psz
_comment
[strlen(txt)] ) == -1 ) \
newval = NULL; \
newval = NULL; \
vlc_meta_Set( p_meta, vlc_meta_ ## var, newval ); \
vlc_meta_Set( p_meta, vlc_meta_ ## var, newval ); \
free( newval ); \
free( newval ); \
} \
} \
else \
else \
vlc_meta_Set( p_meta, vlc_meta_ ## var, &psz[strlen(txt)] ); \
vlc_meta_Set( p_meta, vlc_meta_ ## var, &psz
_comment
[strlen(txt)] ); \
has##var = true; \
has##var = true; \
}
}
IF_EXTRACT
(
"TITLE="
,
Title
)
IF_EXTRACT
(
"TITLE="
,
Title
)
...
@@ -164,14 +164,14 @@ static inline void vorbis_ParseComment( vlc_meta_t **pp_meta, const uint8_t *p_d
...
@@ -164,14 +164,14 @@ static inline void vorbis_ParseComment( vlc_meta_t **pp_meta, const uint8_t *p_d
}
}
else
IF_EXTRACT
(
"GENRE="
,
Genre
)
else
IF_EXTRACT
(
"GENRE="
,
Genre
)
else
IF_EXTRACT
(
"DATE="
,
Date
)
else
IF_EXTRACT
(
"DATE="
,
Date
)
else
if
(
!
strncasecmp
(
psz
,
"METADATA_BLOCK_PICTURE="
,
strlen
(
"METADATA_BLOCK_PICTURE="
)))
else
if
(
!
strncasecmp
(
psz
_comment
,
"METADATA_BLOCK_PICTURE="
,
strlen
(
"METADATA_BLOCK_PICTURE="
)))
{
{
if
(
attachments
==
NULL
)
if
(
attachments
==
NULL
)
continue
;
continue
;
int
i
;
int
i
;
uint8_t
*
p_picture
;
uint8_t
*
p_picture
;
size_t
i_size
=
vlc_b64_decode_binary
(
&
p_picture
,
&
psz
[
strlen
(
"METADATA_BLOCK_PICTURE="
)]);
size_t
i_size
=
vlc_b64_decode_binary
(
&
p_picture
,
&
psz
_comment
[
strlen
(
"METADATA_BLOCK_PICTURE="
)]);
input_attachment_t
*
p_attachment
=
ParseFlacPicture
(
p_picture
,
i_size
,
i_attach
,
&
i
);
input_attachment_t
*
p_attachment
=
ParseFlacPicture
(
p_picture
,
i_size
,
i_attach
,
&
i
);
if
(
p_attachment
)
if
(
p_attachment
)
{
{
...
@@ -183,16 +183,16 @@ static inline void vorbis_ParseComment( vlc_meta_t **pp_meta, const uint8_t *p_d
...
@@ -183,16 +183,16 @@ static inline void vorbis_ParseComment( vlc_meta_t **pp_meta, const uint8_t *p_d
*
i_attachments
,
*
attachments
,
p_attachment
);
*
i_attachments
,
*
attachments
,
p_attachment
);
}
}
}
}
else
if
(
strchr
(
psz
,
'='
)
)
else
if
(
strchr
(
psz
_comment
,
'='
)
)
{
{
/* generic (PERFORMER/LICENSE/ORGANIZATION/LOCATION/CONTACT/ISRC,
/* generic (PERFORMER/LICENSE/ORGANIZATION/LOCATION/CONTACT/ISRC,
* undocumented tags and replay gain ) */
* undocumented tags and replay gain ) */
char
*
p
=
strchr
(
psz
,
'='
);
char
*
p
=
strchr
(
psz
_comment
,
'='
);
*
p
++
=
'\0'
;
*
p
++
=
'\0'
;
vlc_meta_AddExtra
(
p_meta
,
psz
,
p
);
vlc_meta_AddExtra
(
p_meta
,
psz
_comment
,
p
);
}
}
#undef IF_EXTRACT
#undef IF_EXTRACT
free
(
psz
);
free
(
psz
_comment
);
}
}
#undef RM
#undef RM
}
}
...
...
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