Skip to content

Commit

Permalink
DirectShow: use FourCC as a codec name if unknown
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinPulec committed Nov 4, 2014
1 parent 6ffea77 commit 710312a
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/video_capture/DirectShowGrabber.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1227,6 +1227,13 @@ static const CHAR * GetSubtypeNameA(const GUID *pSubtype)
// would use the header file that picks the A or W version.
static const CHAR * GetSubtypeName(const GUID *pSubtype)
{
return GetSubtypeNameA(pSubtype);
thread_local char fourcc[5] = "";
// the type is unknown to us, so print FourCC
if (LocateSubtype(pSubtype) == sizeof BitCountMap / sizeof BitCountMap[0] - 1) {
memcpy(fourcc, &pSubtype->Data1, 4);
return fourcc;
} else {
return GetSubtypeNameA(pSubtype);
}
}

0 comments on commit 710312a

Please sign in to comment.