Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
VLC-Android
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
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
Ewout ter Hoeven
VLC-Android
Commits
ae6d2191
Commit
ae6d2191
authored
Jan 23, 2015
by
Thomas Guillem
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MediaWrapper: init: media can be null
parent
5bc46ca2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
16 deletions
+18
-16
vlc-android/src/org/videolan/vlc/MediaWrapper.java
vlc-android/src/org/videolan/vlc/MediaWrapper.java
+18
-16
No files found.
vlc-android/src/org/videolan/vlc/MediaWrapper.java
View file @
ae6d2191
...
...
@@ -104,26 +104,29 @@ public class MediaWrapper implements Parcelable {
}
private
void
init
(
Media
media
)
{
mLength
=
media
.
getDuration
();
mType
=
TYPE_ALL
;
if
(
media
.
isParsed
())
{
for
(
int
i
=
0
;
i
<
media
.
getTrackCount
();
++
i
)
{
final
Media
.
Track
track
=
media
.
getTrack
(
i
);
if
(
track
==
null
)
continue
;
if
(
track
.
type
==
Media
.
Track
.
Type
.
Video
)
{
final
Media
.
VideoTrack
videoTrack
=
(
VideoTrack
)
track
;
mType
=
TYPE_VIDEO
;
mWidth
=
videoTrack
.
width
;
mHeight
=
videoTrack
.
height
;
}
else
if
(
mType
==
TYPE_ALL
&&
track
.
type
==
Media
.
Track
.
Type
.
Audio
){
mType
=
TYPE_AUDIO
;
if
(
media
!=
null
)
{
if
(
media
.
isParsed
())
{
mLength
=
media
.
getDuration
();
for
(
int
i
=
0
;
i
<
media
.
getTrackCount
();
++
i
)
{
final
Media
.
Track
track
=
media
.
getTrack
(
i
);
if
(
track
==
null
)
continue
;
if
(
track
.
type
==
Media
.
Track
.
Type
.
Video
)
{
final
Media
.
VideoTrack
videoTrack
=
(
VideoTrack
)
track
;
mType
=
TYPE_VIDEO
;
mWidth
=
videoTrack
.
width
;
mHeight
=
videoTrack
.
height
;
}
else
if
(
mType
==
TYPE_ALL
&&
track
.
type
==
Media
.
Track
.
Type
.
Audio
){
mType
=
TYPE_AUDIO
;
}
}
}
updateMeta
(
media
);
}
if
(
mType
==
TYPE_ALL
)
{
int
dotIndex
=
mLocation
.
lastIndexOf
(
"."
);
if
(
dotIndex
!=
-
1
)
{
...
...
@@ -142,7 +145,6 @@ public class MediaWrapper implements Parcelable {
mType
=
TYPE_DIR
;
}
}
updateMeta
(
media
);
}
private
void
init
(
long
time
,
long
length
,
int
type
,
...
...
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