Why use a individual ArrayList<Media> mItemList?

VLC for Android and Chrome OS specific usage questions
dfdf
Blank Cone
Blank Cone
Posts: 39
Joined: 22 Dec 2013 23:54

Why use a individual ArrayList<Media> mItemList?

Postby dfdf » 23 Dec 2013 02:13

Why use a individual ArrayList<Media> mItemList(mItemList @ MediaLibrary.java) rather than using Database cursor directly?Listing medias is a long time at startup,maybe fulling this mItemList is the prime criminal? Not need to mention the rather big memory usage. But I guess there must be some strong reasons.

Jean-Baptiste Kempf
Site Administrator
Site Administrator
Posts: 37519
Joined: 22 Jul 2005 15:29
VLC version: 4.0.0-git
Operating System: Linux, Windows, Mac
Location: Cone, France
Contact:

Re: Why use a individual ArrayList<Media> mItemList?

Postby Jean-Baptiste Kempf » 23 Dec 2013 19:41

Probably because it was faster to code. And you probably need preparsing....

But if you can do the same faster, patches are welcome.
Jean-Baptiste Kempf
http://www.jbkempf.com/ - http://www.jbkempf.com/blog/category/Videolan
VLC media player developer, VideoLAN President and Sites administrator
If you want an answer to your question, just be specific and precise. Don't use Private Messages.

edwardw
Big Cone-huna
Big Cone-huna
Posts: 2346
Joined: 24 Jun 2012 23:36
VLC version: 3.0.0-git

Re: Why use a individual ArrayList<Media> mItemList?

Postby edwardw » 23 Dec 2013 19:45

Not to mention the absurd state of cursors, databases, and crashes related to those...

dfdf
Blank Cone
Blank Cone
Posts: 39
Joined: 22 Dec 2013 23:54

Re: Why use a individual ArrayList<Media> mItemList?

Postby dfdf » 24 Dec 2013 03:37

Not to mention the absurd state of cursors, databases, and crashes related to those...
OK,relax,just out of curiosity.
I'm afraid I can't do any patches,I just feel the media listing Activity is a bit slow. Well,it's not a problem,forget it please.

XilasZ
Developer
Developer
Posts: 189
Joined: 16 Jun 2009 20:35

Re: Why use a individual ArrayList<Media> mItemList?

Postby XilasZ » 08 Jan 2014 13:43

At startup, vlc browse folders recursively to find new files to add to the database, or remove deleted ones.
This scan can take some times depending on how many folders/files you have on the device.

One way to speed this up, is to go in preferences, and only select music & video folders, to avoid wasting time scanning system folders, pictures folders, ...

dfdf
Blank Cone
Blank Cone
Posts: 39
Joined: 22 Dec 2013 23:54

Re: Why use a individual ArrayList<Media> mItemList?

Postby dfdf » 09 Jan 2014 16:23

At startup, vlc browse folders recursively to find new files to add to the database, or remove deleted ones.
This scan can take some times depending on how many folders/files you have on the device.

One way to speed this up, is to go in preferences, and only select music & video folders, to avoid wasting time scanning system folders, pictures folders, ...
Good point,thank you!


Return to “VLC for Android and Chrome OS”

Who is online

Users browsing this forum: No registered users and 11 guests