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
e6a119ae
Commit
e6a119ae
authored
Oct 10, 2007
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Create ES, maintain PTS, and actually send MIDI messages to decoder
(Still MIDI tempo is critically missing)
parent
64ab7fa0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
18 deletions
+10
-18
modules/demux/smf.c
modules/demux/smf.c
+10
-18
No files found.
modules/demux/smf.c
View file @
e6a119ae
...
@@ -51,7 +51,6 @@ static int ReadDeltaTime (stream_t *s, mtrk_t *track);
...
@@ -51,7 +51,6 @@ static int ReadDeltaTime (stream_t *s, mtrk_t *track);
struct
demux_sys_t
struct
demux_sys_t
{
{
es_format_t
fmt
;
es_out_id_t
*
es
;
es_out_id_t
*
es
;
date_t
pts
;
date_t
pts
;
uint64_t
pulse
;
/* Pulses counter */
uint64_t
pulse
;
/* Pulses counter */
...
@@ -137,8 +136,6 @@ static int Open (vlc_object_t * p_this)
...
@@ -137,8 +136,6 @@ static int Open (vlc_object_t * p_this)
p_demux
->
pf_control
=
Control
;
p_demux
->
pf_control
=
Control
;
p_demux
->
p_sys
=
p_sys
;
p_demux
->
p_sys
=
p_sys
;
es_format_Init
(
&
p_sys
->
fmt
,
AUDIO_ES
,
VLC_FOURCC
(
'M'
,
'I'
,
'D'
,
'I'
));
p_sys
->
es
=
NULL
;
/* SMF expresses tempo in Beats-Per-Minute, default is 120 */
/* SMF expresses tempo in Beats-Per-Minute, default is 120 */
date_Init
(
&
p_sys
->
pts
,
ppqn
*
120
,
60
);
date_Init
(
&
p_sys
->
pts
,
ppqn
*
120
,
60
);
p_sys
->
pulse
=
0
;
p_sys
->
pulse
=
0
;
...
@@ -184,6 +181,10 @@ static int Open (vlc_object_t * p_this)
...
@@ -184,6 +181,10 @@ static int Open (vlc_object_t * p_this)
* error if the first event uses running status. */
* error if the first event uses running status. */
}
}
es_format_t
fmt
;
es_format_Init
(
&
fmt
,
AUDIO_ES
,
VLC_FOURCC
(
'M'
,
'I'
,
'D'
,
'I'
));
p_sys
->
es
=
es_out_Add
(
p_demux
->
out
,
&
fmt
);
return
VLC_SUCCESS
;
return
VLC_SUCCESS
;
error:
error:
...
@@ -358,11 +359,8 @@ int HandleMessage (demux_t *p_demux, mtrk_t *tr)
...
@@ -358,11 +359,8 @@ int HandleMessage (demux_t *p_demux, mtrk_t *tr)
stream_Read
(
s
,
block
->
p_buffer
+
2
,
datalen
-
1
);
stream_Read
(
s
,
block
->
p_buffer
+
2
,
datalen
-
1
);
}
}
#if 0
block
->
i_dts
=
block
->
i_pts
=
date_Get
(
&
p_demux
->
p_sys
->
pts
);
es_out_Send
(
p_demux
->
out
,
p_demux
->
p_sys
->
es
,
block
);
es_out_Send
(
p_demux
->
out
,
p_demux
->
p_sys
->
es
,
block
);
#else
block_Release
(
block
);
#endif
skip:
skip:
if
(
event
<
0xF8
)
if
(
event
<
0xF8
)
...
@@ -387,11 +385,7 @@ static int Demux (demux_t *p_demux)
...
@@ -387,11 +385,7 @@ static int Demux (demux_t *p_demux)
if
(
pulse
==
UINT64_MAX
)
if
(
pulse
==
UINT64_MAX
)
return
0
;
/* all tracks are done */
return
0
;
/* all tracks are done */
/*p_block->i_dts = p_block->i_pts =
es_out_Control
(
p_demux
->
out
,
ES_OUT_SET_PCR
,
date_Get
(
&
p_sys
->
pts
));
date_Increment( &p_sys->pts, p_sys->fmt.audio.i_frame_length );
es_out_Control( p_demux->out, ES_OUT_SET_PCR, p_block->i_pts );*/
msg_Dbg
(
p_demux
,
"pulse %llu"
,
pulse
);
msg_Dbg
(
p_demux
,
"pulse %llu"
,
pulse
);
for
(
unsigned
i
=
0
;
i
<
p_sys
->
trackc
;
i
++
)
for
(
unsigned
i
=
0
;
i
<
p_sys
->
trackc
;
i
++
)
...
@@ -412,6 +406,9 @@ static int Demux (demux_t *p_demux)
...
@@ -412,6 +406,9 @@ static int Demux (demux_t *p_demux)
if
(
track
->
next
<
next_pulse
)
if
(
track
->
next
<
next_pulse
)
next_pulse
=
track
->
next
;
next_pulse
=
track
->
next
;
}
}
if
(
next_pulse
!=
UINT64_MAX
)
date_Increment
(
&
p_sys
->
pts
,
next_pulse
-
pulse
);
p_sys
->
pulse
=
next_pulse
;
p_sys
->
pulse
=
next_pulse
;
return
1
;
return
1
;
...
@@ -423,10 +420,5 @@ static int Demux (demux_t *p_demux)
...
@@ -423,10 +420,5 @@ static int Demux (demux_t *p_demux)
*****************************************************************************/
*****************************************************************************/
static
int
Control
(
demux_t
*
p_demux
,
int
i_query
,
va_list
args
)
static
int
Control
(
demux_t
*
p_demux
,
int
i_query
,
va_list
args
)
{
{
demux_sys_t
*
p_sys
=
p_demux
->
p_sys
;
return
demux2_vaControlHelper
(
p_demux
->
s
,
0
,
-
1
,
0
,
1
,
i_query
,
args
);
return
demux2_vaControlHelper
(
p_demux
->
s
,
0
,
-
1
,
p_sys
->
fmt
.
i_bitrate
,
p_sys
->
fmt
.
audio
.
i_blockalign
,
i_query
,
args
);
}
}
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