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
df3af6f1
Commit
df3af6f1
authored
Apr 30, 2008
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Support for RIFF/MIDI files
parent
8d89d740
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
0 deletions
+38
-0
modules/demux/smf.c
modules/demux/smf.c
+38
-0
No files found.
modules/demux/smf.c
View file @
df3af6f1
...
...
@@ -87,6 +87,44 @@ static int Open (vlc_object_t * p_this)
if
(
stream_Peek
(
stream
,
&
peek
,
14
)
<
14
)
return
VLC_EGENERIC
;
/* Skip RIFF MIDI header if present */
if
(
!
memcmp
(
peek
,
"RIFF"
,
4
)
&&
!
memcmp
(
peek
+
8
,
"RMID"
,
4
))
{
uint32_t
riff_len
=
GetDWLE
(
peek
+
4
);
msg_Dbg
(
p_this
,
"detected RIFF MIDI file (%u bytes)"
,
(
unsigned
)
riff_len
);
if
((
stream_Read
(
stream
,
NULL
,
12
)
<
12
))
return
VLC_EGENERIC
;
/* Look for the RIFF data chunk */
for
(;;)
{
char
chnk_hdr
[
8
];
uint32_t
chnk_len
;
if
((
riff_len
<
8
)
||
(
stream_Read
(
stream
,
chnk_hdr
,
8
)
<
8
))
return
VLC_EGENERIC
;
riff_len
-=
8
;
chnk_len
=
GetDWLE
(
chnk_hdr
+
4
);
if
(
riff_len
<
chnk_len
)
return
VLC_EGENERIC
;
riff_len
-=
chnk_len
;
if
(
!
memcmp
(
chnk_hdr
,
"data"
,
4
))
break
;
/* found! */
if
(
stream_Read
(
stream
,
NULL
,
chnk_len
)
<
(
ssize_t
)
chnk_len
)
return
VLC_EGENERIC
;
}
/* Read real SMF header. Assume RIFF data chunk length is proper. */
if
(
stream_Peek
(
stream
,
&
peek
,
14
)
<
14
)
return
VLC_EGENERIC
;
}
if
(
memcmp
(
peek
,
"MThd
\x00\x00\x00\x06
"
,
8
))
return
VLC_EGENERIC
;
peek
+=
8
;
...
...
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