mirror of
https://github.com/zhongyang219/MusicPlayer2.git
synced 2026-10-26 02:59:31 +08:00
修正专辑封面详情中m4a格式专辑封面显示不正确的问题
This commit is contained in:
@@ -77,6 +77,7 @@ void CAudioTag::GetAudioTag(bool id3v2_first)
|
||||
|
||||
wstring CAudioTag::GetAlbumCover(int & image_type, wchar_t* file_name)
|
||||
{
|
||||
image_type = -1;
|
||||
string image_contents;
|
||||
if (m_type == AudioType::AU_FLAC)
|
||||
{
|
||||
@@ -99,7 +100,7 @@ wstring CAudioTag::GetAlbumCover(int & image_type, wchar_t* file_name)
|
||||
else
|
||||
{
|
||||
if (m_type == AU_MP4)
|
||||
image_contents = ForceGetAlbumCover();
|
||||
image_contents = ForceGetAlbumCover(image_type);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -746,7 +747,7 @@ string CAudioTag::FindID3V2AlbumCover(const string & tag_content, int & image_ty
|
||||
return string();
|
||||
}
|
||||
|
||||
string CAudioTag::ForceGetAlbumCover()
|
||||
string CAudioTag::ForceGetAlbumCover(int& image_type)
|
||||
{
|
||||
ifstream file{ m_file_path, std::ios::binary };
|
||||
size_t size;
|
||||
@@ -772,6 +773,7 @@ string CAudioTag::ForceGetAlbumCover()
|
||||
{
|
||||
size_t image_size = end_index - image_index + jpg_tail.size();
|
||||
image_contents = contents_buff.substr(image_index, image_size);
|
||||
image_type = 0;
|
||||
}
|
||||
}
|
||||
return image_contents;
|
||||
|
||||
@@ -79,6 +79,6 @@ private:
|
||||
static string FindID3V2AlbumCover(const string& tag_content, int& image_type);
|
||||
|
||||
//在不知道如何解析某种音频格式的专辑封面时强行查找专辑封面
|
||||
string ForceGetAlbumCover();
|
||||
string ForceGetAlbumCover(int& image_type);
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user