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
22fa5b8f
Commit
22fa5b8f
authored
Jan 20, 2012
by
Rafaël Carré
Browse files
release filepath copy as soon as we don't need it
parent
5741037e
Changes
1
Hide whitespace changes
Inline
Side-by-side
vlc-android/jni/thumbnailer.c
View file @
22fa5b8f
...
...
@@ -95,17 +95,13 @@ jbyteArray Java_org_videolan_vlc_android_LibVLC_getThumbnail(JNIEnv *env, jobjec
jint
width
,
jint
height
)
{
libvlc_instance_t
*
libvlc
=
(
libvlc_instance_t
*
)
instance
;
jboolean
isCopy
;
jbyteArray
byteArray
=
NULL
;
const
char
*
psz_filePath
=
(
*
env
)
->
GetStringUTFChars
(
env
,
filePath
,
&
isCopy
);
/* Create the thumbnailer data structure */
thumbnailer_sys_t
*
sys
=
calloc
(
1
,
sizeof
(
thumbnailer_sys_t
));
if
(
sys
==
NULL
)
{
LOGE
(
"Couldn't create the thumbnailer data structure!"
);
(
*
env
)
->
ReleaseStringUTFChars
(
env
,
filePath
,
psz_filePath
);
return
NULL
;
}
...
...
@@ -117,7 +113,11 @@ jbyteArray Java_org_videolan_vlc_android_LibVLC_getThumbnail(JNIEnv *env, jobjec
sys
->
mp
=
libvlc_media_player_new
(
libvlc
);
/* Create a new item and assign it to the media player. */
jboolean
isCopy
;
const
char
*
psz_filePath
=
(
*
env
)
->
GetStringUTFChars
(
env
,
filePath
,
&
isCopy
);
libvlc_media_t
*
m
=
libvlc_media_new_path
(
libvlc
,
psz_filePath
);
(
*
env
)
->
ReleaseStringUTFChars
(
env
,
filePath
,
psz_filePath
);
if
(
m
==
NULL
)
{
LOGE
(
"Couldn't create the media to play!"
);
...
...
@@ -223,7 +223,6 @@ jbyteArray Java_org_videolan_vlc_android_LibVLC_getThumbnail(JNIEnv *env, jobjec
(
*
env
)
->
DeleteLocalRef
(
env
,
byteArray
);
end:
(
*
env
)
->
ReleaseStringUTFChars
(
env
,
filePath
,
psz_filePath
);
pthread_mutex_destroy
(
&
sys
->
doneMutex
);
pthread_cond_destroy
(
&
sys
->
doneCondVar
);
free
(
sys
->
thumbnail
);
...
...
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