mirror of
https://github.com/opencv/opencv.git
synced 2025-06-09 02:23:23 +08:00
Merge pull request #22395 from hzcyf:infinite_loop_fix
This commit is contained in:
commit
0702685e7e
@ -25,6 +25,7 @@
|
||||
#include "obsensor_stream_channel_msmf.hpp"
|
||||
|
||||
#include <shlwapi.h> // QISearch
|
||||
#include <Mferror.h>
|
||||
|
||||
#pragma warning(disable : 4503)
|
||||
#pragma comment(lib, "mfplat")
|
||||
@ -317,7 +318,11 @@ void MSMFStreamChannel::start(const StreamProfile& profile, FrameCallback frameC
|
||||
{
|
||||
for (uint32_t k = 0;; k++)
|
||||
{
|
||||
HR_FAILED_EXEC(streamReader_->GetNativeMediaType(index, k, &mediaType), { continue; })
|
||||
auto hr = streamReader_->GetNativeMediaType(index, k, &mediaType);
|
||||
if(hr == MF_E_INVALIDSTREAMNUMBER || hr == MF_E_NO_MORE_TYPES){
|
||||
break;
|
||||
}
|
||||
HR_FAILED_EXEC(hr, { continue; })
|
||||
GUID subtype;
|
||||
HR_FAILED_RETURN(mediaType->GetGUID(MF_MT_SUBTYPE, &subtype));
|
||||
HR_FAILED_RETURN(MFGetAttributeSize(mediaType.Get(), MF_MT_FRAME_SIZE, &width, &height));
|
||||
|
Loading…
Reference in New Issue
Block a user