Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
VLC-Android
Manage
Activity
Members
Labels
Plan
Issues
528
Issue boards
Milestones
Wiki
Code
Merge requests
14
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
VideoLAN
VLC-Android
Commits
c4eb6826
Commit
c4eb6826
authored
6 years ago
by
Geoffrey Métais
Browse files
Options
Downloads
Patches
Plain Diff
Fix stream media type lost
parent
8a8505d5
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
vlc-android/src/org/videolan/vlc/media/MediaWrapperList.java
+4
-1
4 additions, 1 deletion
vlc-android/src/org/videolan/vlc/media/MediaWrapperList.java
vlc-android/src/org/videolan/vlc/media/PlaylistManager.kt
+13
-4
13 additions, 4 deletions
vlc-android/src/org/videolan/vlc/media/PlaylistManager.kt
with
17 additions
and
5 deletions
vlc-android/src/org/videolan/vlc/media/MediaWrapperList.java
+
4
−
1
View file @
c4eb6826
...
...
@@ -179,7 +179,10 @@ public class MediaWrapperList {
final
MediaWrapper
media
=
iter
.
next
();
if
(
media
.
getId
()
==
0L
)
{
final
MediaWrapper
mw
=
ml
.
findMedia
(
media
);
if
(
mw
.
getId
()
!=
0
)
iter
.
set
(
mw
);
if
(
mw
.
getId
()
!=
0
)
{
if
(
mw
.
getType
()
==
MediaWrapper
.
TYPE_ALL
)
mw
.
setType
(
media
.
getType
());
iter
.
set
(
mw
);
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
vlc-android/src/org/videolan/vlc/media/PlaylistManager.kt
+
13
−
4
View file @
c4eb6826
...
...
@@ -300,7 +300,7 @@ class PlaylistManager(val service: PlaybackService) : MediaWrapperList.EventList
if
(
internalMedia
!=
null
&&
internalMedia
.
id
!=
0L
)
id
=
internalMedia
.
id
else
{
internalMedia
=
medialibrary
.
addMedia
(
Uri
.
decode
(
mw
.
uri
.
toString
()))
internalMedia
=
if
(
mw
.
type
==
MediaWrapper
.
TYPE_STREAM
)
medialibrary
.
addStream
(
Uri
.
decode
(
mw
.
uri
.
toString
()),
mw
.
title
)
else
medialibrary
.
addMedia
(
Uri
.
decode
(
mw
.
uri
.
toString
()))
if
(
internalMedia
!=
null
)
id
=
internalMedia
.
id
}
...
...
@@ -536,6 +536,7 @@ class PlaylistManager(val service: PlaybackService) : MediaWrapperList.EventList
@MainThread
private
suspend
fun
expand
(
updateHistory
:
Boolean
):
Int
{
val
index
=
currentIndex
val
stream
=
getCurrentMedia
()
?.
type
==
MediaWrapper
.
TYPE_STREAM
val
ml
=
player
.
expand
()
var
ret
=
-
1
...
...
@@ -548,7 +549,12 @@ class PlaylistManager(val service: PlaybackService) : MediaWrapperList.EventList
mediaList
.
insert
(
index
,
MediaWrapper
(
child
))
child
.
release
()
}
if
(
mrl
!==
null
&&
ml
.
count
==
1
)
medialibrary
.
addToHistory
(
mrl
,
getCurrentMedia
()
!!
.
title
)
if
(
mrl
!==
null
&&
ml
.
count
==
1
)
{
if
(
stream
)
{
getCurrentMedia
()
!!
.
type
=
MediaWrapper
.
TYPE_STREAM
medialibrary
.
addStream
(
mrl
,
getCurrentMedia
()
!!
.
title
)
}
else
medialibrary
.
addToHistory
(
mrl
,
getCurrentMedia
()
!!
.
title
)
}
ret
=
index
}
ml
?.
release
()
...
...
@@ -662,7 +668,10 @@ class PlaylistManager(val service: PlaybackService) : MediaWrapperList.EventList
MediaPlayer
.
Event
.
Playing
->
{
medialibrary
.
pauseBackgroundOperations
()
videoBackground
=
false
val
mw
=
withContext
(
VLCIO
)
{
medialibrary
.
findMedia
(
getCurrentMedia
())
}
val
mw
=
withContext
(
VLCIO
)
{
val
current
=
getCurrentMedia
()
medialibrary
.
findMedia
(
current
).
apply
{
if
(
type
==
-
1
)
type
=
current
?.
type
?:
-
1
}
}
if
(
newMedia
)
{
loadMediaMeta
(
mw
)
if
(
mw
.
type
==
MediaWrapper
.
TYPE_STREAM
)
medialibrary
.
addToHistory
(
mw
.
location
,
mw
.
title
)
...
...
@@ -689,7 +698,7 @@ class PlaylistManager(val service: PlaybackService) : MediaWrapperList.EventList
MediaPlayer
.
Event
.
EncounteredError
->
{
service
.
showToast
(
service
.
getString
(
R
.
string
.
invalid_location
,
getCurrentMedia
()
?.
getL
ocation
()
?:
""
),
Toast
.
LENGTH_SHORT
)
getCurrentMedia
()
?.
l
ocation
?:
""
),
Toast
.
LENGTH_SHORT
)
if
(
currentIndex
!=
nextIndex
)
next
()
else
stop
()
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment