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
39511f2b
Commit
39511f2b
authored
Jul 31, 2008
by
Filippo Carone
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jvlc: wait for correct player status before releasing libvlc
parent
38d49776
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
0 deletions
+33
-0
bindings/java/core/src/test/java/org/videolan/jvlc/internal/LibVlcMediaPlayerTest.java
...ava/org/videolan/jvlc/internal/LibVlcMediaPlayerTest.java
+1
-0
bindings/java/core/src/test/java/org/videolan/jvlc/internal/MediaListPlayerTest.java
.../java/org/videolan/jvlc/internal/MediaListPlayerTest.java
+32
-0
No files found.
bindings/java/core/src/test/java/org/videolan/jvlc/internal/LibVlcMediaPlayerTest.java
View file @
39511f2b
...
...
@@ -106,6 +106,7 @@ public class LibVlcMediaPlayerTest extends AbstractVLCInternalTest
libvlc
.
libvlc_media_player_play
(
mi
,
exception
);
Thread
.
sleep
(
100
);
libvlc
.
libvlc_media_player_stop
(
mi
,
exception
);
Thread
.
sleep
(
500
);
Assert
.
assertEquals
(
0
,
exception
.
raised
);
}
...
...
bindings/java/core/src/test/java/org/videolan/jvlc/internal/MediaListPlayerTest.java
View file @
39511f2b
...
...
@@ -27,6 +27,7 @@ package org.videolan.jvlc.internal;
import
junit.framework.Assert
;
import
org.junit.After
;
import
org.junit.Test
;
import
org.videolan.jvlc.internal.LibVlc.LibVlcMediaDescriptor
;
import
org.videolan.jvlc.internal.LibVlc.LibVlcMediaInstance
;
...
...
@@ -38,6 +39,8 @@ import org.videolan.jvlc.internal.LibVlc.libvlc_exception_t;
public
class
MediaListPlayerTest
extends
AbstractVLCInternalTest
{
private
LibVlcMediaListPlayer
current
;
@Test
public
void
mediaListPlayerNewTest
()
{
...
...
@@ -103,6 +106,7 @@ public class MediaListPlayerTest extends AbstractVLCInternalTest
{
libvlc_exception_t
exception
=
new
libvlc_exception_t
();
LibVlcMediaListPlayer
mediaListPlayer
=
libvlc
.
libvlc_media_list_player_new
(
libvlcInstance
,
exception
);
current
=
mediaListPlayer
;
LibVlcMediaList
mediaList
=
libvlc
.
libvlc_media_list_new
(
libvlcInstance
,
exception
);
LibVlcMediaDescriptor
mediaDescriptor
=
libvlc
.
libvlc_media_new
(
libvlcInstance
,
mrl
,
exception
);
libvlc
.
libvlc_media_list_add_media
(
mediaList
,
mediaDescriptor
,
exception
);
...
...
@@ -138,6 +142,11 @@ public class MediaListPlayerTest extends AbstractVLCInternalTest
Thread
.
sleep
(
150
);
}
libvlc
.
libvlc_media_list_player_stop
(
mediaListPlayer
,
exception
);
while
(
libvlc
.
libvlc_media_list_player_get_state
(
mediaListPlayer
,
exception
)
!=
LibVlcState
.
libvlc_Ended
.
ordinal
())
{
Thread
.
sleep
(
100
);
}
libvlc
.
libvlc_media_release
(
mediaDescriptor
);
libvlc
.
libvlc_media_list_release
(
mediaList
);
libvlc
.
libvlc_media_list_player_release
(
mediaListPlayer
);
...
...
@@ -298,4 +307,27 @@ public class MediaListPlayerTest extends AbstractVLCInternalTest
libvlc
.
libvlc_media_list_release
(
mediaList
);
}
@Override
@After
public
void
tearDown
()
{
if
(
current
!=
null
)
{
libvlc
.
libvlc_media_list_player_stop
(
current
,
exception
);
while
(
libvlc
.
libvlc_media_list_player_get_state
(
current
,
exception
)
!=
LibVlcState
.
libvlc_Ended
.
ordinal
())
{
try
{
Thread
.
sleep
(
100
);
}
catch
(
InterruptedException
e
)
{
//
}
}
}
current
=
null
;
super
.
tearDown
();
}
}
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