mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-28 16:01:20 +02:00
CMovieBrowser: try to reduce effort for vizualized scan
For comparings I added a benchmark with log output.
This commit is contained in:
@@ -2876,7 +2876,8 @@ bool CMovieBrowser::loadTsFileNamesFromDir(const std::string & dirname)
|
|||||||
CFileList flist;
|
CFileList flist;
|
||||||
if (readDir(dirname, &flist) == true)
|
if (readDir(dirname, &flist) == true)
|
||||||
{
|
{
|
||||||
for (size_t i = 0; i < flist.size(); i++)
|
size_t count = flist.size();
|
||||||
|
for (size_t i = 0; i < count; i++)
|
||||||
{
|
{
|
||||||
if (S_ISDIR(flist[i].Mode)) {
|
if (S_ISDIR(flist[i].Mode)) {
|
||||||
if (m_settings.ts_only || !CFileBrowser::checkBD(flist[i])) {
|
if (m_settings.ts_only || !CFileBrowser::checkBD(flist[i])) {
|
||||||
@@ -2887,7 +2888,8 @@ bool CMovieBrowser::loadTsFileNamesFromDir(const std::string & dirname)
|
|||||||
} else {
|
} else {
|
||||||
result |= addFile(flist[i], dirItNr);
|
result |= addFile(flist[i], dirItNr);
|
||||||
}
|
}
|
||||||
OnLocalProgress(i, flist.size(), dirname );
|
if (result)
|
||||||
|
OnLocalProgress(i, count, dirname );
|
||||||
}
|
}
|
||||||
//result = true;
|
//result = true;
|
||||||
}
|
}
|
||||||
@@ -3126,6 +3128,9 @@ void CMovieBrowser::loadMovies(bool doRefresh)
|
|||||||
{
|
{
|
||||||
TRACE("[mb] loadMovies: \n");
|
TRACE("[mb] loadMovies: \n");
|
||||||
|
|
||||||
|
struct timeval t1, t2;
|
||||||
|
gettimeofday(&t1, NULL);
|
||||||
|
|
||||||
CProgressWindow loadBox((show_mode == MB_SHOW_YT) ? LOCALE_MOVIEPLAYER_YTPLAYBACK : LOCALE_MOVIEBROWSER_SCAN_FOR_MOVIES, CCW_PERCENT 50, CCW_PERCENT 10, NULL, show_mode == MB_SHOW_YT ? &ytparser.OnProgress : &OnLocalProgress, &OnGlobalProgress);
|
CProgressWindow loadBox((show_mode == MB_SHOW_YT) ? LOCALE_MOVIEPLAYER_YTPLAYBACK : LOCALE_MOVIEBROWSER_SCAN_FOR_MOVIES, CCW_PERCENT 50, CCW_PERCENT 10, NULL, show_mode == MB_SHOW_YT ? &ytparser.OnProgress : &OnLocalProgress, &OnGlobalProgress);
|
||||||
loadBox.enableShadow();
|
loadBox.enableShadow();
|
||||||
loadBox.paint();
|
loadBox.paint();
|
||||||
@@ -3141,6 +3146,11 @@ void CMovieBrowser::loadMovies(bool doRefresh)
|
|||||||
}
|
}
|
||||||
m_file_info_stale = false;
|
m_file_info_stale = false;
|
||||||
|
|
||||||
|
gettimeofday(&t2, NULL);
|
||||||
|
uint64_t duration = ((t2.tv_sec * 1000000ULL + t2.tv_usec) - (t1.tv_sec * 1000000ULL + t1.tv_usec)) / 1000ULL;
|
||||||
|
if (duration)
|
||||||
|
fprintf(stderr, "\033[33m[CMovieBrowser] %s: %" PRIu64 " ms to scan movies \033[0m\n",__func__, duration);
|
||||||
|
|
||||||
loadBox.hide();
|
loadBox.hide();
|
||||||
|
|
||||||
if (doRefresh)
|
if (doRefresh)
|
||||||
|
Reference in New Issue
Block a user