Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-1.1
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-1.1
Commits
086f0dc8
Commit
086f0dc8
authored
Aug 18, 2002
by
Sigmund Augdal Helberg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
the mp3 demux now parses id3 tags into the info structures if libid3tag
is available
parent
3dff442e
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
293 additions
and
126 deletions
+293
-126
Makefile.opts.in
Makefile.opts.in
+1
-0
configure
configure
+157
-114
configure.in
configure.in
+6
-0
modules/demux/mpeg/audio.c
modules/demux/mpeg/audio.c
+129
-12
No files found.
Makefile.opts.in
View file @
086f0dc8
...
...
@@ -133,6 +133,7 @@ qt_LDFLAGS = @qt_LDFLAGS@
qte_LDFLAGS
=
@qte_LDFLAGS@
rc_LDFLAGS
=
@rc_LDFLAGS@
sdl_LDFLAGS
=
@sdl_LDFLAGS@
audio_LDFLAGS
=
@audio_LDFLAGS@
ts_dvbpsi_LDFLAGS
=
@ts_dvbpsi_LDFLAGS@
vcd_LDFLAGS
=
@vcd_LDFLAGS@
vorbis_LDFLAGS
=
@vorbis_LDFLAGS@
...
...
configure
View file @
086f0dc8
This diff is collapsed.
Click to expand it.
configure.in
View file @
086f0dc8
...
...
@@ -1016,6 +1016,11 @@ then
fi
fi
dnl
dnl libid3tag support
dnl
AC_CHECK_HEADERS(id3tag.h, [audio_LDFLAGS="${audio_LDFLAGS} -lz -lid3tag"])
dnl
dnl ffmpeg decoder plugin
dnl
...
...
@@ -2087,6 +2092,7 @@ AC_SUBST(dvd_LDFLAGS)
AC_SUBST(dvdread_LDFLAGS)
AC_SUBST(dvdplay_LDFLAGS)
AC_SUBST(ts_dvbpsi_LDFLAGS)
AC_SUBST(audio_LDFLAGS)
AC_SUBST(esd_LDFLAGS)
AC_SUBST(familiar_LDFLAGS)
AC_SUBST(distort_LDFLAGS)
...
...
modules/demux/mpeg/audio.c
View file @
086f0dc8
...
...
@@ -2,7 +2,7 @@
* audio.c : mpeg audio Stream input module for vlc
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: audio.c,v 1.
5 2002/08/16 03:07:56 sam
Exp $
* $Id: audio.c,v 1.
6 2002/08/18 14:11:35 sigmunau
Exp $
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
...
...
@@ -32,6 +32,11 @@
#include <sys/types.h>
#ifdef HAVE_ID3TAG_H
#include <id3tag.h>
#endif
#undef HAVE_ID3TAG_H
/*****************************************************************************
* Local prototypes
*****************************************************************************/
...
...
@@ -438,27 +443,69 @@ static void ExtractConfiguration( demux_sys_t *p_demux )
}
/****************************************************************************
*
SkipID3Tag : check if an ID3 header is present and skip it
*
ParseID3Tag : parse an id3tag into the info structures
****************************************************************************
*
* Author : Sigmund Augdal
*
****************************************************************************/
static
int
SkipID3Tag
(
input_thread_t
*
p_input
)
' ****************************************************************************/
#ifdef HAVE_ID3TAG_H
static
void
ParseID3Tag
(
input_thread_t
*
p_input
,
u8
*
p_data
,
int
i_size
)
{
struct
id3_tag
*
p_id3_tag
;
struct
id3_frame
*
p_frame
;
input_info_category_t
*
p_category
;
int
i_strings
;
char
*
psz_temp
;
int
i
;
p_id3_tag
=
id3_tag_parse
(
p_data
,
i_size
);
p_category
=
input_InfoCategory
(
p_input
,
"ID3"
);
i
=
0
;
while
(
(
p_frame
=
id3_tag_findframe
(
p_id3_tag
,
"T"
,
i
)
)
)
{
i_strings
=
id3_field_getnstrings
(
&
p_frame
->
fields
[
1
]
);
while
(
i_strings
>
0
)
{
psz_temp
=
id3_ucs4_latin1duplicate
(
id3_field_getstrings
(
&
p_frame
->
fields
[
1
],
--
i_strings
)
);
input_AddInfo
(
p_category
,
(
char
*
)
p_frame
->
description
,
psz_temp
);
free
(
psz_temp
);
}
i
++
;
}
id3_tag_delete
(
p_id3_tag
);
}
#endif
/****************************************************************************
* ParseID3Tag : check if an ID3 header is present and parse and skip it
****************************************************************************
*
* Author : Sigmund Augdal
*
' ****************************************************************************/
static
int
ParseID3Tags
(
input_thread_t
*
p_input
)
{
int
count
;
u8
*
p_peek
;
int
i_size
;
#ifdef HAVE_ID3TAG_H
int
i_size2
;
stream_position_t
*
p_pos
;
#else
u8
version
,
revision
;
int
b_footer
;
int
i_size
;
#endif
msg_Dbg
(
p_input
,
"Checking for ID3 tag"
);
/* get 10 byte id3 header */
if
(
(
count
=
input_Peek
(
p_input
,
&
p_peek
,
10
)
)
<
10
)
if
(
input_Peek
(
p_input
,
&
p_peek
,
10
)
<
10
)
{
msg_Err
(
p_input
,
"cannot peek()"
);
return
(
-
1
);
}
#ifndef HAVE_ID3TAG_H
if
(
!
(
(
p_peek
[
0
]
==
0x49
)
&&
(
p_peek
[
1
]
==
0x44
)
&&
(
p_peek
[
2
]
==
0x33
)))
{
return
(
0
);
...
...
@@ -471,21 +518,91 @@ static int SkipID3Tag( input_thread_t *p_input )
i_size
=
(
p_peek
[
6
]
<<
21
)
+
(
p_peek
[
7
]
<<
14
)
+
(
p_peek
[
8
]
<<
7
)
+
p_peek
[
9
];
/* Is this safe? */
p_peek
[
9
];
if
(
b_footer
)
{
i_size
+=
10
;
}
i_size
+=
10
;
msg_Dbg
(
p_input
,
"ID3 tag found, skipping %d bytes"
,
i_size
);
#else
i_size
=
id3_tag_query
(
p_peek
,
10
);
if
(
p_input
->
stream
.
b_seekable
)
{
/*look for a id3v1 tag at the end of the file*/
p_pos
=
malloc
(
sizeof
(
stream_position_t
)
);
if
(
p_pos
==
0
)
{
msg_Err
(
p_input
,
"no mem"
);
}
input_Tell
(
p_input
,
p_pos
);
p_input
->
pf_seek
(
p_input
,
p_pos
->
i_size
-
128
);
input_AccessReinit
(
p_input
);
/* get 10 byte id3 header */
if
(
input_Peek
(
p_input
,
&
p_peek
,
10
)
<
10
)
{
msg_Err
(
p_input
,
"cannot peek()"
);
return
(
-
1
);
}
i_size2
=
id3_tag_query
(
p_peek
,
10
);
if
(
i_size2
==
128
)
{
/* peek the entire tag */
if
(
input_Peek
(
p_input
,
&
p_peek
,
i_size2
)
<
i_size2
)
{
msg_Err
(
p_input
,
"cannot peek()"
);
return
(
-
1
);
}
ParseID3Tag
(
p_input
,
p_peek
,
i_size2
);
}
/* look for id3v2.4 tag at end of file */
p_input
->
pf_seek
(
p_input
,
p_pos
->
i_size
-
10
);
input_AccessReinit
(
p_input
);
/* get 10 byte id3 footer */
if
(
input_Peek
(
p_input
,
&
p_peek
,
10
)
<
10
)
{
msg_Err
(
p_input
,
"cannot peek()"
);
return
(
-
1
);
}
i_size2
=
id3_tag_query
(
p_peek
,
10
);
if
(
i_size2
<
0
)
/* id3v2.4 footer found */
{
p_input
->
pf_seek
(
p_input
,
p_pos
->
i_size
-
i_size2
);
input_AccessReinit
(
p_input
);
/* peek the entire tag */
if
(
input_Peek
(
p_input
,
&
p_peek
,
i_size2
)
<
i_size2
)
{
msg_Err
(
p_input
,
"cannot peek()"
);
return
(
-
1
);
}
ParseID3Tag
(
p_input
,
p_peek
,
i_size2
);
}
free
(
p_pos
);
p_input
->
pf_seek
(
p_input
,
0
);
input_AccessReinit
(
p_input
);
}
if
(
i_size
<=
0
)
{
return
0
;
}
#endif
/* peek the entire tag */
if
(
input_Peek
(
p_input
,
&
p_peek
,
i_size
)
<
i_size
)
{
msg_Err
(
p_input
,
"cannot peek()"
);
return
(
-
1
);
}
p_input
->
p_current_data
+=
i_size
;
/* seek passed end of ID3 tag */
#ifdef HAVE_ID3TAG_H
ParseID3Tag
(
p_input
,
p_peek
,
i_size
);
#endif
msg_Dbg
(
p_input
,
"ID3 tag found, skiping %d bytes"
,
i_size
);
p_input
->
pf_seek
(
p_input
,
i_size
);
input_AccessReinit
(
p_input
);
// p_input->p_current_data += i_size; /* seek passed end of ID3 tag */
return
(
0
);
}
...
...
@@ -549,7 +666,7 @@ static int Activate( vlc_object_t * p_this )
b_forced
=
0
;
}
if
(
SkipID3Tag
(
p_input
)
)
if
(
ParseID3Tags
(
p_input
)
)
{
return
(
-
1
);
}
...
...
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