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
b14d2f10
Commit
b14d2f10
authored
Jan 25, 2010
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fluidsynth: use error dialogs if the sound font fails
parent
f65d4913
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
4 deletions
+15
-4
modules/codec/fluidsynth.c
modules/codec/fluidsynth.c
+15
-4
No files found.
modules/codec/fluidsynth.c
View file @
b14d2f10
...
...
@@ -28,6 +28,7 @@
#include <vlc_aout.h>
#include <vlc_codec.h>
#include <vlc_cpu.h>
#include <vlc_dialog.h>
/* On Win32, we link statically */
#ifdef WIN32
...
...
@@ -76,10 +77,14 @@ static int Open (vlc_object_t *p_this)
if
(
p_dec
->
fmt_in
.
i_codec
!=
VLC_CODEC_MIDI
)
return
VLC_EGENERIC
;
char
*
font_path
=
var_
CreateGetNonEmpty
String
(
p_this
,
"soundfont"
);
char
*
font_path
=
var_
Inherit
String
(
p_this
,
"soundfont"
);
if
(
font_path
==
NULL
)
{
msg_Err
(
p_this
,
"sound fonts file required for synthesis"
);
msg_Err
(
p_this
,
"sound font file required for synthesis"
);
dialog_Fatal
(
p_this
,
_
(
"MIDI synthesis not set up"
),
_
(
"A sound font file (.SF2) is required for MIDI synthesis.
\n
"
"Please install a sound font and configure it "
"from the VLC preferences (Codecs / Audio / FluidSynth).
\n
"
));
return
VLC_EGENERIC
;
}
...
...
@@ -95,13 +100,19 @@ static int Open (vlc_object_t *p_this)
p_sys
->
synth
=
new_fluid_synth
(
p_sys
->
settings
);
/* FIXME: I bet this is not thread-safe */
p_sys
->
soundfont
=
fluid_synth_sfload
(
p_sys
->
synth
,
font_path
,
1
);
free
(
font_path
);
if
(
p_sys
->
soundfont
==
-
1
)
{
msg_Err
(
p_this
,
"cannot load sound fonts file
"
);
msg_Err
(
p_this
,
"cannot load sound fonts file
%s"
,
font_path
);
Close
(
p_this
);
dialog_Fatal
(
p_this
,
_
(
"MIDI synthesis not set up"
),
_
(
"The specified sound font file (%s) is incorrect.
\n
"
"Please install a valid sound font and reconfigure it "
"from the VLC preferences (Codecs / Audio / FluidSynth).
\n
"
),
font_path
);
free
(
font_path
);
return
VLC_EGENERIC
;
}
free
(
font_path
);
p_dec
->
fmt_out
.
i_cat
=
AUDIO_ES
;
p_dec
->
fmt_out
.
audio
.
i_rate
=
44100
;
...
...
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