Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
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
Commits
de94406f
Commit
de94406f
authored
Jan 10, 2009
by
Filippo Carone
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jvlc #23: make native resources release explicit
parent
0db07ccf
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
56 additions
and
8 deletions
+56
-8
bindings/java/core/src/main/java/org/videolan/jvlc/JVLC.java
bindings/java/core/src/main/java/org/videolan/jvlc/JVLC.java
+3
-0
bindings/java/core/src/main/java/org/videolan/jvlc/MediaDescriptor.java
...core/src/main/java/org/videolan/jvlc/MediaDescriptor.java
+1
-1
bindings/java/core/src/main/java/org/videolan/jvlc/MediaList.java
.../java/core/src/main/java/org/videolan/jvlc/MediaList.java
+19
-4
bindings/java/core/src/main/java/org/videolan/jvlc/MediaListPlayer.java
...core/src/main/java/org/videolan/jvlc/MediaListPlayer.java
+17
-1
bindings/java/core/src/main/java/org/videolan/jvlc/MediaPlayer.java
...ava/core/src/main/java/org/videolan/jvlc/MediaPlayer.java
+16
-2
No files found.
bindings/java/core/src/main/java/org/videolan/jvlc/JVLC.java
View file @
de94406f
...
...
@@ -176,6 +176,9 @@ public class JVLC
vlm
.
release
();
vlm
=
null
;
}
mediaList
.
release
();
mediaListPlayer
.
release
();
libvlc
.
libvlc_release
(
instance
);
}
...
...
bindings/java/core/src/main/java/org/videolan/jvlc/MediaDescriptor.java
View file @
de94406f
...
...
@@ -36,7 +36,7 @@ public class MediaDescriptor
private
LibVlcMedia
instance
;
private
LibVlc
libvlc
;
private
LibVlcEventManager
eventManager
;
private
boolean
released
;
private
volatile
boolean
released
;
private
MediaPlayer
mediaPlayer
;
...
...
bindings/java/core/src/main/java/org/videolan/jvlc/MediaList.java
View file @
de94406f
...
...
@@ -26,7 +26,6 @@
package
org.videolan.jvlc
;
import
java.util.ArrayList
;
import
java.util.LinkedHashSet
;
import
java.util.List
;
import
org.videolan.jvlc.internal.LibVlc.LibVlcEventManager
;
...
...
@@ -42,10 +41,12 @@ public class MediaList
private
final
LibVlcMediaList
instance
;
private
final
LibVlcEventManager
eventManager
;
private
List
<
String
>
items
=
new
ArrayList
<
String
>();
private
LibVlcEventManager
eventManager
;
private
volatile
boolean
released
;
public
MediaList
(
JVLC
jvlc
)
{
this
.
jvlc
=
jvlc
;
...
...
@@ -188,7 +189,7 @@ public class MediaList
@Override
protected
void
finalize
()
throws
Throwable
{
jvlc
.
getLibvlc
().
libvlc_media_list_release
(
instance
);
release
(
);
super
.
finalize
();
}
...
...
@@ -201,6 +202,20 @@ public class MediaList
return
instance
;
}
/**
*
*/
public
void
release
()
{
if
(
released
)
{
return
;
}
released
=
true
;
jvlc
.
getLibvlc
().
libvlc_media_list_release
(
instance
);
}
}
bindings/java/core/src/main/java/org/videolan/jvlc/MediaListPlayer.java
View file @
de94406f
...
...
@@ -35,6 +35,8 @@ public class MediaListPlayer
private
final
LibVlcMediaListPlayer
instance
;
private
final
JVLC
jvlc
;
private
volatile
boolean
released
;
public
MediaListPlayer
(
JVLC
jvlc
)
{
...
...
@@ -172,8 +174,22 @@ public class MediaListPlayer
@Override
protected
void
finalize
()
throws
Throwable
{
jvlc
.
getLibvlc
().
libvlc_media_list_player_release
(
instance
);
release
(
);
super
.
finalize
();
}
/**
*
*/
public
void
release
()
{
if
(
released
)
{
return
;
}
released
=
true
;
jvlc
.
getLibvlc
().
libvlc_media_list_player_release
(
instance
);
}
}
bindings/java/core/src/main/java/org/videolan/jvlc/MediaPlayer.java
View file @
de94406f
...
...
@@ -51,6 +51,8 @@ public class MediaPlayer
private
MediaDescriptor
mediaDescriptor
;
private
volatile
boolean
released
;
MediaPlayer
(
JVLC
jvlc
,
LibVlcMediaPlayer
instance
)
{
libvlc_exception_t
exception
=
new
libvlc_exception_t
();
...
...
@@ -176,6 +178,18 @@ public class MediaPlayer
@Override
protected
void
finalize
()
throws
Throwable
{
release
();
super
.
finalize
();
}
public
void
release
()
{
if
(
released
)
{
return
;
}
released
=
true
;
libvlc_exception_t
exception
=
new
libvlc_exception_t
();
for
(
MediaPlayerCallback
callback
:
callbacks
)
{
...
...
@@ -187,9 +201,9 @@ public class MediaPlayer
}
}
libvlc
.
libvlc_media_player_release
(
instance
);
super
.
finalize
();
}
/**
* Returns the instance.
* @return the instance
...
...
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