Optimize QMediaPlaylistPrivate::readItems()
When reading playlist items from a file, pass them to the playlist backend all at once rather than one by one. This might be faster depending on the implementation. Task-number: QTBUG-54849 Change-Id: I57acdc68604ee56fe5d7615ba0a72655e668443f Reviewed-by: Christian Stromme <christian.stromme@qt.io>
This commit is contained in:
@@ -428,10 +428,12 @@ bool QMediaPlaylist::clear()
|
||||
|
||||
bool QMediaPlaylistPrivate::readItems(QMediaPlaylistReader *reader)
|
||||
{
|
||||
while (!reader->atEnd())
|
||||
playlist()->addMedia(reader->readItem());
|
||||
QList<QMediaContent> items;
|
||||
|
||||
return true;
|
||||
while (!reader->atEnd())
|
||||
items.append(reader->readItem());
|
||||
|
||||
return playlist()->addMedia(items);
|
||||
}
|
||||
|
||||
bool QMediaPlaylistPrivate::writeItems(QMediaPlaylistWriter *writer)
|
||||
|
||||
Reference in New Issue
Block a user