MediaFile/MediaTrack: Use metadata to retrieve copyright

This commit is contained in:
Barrett17 2018-11-21 16:57:05 +01:00
parent c6a23a5827
commit 9b50ad1db8
2 changed files with 19 additions and 3 deletions

View File

@ -197,14 +197,25 @@ BMediaFile::GetMetaData(BMessage* _data) const
_data->MakeEmpty();
return fExtractor->GetMetaData(_data);
BMetaData* metaData = NULL;
if (fExtractor->GetMetaData(metaData) == B_OK) {
*_data = *metaData->Message();
return B_OK;
}
return B_ERROR;
}
const char*
BMediaFile::Copyright() const
{
return fExtractor->Copyright();
BMetaData data;
BString copyright;
if (fExtractor->GetMetaData(&data) == B_OK)
data.GetString(kCopyright, &copyright);
return copyright.String();
}

View File

@ -301,7 +301,12 @@ BMediaTrack::GetMetaData(BMessage* _data) const
_data->MakeEmpty();
return fExtractor->GetStreamMetaData(fStream, _data);
BMetaData data;
if (fExtractor->GetStreamMetaData(fStream, &data) != B_OK) {
*_data = *data.Message();
return B_OK;
}
return B_ERROR;
}