Skip to content

Commit

Permalink
media file M4B should matches too
Browse files Browse the repository at this point in the history
  • Loading branch information
janbar committed Dec 14, 2019
1 parent f7edf18 commit e4107dd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion noson/src/filepicreader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ StreamReader::STREAM * FilePicReader::OpenStream(const std::string& streamUrl)
return stream;
}
}
if (suffix.compare("m4a") == 0)
if (suffix.compare("m4a") == 0 || suffix.compare("m4b") == 0)
{
Picture * picture = ExtractMP4Picture(filePath, picType, error);
if (picture)
Expand Down
4 changes: 3 additions & 1 deletion noson/src/filestreamer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ FileStreamer::codec_type FileStreamer::codecTypeTab[] = {
{ "mpeg4aac" , "aac" , "audio/aac" },
{ "vorbis" , "ogg" , "application/ogg" },
{ "mp4a" , "m4a" , "audio/mp4" },
{ "mp4b" , "m4b" , "audio/mp4" },
};

int FileStreamer::codecTypeTabSize = sizeof(FileStreamer::codecTypeTab) / sizeof(FileStreamer::codec_type);
Expand Down Expand Up @@ -330,7 +331,8 @@ bool FileStreamer::probeMP4A(const std::string& filePath)
if (file)
{
char buf[12];
if (fread(buf, 1, 12, file) == 12 && memcmp(buf + 4, "ftypM4A ", 8) == 0)
if (fread(buf, 1, 12, file) == 12 &&
(memcmp(buf + 4, "ftypM4A ", 8) == 0 || memcmp(buf + 4, "ftypM4B ", 8) == 0))
ret = true;
fclose(file);
}
Expand Down

0 comments on commit e4107dd

Please sign in to comment.