From 531a6ceb5ddf494ddfc97b375171e84cb38ecbe6 Mon Sep 17 00:00:00 2001 From: Jacek Caban Date: Tue, 8 Apr 2014 14:25:52 +0200 Subject: [PATCH] qcap: Store max frame size separately from video format bitmap info and restore it before each ICCompress call. --- dlls/qcap/avico.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/dlls/qcap/avico.c b/dlls/qcap/avico.c index caef1832891..0287271fbc8 100644 --- a/dlls/qcap/avico.c +++ b/dlls/qcap/avico.c @@ -45,6 +45,7 @@ typedef struct { VIDEOINFOHEADER *videoinfo; size_t videoinfo_size; DWORD driver_flags; + DWORD max_frame_size; DWORD frame_cnt; } AVICompressor; @@ -111,6 +112,7 @@ static HRESULT fill_format_info(AVICompressor *This, VIDEOINFOHEADER *src_videoi This->videoinfo->dwBitRate = 10000000/src_videoinfo->AvgTimePerFrame * This->videoinfo->bmiHeader.biSizeImage * 8; This->videoinfo->AvgTimePerFrame = src_videoinfo->AvgTimePerFrame; + This->max_frame_size = This->videoinfo->bmiHeader.biSizeImage; return S_OK; } @@ -547,6 +549,7 @@ static HRESULT WINAPI AVICompressorIn_Receive(BaseInputPin *base, IMediaSample * FIXME("Unsupported temporal compression\n"); src_videoinfo = (VIDEOINFOHEADER*)This->in->pin.mtCurrent.pbFormat; + This->videoinfo->bmiHeader.biSizeImage = This->max_frame_size; res = ICCompress(This->hic, sync_point ? ICCOMPRESS_KEYFRAME : 0, &This->videoinfo->bmiHeader, buf, &src_videoinfo->bmiHeader, ptr, 0, &comp_flags, This->frame_cnt, 0, 0, NULL, NULL); if(res != ICERR_OK) { @@ -658,8 +661,8 @@ static HRESULT WINAPI AVICompressorOut_DecideBufferSize(BaseOutputPin *base, IMe if (!ppropInputRequest->cBuffers) ppropInputRequest->cBuffers = 1; - if (ppropInputRequest->cbBuffer < This->videoinfo->bmiHeader.biSizeImage) - ppropInputRequest->cbBuffer = This->videoinfo->bmiHeader.biSizeImage; + if (ppropInputRequest->cbBuffer < This->max_frame_size) + ppropInputRequest->cbBuffer = This->max_frame_size; if (!ppropInputRequest->cbAlign) ppropInputRequest->cbAlign = 1;