Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Libraries
Phonon VLC
Commits
fccb71d3
Commit
fccb71d3
authored
Mar 28, 2011
by
Harald Sitter
🏳️🌈
Browse files
use QVarLengthArray as suggested by Pino
parent
226469d0
Changes
1
Hide whitespace changes
Inline
Side-by-side
vlc/libvlc.cpp
View file @
fccb71d3
...
...
@@ -25,6 +25,7 @@
#include
<QtCore/QSettings>
#include
<QtCore/QString>
#include
<QtCore/QStringBuilder>
#include
<QtCore/QVarLengthArray>
#include
<vlc/libvlc.h>
...
...
@@ -99,18 +100,13 @@ bool LibVLC::init()
#endif
// Build const char* array
// MSVC does not support dynamic arrays, so we assume a fixed size
// of 64 as sufficient.
Q_ASSERT_X
(
64
>
args
.
size
(),
"libvlc init"
,
"maximum amount of arguments exceeded, "
"increase size of char**"
);
const
char
*
vlcArgs
[
64
];
QVarLengthArray
<
const
char
*
,
64
>
vlcArgs
(
args
.
size
());
for
(
int
i
=
0
;
i
<
args
.
size
();
++
i
)
{
vlcArgs
[
i
]
=
args
.
at
(
i
).
constData
();
}
// Create and initialize a libvlc instance (it should be done only once)
self
->
m_vlcInstance
=
libvlc_new
(
a
rgs
.
size
()
-
1
,
vlcArgs
);
self
->
m_vlcInstance
=
libvlc_new
(
vlcA
rgs
.
size
(),
vlcArgs
.
constData
()
);
if
(
!
self
->
m_vlcInstance
)
{
fatal
()
<<
"libVLC:"
<<
LibVLC
::
errorMessage
();
return
false
;
...
...
Write
Preview
Supports
Markdown
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