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
d7c8cf59
Commit
d7c8cf59
authored
May 23, 2009
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fluidsynth: fix block handling
parent
7e8f0d85
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
8 deletions
+8
-8
modules/codec/fluidsynth.c
modules/codec/fluidsynth.c
+8
-8
No files found.
modules/codec/fluidsynth.c
View file @
d7c8cf59
...
@@ -128,12 +128,14 @@ static aout_buffer_t *DecodeBlock (decoder_t *p_dec, block_t **pp_block)
...
@@ -128,12 +128,14 @@ static aout_buffer_t *DecodeBlock (decoder_t *p_dec, block_t **pp_block)
{
{
block_t
*
p_block
;
block_t
*
p_block
;
decoder_sys_t
*
p_sys
=
p_dec
->
p_sys
;
decoder_sys_t
*
p_sys
=
p_dec
->
p_sys
;
aout_buffer_t
*
p_out
=
NULL
;
if
(
pp_block
==
NULL
)
if
(
pp_block
==
NULL
)
return
NULL
;
return
NULL
;
p_block
=
*
pp_block
;
p_block
=
*
pp_block
;
if
(
p_block
==
NULL
)
if
(
p_block
==
NULL
)
return
NULL
;
return
NULL
;
*
pp_block
=
NULL
;
if
(
p_block
->
i_pts
&&
!
aout_DateGet
(
&
p_sys
->
end_date
))
if
(
p_block
->
i_pts
&&
!
aout_DateGet
(
&
p_sys
->
end_date
))
aout_DateSet
(
&
p_sys
->
end_date
,
p_block
->
i_pts
);
aout_DateSet
(
&
p_sys
->
end_date
,
p_block
->
i_pts
);
...
@@ -141,12 +143,11 @@ static aout_buffer_t *DecodeBlock (decoder_t *p_dec, block_t **pp_block)
...
@@ -141,12 +143,11 @@ static aout_buffer_t *DecodeBlock (decoder_t *p_dec, block_t **pp_block)
if
(
p_block
->
i_pts
<
aout_DateGet
(
&
p_sys
->
end_date
))
if
(
p_block
->
i_pts
<
aout_DateGet
(
&
p_sys
->
end_date
))
{
{
msg_Warn
(
p_dec
,
"MIDI message in the past?"
);
msg_Warn
(
p_dec
,
"MIDI message in the past?"
);
block_Release
(
p_block
);
goto
drop
;
return
NULL
;
}
}
if
(
p_block
->
i_buffer
<
1
)
if
(
p_block
->
i_buffer
<
1
)
return
NULL
;
goto
drop
;
uint8_t
channel
=
p_block
->
p_buffer
[
0
]
&
0xf
;
uint8_t
channel
=
p_block
->
p_buffer
[
0
]
&
0xf
;
uint8_t
p1
=
(
p_block
->
i_buffer
>
1
)
?
(
p_block
->
p_buffer
[
1
]
&
0x7f
)
:
0
;
uint8_t
p1
=
(
p_block
->
i_buffer
>
1
)
?
(
p_block
->
p_buffer
[
1
]
&
0x7f
)
:
0
;
...
@@ -178,17 +179,16 @@ static aout_buffer_t *DecodeBlock (decoder_t *p_dec, block_t **pp_block)
...
@@ -178,17 +179,16 @@ static aout_buffer_t *DecodeBlock (decoder_t *p_dec, block_t **pp_block)
if
(
samples
==
0
)
if
(
samples
==
0
)
return
NULL
;
return
NULL
;
aout_buffer_t
*
p_out
=
decoder_NewAudioBuffer
(
p_dec
,
samples
);
p_out
=
decoder_NewAudioBuffer
(
p_dec
,
samples
);
if
(
p_out
==
NULL
)
if
(
p_out
==
NULL
)
{
goto
drop
;
block_Release
(
p_block
);
return
NULL
;
}
p_out
->
start_date
=
aout_DateGet
(
&
p_sys
->
end_date
);
p_out
->
start_date
=
aout_DateGet
(
&
p_sys
->
end_date
);
p_out
->
end_date
=
aout_DateIncrement
(
&
p_sys
->
end_date
,
samples
);
p_out
->
end_date
=
aout_DateIncrement
(
&
p_sys
->
end_date
,
samples
);
fluid_synth_write_float
(
p_sys
->
synth
,
samples
,
fluid_synth_write_float
(
p_sys
->
synth
,
samples
,
p_out
->
p_buffer
,
0
,
2
,
p_out
->
p_buffer
,
0
,
2
,
p_out
->
p_buffer
,
1
,
2
);
p_out
->
p_buffer
,
1
,
2
);
drop:
block_Release
(
p_block
);
return
p_out
;
return
p_out
;
}
}
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