Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
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-2-2
Commits
ea857aac
Commit
ea857aac
authored
May 25, 2013
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
smf: cosmetics
parent
effa2ea1
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
8 deletions
+8
-8
modules/demux/smf.c
modules/demux/smf.c
+8
-8
No files found.
modules/demux/smf.c
View file @
ea857aac
...
...
@@ -172,17 +172,13 @@ static int Open (vlc_object_t * p_this)
}
p_sys
=
malloc
(
sizeof
(
*
p_sys
)
+
(
sizeof
(
mtrk_t
)
*
tracks
));
if
(
p_sys
==
NULL
)
if
(
unlikely
(
p_sys
==
NULL
)
)
return
VLC_ENOMEM
;
/* We've had a valid SMF header - now skip it*/
if
(
stream_Read
(
stream
,
NULL
,
14
)
<
14
)
goto
error
;
p_demux
->
pf_demux
=
Demux
;
p_demux
->
pf_control
=
Control
;
p_demux
->
p_sys
=
p_sys
;
/* Default SMF tempo is 120BPM, i.e. half a second per quarter note */
date_Init
(
&
p_sys
->
pts
,
ppqn
*
2
,
1
);
date_Set
(
&
p_sys
->
pts
,
0
);
...
...
@@ -200,7 +196,7 @@ static int Open (vlc_object_t * p_this)
/* Seeking screws streaming up, but there is no way around this,
* as SMF1 tracks are performed simultaneously.
* Not a big deal as SMF1 are usually only a few kbytes anyway. */
if
(
stream_Seek
(
stream
,
p_sys
->
trackv
[
i
-
1
].
end
))
if
(
stream_Seek
(
stream
,
p_sys
->
trackv
[
i
-
1
].
end
))
{
msg_Err
(
p_this
,
"cannot build SMF index (corrupted file?)"
);
goto
error
;
...
...
@@ -239,6 +235,9 @@ static int Open (vlc_object_t * p_this)
fmt
.
audio
.
i_rate
=
44100
;
/* dummy value */
p_sys
->
es
=
es_out_Add
(
p_demux
->
out
,
&
fmt
);
p_demux
->
pf_demux
=
Demux
;
p_demux
->
pf_control
=
Control
;
p_demux
->
p_sys
=
p_sys
;
return
VLC_SUCCESS
;
error:
...
...
@@ -539,7 +538,7 @@ int HandleMessage (demux_t *p_demux, mtrk_t *tr)
if
(
datalen
==
0
)
{
msg_Err
(
p_demux
,
"malformatted MIDI event"
);
return
-
1
;
/*
can't use implicit running status with empty payload!
*/
return
-
1
;
/*
implicit running status requires non-empty payload
*/
}
block
->
p_buffer
[
1
]
=
first
;
...
...
@@ -574,7 +573,8 @@ static int Demux (demux_t *p_demux)
if
(
pulse
==
UINT64_MAX
)
return
0
;
/* all tracks are done */
es_out_Control
(
p_demux
->
out
,
ES_OUT_SET_PCR
,
VLC_TS_0
+
date_Get
(
&
p_sys
->
pts
));
es_out_Control
(
p_demux
->
out
,
ES_OUT_SET_PCR
,
VLC_TS_0
+
date_Get
(
&
p_sys
->
pts
));
for
(
unsigned
i
=
0
;
i
<
p_sys
->
trackc
;
i
++
)
{
...
...
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