Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Open sidebar
VideoLAN
VLC-Android
Commits
267671dc
Commit
267671dc
authored
Jun 09, 2016
by
Geoffrey Métais
1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Let PlaybackService to handle seek on media load
parent
0d3b889a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
14 deletions
+14
-14
vlc-android/src/org/videolan/vlc/PlaybackService.java
vlc-android/src/org/videolan/vlc/PlaybackService.java
+8
-3
vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
...d/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
+6
-11
No files found.
vlc-android/src/org/videolan/vlc/PlaybackService.java
View file @
267671dc
...
...
@@ -2000,13 +2000,18 @@ public class PlaybackService extends Service implements IVLCVout.Callback {
}
@MainThread
public
void
seek
(
long
position
,
long
length
)
{
if
(
length
>
0
)
setPosition
(
position
/
length
);
public
void
seek
(
long
position
,
double
length
)
{
if
(
length
>
0
.0
D
)
setPosition
((
float
)
(
position
/
length
)
)
;
else
setTime
(
position
);
}
@MainThread
public
void
saveTimeToSeek
(
long
time
)
{
mSavedTime
=
time
;
}
@MainThread
public
void
setPosition
(
float
pos
)
{
if
(
mSeekable
)
...
...
vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
View file @
267671dc
...
...
@@ -2504,7 +2504,7 @@ public class VideoPlayerActivity extends AppCompatActivity implements IVLCVout.C
seek
(
position
,
mService
.
getLength
());
}
private
void
seek
(
long
position
,
f
lo
at
length
)
{
private
void
seek
(
long
position
,
lo
ng
length
)
{
mForcedTime
=
position
;
mLastTime
=
mService
.
getTime
();
mService
.
seek
(
position
,
length
);
...
...
@@ -2977,25 +2977,20 @@ public class VideoPlayerActivity extends AppCompatActivity implements IVLCVout.C
media
.
removeFlags
(
MediaWrapper
.
MEDIA_FORCE_AUDIO
);
media
.
addFlags
(
MediaWrapper
.
MEDIA_VIDEO
);
boolean
seek
=
true
;
if
(
savedTime
<=
0
&&
media
!=
null
&&
media
.
getTime
()
>
0
l
)
savedTime
=
media
.
getTime
();
if
(
savedTime
>
0L
&&
!
mService
.
isPlaying
())
mService
.
saveTimeToSeek
(
savedTime
);
// Handle playback
if
(!
hasMedia
)
mService
.
load
(
media
);
else
if
(!
mService
.
isPlaying
())
mService
.
playIndex
(
positionInPlaylist
);
else
{
seek
=
false
;
onPlaying
();
}
if
(
seek
)
{
// Set time
if
(
savedTime
<=
0
&&
media
!=
null
&&
media
.
getTime
()
>
0
l
)
savedTime
=
media
.
getTime
();
if
(
savedTime
>
0
)
seek
(
savedTime
);
}
// Get possible subtitles
getSubtitles
();
...
...
Geoffrey Métais
@Dekans
mentioned in commit
9fa68844
·
Jun 09, 2016
mentioned in commit
9fa68844
mentioned in commit 9fa688441c0a2b6237fbb243cecabaacc07a1b70
Toggle commit list
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