Implement method of reading chapters (with metadata) from loaded media#551
Open
danieloneill wants to merge 1 commit into
Open
Implement method of reading chapters (with metadata) from loaded media#551danieloneill wants to merge 1 commit into
danieloneill wants to merge 1 commit into
Conversation
valbok
reviewed
Jan 7, 2026
| if (d->ctx == nullptr) | ||
| return result; | ||
|
|
||
| for (int i = 0; i < d->ctx->nb_chapters; i++) { |
Owner
There was a problem hiding this comment.
looks nb_chapters is unsigned int, so better to use unsigned i
valbok
reviewed
Jan 7, 2026
| QObject::connect(&p, &QAVPlayer::mediaStatusChanged, [&](auto status) { | ||
| qDebug() << "mediaStatusChanged"<< status << p.state(); | ||
| if (status == QAVPlayer::LoadedMedia) { | ||
| auto chaps = p.chapters(); |
Owner
There was a problem hiding this comment.
Big thanks for contribution!
Just small question, do you have any media with chapters? can we generate and put to test data and make very simple test that it returns correct data?
Thanks
valbok
reviewed
Jan 7, 2026
| double videoFrameRate() const; | ||
|
|
||
| QMap<QString, QString> metadata() const; | ||
| QList<QVariantMap> chapters() const; |
Owner
There was a problem hiding this comment.
Btw, do you need to have QVariant there or could be just strings? How is it used? for info only or need to compare/cast?
Owner
|
Thanks for the contribution, but I am not able to merge this without passing https://github.com/valbok/QtAVPlayer/actions/runs/20768227211/job/59672648127?pr=551 also interesting if it is possible to find simple unittest. Thanks |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implemented simply as:
Also stores chapter metadata as QVariantMap under the "metadata" key. Timestamps converted to double.