Skip to content

Commit

Permalink
По возможности используем размеры видео-потока из AMF метаданных.
Browse files Browse the repository at this point in the history
  • Loading branch information
Aleksoid1978 committed May 11, 2024
1 parent b6dae80 commit 9039d58
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/filters/parser/FLVSplitter/FLVSplitter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -834,6 +834,11 @@ HRESULT CFLVSplitterFilter::CreateOutputs(IAsyncReader* pAsyncReader)
break;
}

if (vWidth && vHeight) {
vih->bmiHeader.biWidth = vWidth;
vih->bmiHeader.biHeight = vHeight;
}

if (!vih->bmiHeader.biWidth || !vih->bmiHeader.biHeight) {
break;
}
Expand All @@ -848,6 +853,11 @@ HRESULT CFLVSplitterFilter::CreateOutputs(IAsyncReader* pAsyncReader)
m_pFile->BitRead(4);
vih->bmiHeader.biHeight = (LONG)m_pFile->BitRead(12);

if (vWidth && vHeight) {
vih->bmiHeader.biWidth = vWidth;
vih->bmiHeader.biHeight = vHeight;
}

if (!vih->bmiHeader.biWidth || !vih->bmiHeader.biHeight) {
break;
}
Expand Down Expand Up @@ -906,6 +916,11 @@ HRESULT CFLVSplitterFilter::CreateOutputs(IAsyncReader* pAsyncReader)

bih->biWidth = w;
bih->biHeight = h;

if (vWidth && vHeight) {
bih->biWidth = vWidth;
bih->biHeight = vHeight;
}
#ifndef NOVIDEOTWEAK
SetRect(&vih->rcSource, 0, 0, w - fudge.x, h - fudge.y);
SetRect(&vih->rcTarget, 0, 0, w - fudge.x, h - fudge.y);
Expand Down Expand Up @@ -1032,6 +1047,11 @@ HRESULT CFLVSplitterFilter::CreateOutputs(IAsyncReader* pAsyncReader)
vih->hdr.dwPictAspectRatioY = aspect.cy;
vih->hdr.AvgTimePerFrame = AvgTimePerFrame;

if (vWidth && vHeight) {
vih->hdr.bmiHeader.biWidth = vWidth;
vih->hdr.bmiHeader.biHeight = vHeight;
}

HEVCParser::CreateSequenceHeaderAVC(headerData, headerSize, vih->dwSequenceHeader, vih->cbSequenceHeader);

delete [] headerData;
Expand Down

0 comments on commit 9039d58

Please sign in to comment.