Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
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-gpu
Commits
feb33628
Commit
feb33628
authored
Apr 01, 2005
by
Sigmund Augdal Helberg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
demux/flac.c: support flac files with id3 tag. closes #2015
parent
ce596a3b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
2 deletions
+29
-2
modules/demux/flac.c
modules/demux/flac.c
+29
-2
No files found.
modules/demux/flac.c
View file @
feb33628
...
...
@@ -56,6 +56,7 @@ struct demux_sys_t
/* Packetizer */
decoder_t
*
p_packetizer
;
vlc_meta_t
*
p_meta
;
};
#define STREAMINFO_SIZE 38
...
...
@@ -67,18 +68,33 @@ struct demux_sys_t
static
int
Open
(
vlc_object_t
*
p_this
)
{
demux_t
*
p_demux
=
(
demux_t
*
)
p_this
;
module_t
*
p_id3
;
demux_sys_t
*
p_sys
;
int
i_peek
;
byte_t
*
p_peek
;
es_format_t
fmt
;
vlc_meta_t
*
p_meta
=
NULL
;
/* Skip/parse possible id3 header */
if
(
(
p_id3
=
module_Need
(
p_demux
,
"id3"
,
NULL
,
0
)
)
)
{
p_meta
=
(
vlc_meta_t
*
)
p_demux
->
p_private
;
p_demux
->
p_private
=
NULL
;
module_Unneed
(
p_demux
,
p_id3
);
}
/* Have a peep at the show. */
if
(
stream_Peek
(
p_demux
->
s
,
&
p_peek
,
4
)
<
4
)
return
VLC_EGENERIC
;
if
(
stream_Peek
(
p_demux
->
s
,
&
p_peek
,
4
)
<
4
)
{
if
(
p_meta
)
vlc_meta_Delete
(
p_meta
);
return
VLC_EGENERIC
;
}
if
(
p_peek
[
0
]
!=
'f'
||
p_peek
[
1
]
!=
'L'
||
p_peek
[
2
]
!=
'a'
||
p_peek
[
3
]
!=
'C'
)
{
if
(
strncmp
(
p_demux
->
psz_demux
,
"flac"
,
4
)
)
{
if
(
p_meta
)
vlc_meta_Delete
(
p_meta
);
return
VLC_EGENERIC
;
}
/* User forced */
...
...
@@ -91,18 +107,21 @@ static int Open( vlc_object_t * p_this )
p_demux
->
p_sys
=
p_sys
=
malloc
(
sizeof
(
demux_sys_t
)
);
es_format_Init
(
&
fmt
,
AUDIO_ES
,
VLC_FOURCC
(
'f'
,
'l'
,
'a'
,
'c'
)
);
p_sys
->
b_start
=
VLC_TRUE
;
p_sys
->
p_meta
=
p_meta
;
/* We need to read and store the STREAMINFO metadata */
i_peek
=
stream_Peek
(
p_demux
->
s
,
&
p_peek
,
8
);
if
(
p_peek
[
4
]
&
0x7F
)
{
msg_Err
(
p_demux
,
"this isn't a STREAMINFO metadata block"
);
if
(
p_meta
)
vlc_meta_Delete
(
p_meta
);
return
VLC_EGENERIC
;
}
if
(
((
p_peek
[
5
]
<<
16
)
+
(
p_peek
[
6
]
<<
8
)
+
p_peek
[
7
])
!=
(
STREAMINFO_SIZE
-
4
)
)
{
msg_Err
(
p_demux
,
"invalid size for a STREAMINFO metadata block"
);
if
(
p_meta
)
vlc_meta_Delete
(
p_meta
);
return
VLC_EGENERIC
;
}
...
...
@@ -140,6 +159,7 @@ static int Open( vlc_object_t * p_this )
vlc_object_destroy
(
p_sys
->
p_packetizer
);
msg_Err
(
p_demux
,
"cannot find flac packetizer"
);
if
(
p_meta
)
vlc_meta_Delete
(
p_meta
);
return
VLC_EGENERIC
;
}
...
...
@@ -164,7 +184,7 @@ static void Close( vlc_object_t * p_this )
/* Delete the decoder */
vlc_object_destroy
(
p_sys
->
p_packetizer
);
if
(
p_sys
->
p_meta
)
vlc_meta_Delete
(
p_sys
->
p_meta
);
free
(
p_sys
);
}
...
...
@@ -221,6 +241,13 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
/* FIXME bitrate */
if
(
i_query
==
DEMUX_SET_TIME
)
return
VLC_EGENERIC
;
else
if
(
i_query
==
DEMUX_GET_META
)
{
vlc_meta_t
**
pp_meta
=
(
vlc_meta_t
**
)
va_arg
(
args
,
vlc_meta_t
**
);
if
(
p_demux
->
p_sys
->
p_meta
)
*
pp_meta
=
vlc_meta_Duplicate
(
p_demux
->
p_sys
->
p_meta
);
else
*
pp_meta
=
NULL
;
return
VLC_SUCCESS
;
}
else
return
demux2_vaControlHelper
(
p_demux
->
s
,
0
,
-
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