Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Casanowow Life for love
VLC-Android
Commits
1b454f51
Commit
1b454f51
authored
Jan 20, 2012
by
Rafaël Carré
Browse files
readMedia: allocate/release string around the code that uses it
parent
5fb0e6a5
Changes
1
Hide whitespace changes
Inline
Side-by-side
vlc-android/jni/libvlcjni.c
View file @
1b454f51
...
...
@@ -338,16 +338,15 @@ jobjectArray Java_org_videolan_vlc_android_LibVLC_readMediaMeta(JNIEnv *env,
void
Java_org_videolan_vlc_android_LibVLC_readMedia
(
JNIEnv
*
env
,
jobject
thiz
,
jint
instance
,
jstring
mrl
)
{
jboolean
isCopy
;
int
i
;
const
char
*
psz_mrl
=
(
*
env
)
->
GetStringUTFChars
(
env
,
mrl
,
&
isCopy
);
/* Release previous media player, if any */
releaseMediaPlayer
(
env
,
thiz
);
/* Create a new item */
jboolean
isCopy
;
const
char
*
psz_mrl
=
(
*
env
)
->
GetStringUTFChars
(
env
,
mrl
,
&
isCopy
);
libvlc_media_t
*
m
=
libvlc_media_new_path
((
libvlc_instance_t
*
)
instance
,
psz_mrl
);
(
*
env
)
->
ReleaseStringUTFChars
(
env
,
mrl
,
psz_mrl
);
/* Create a media player playing environment */
libvlc_media_player_t
*
mp
=
libvlc_media_player_new
((
libvlc_instance_t
*
)
instance
);
...
...
@@ -371,6 +370,7 @@ void Java_org_videolan_vlc_android_LibVLC_readMedia(JNIEnv *env, jobject thiz,
/* Subscribe to the events */
int
i
;
for
(
i
=
0
;
i
<
(
sizeof
(
mp_events
)
/
sizeof
(
*
mp_events
));
++
i
)
libvlc_event_attach
(
ev
,
mp_events
[
i
],
vlc_event_callback
,
myVm
);
...
...
@@ -384,8 +384,6 @@ void Java_org_videolan_vlc_android_LibVLC_readMedia(JNIEnv *env, jobject thiz,
libvlc_media_player_play
(
mp
);
//libvlc_media_player_release(mp);
(
*
env
)
->
ReleaseStringUTFChars
(
env
,
mrl
,
psz_mrl
);
}
jboolean
Java_org_videolan_vlc_android_LibVLC_hasVideoTrack
(
JNIEnv
*
env
,
jobject
thiz
,
...
...
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