Skip to content

Commit

Permalink
[muxerAvi] Set biCompression and fccHandler for uncompressed bitmaps …
Browse files Browse the repository at this point in the history
…(DIB) to zero
  • Loading branch information
eumagga0x2a committed Jan 25, 2019
1 parent 1845b45 commit 34975bf
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions avidemux_plugins/ADM_muxers/muxerAvi/avi_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,17 @@ uint32_t ADM_UsecFromFps1000(uint32_t fps1000);
*/
void mx_bihFromVideo(ADM_BITMAPINFOHEADER *bih,ADM_videoStream *video)
{
uint32_t fcc=video->getFCC();
if(fcc==fourCC::get((uint8_t *)"DIB "))
fcc=0;
memset(bih,0,sizeof(*bih));
//
bih->biSize=sizeof(ADM_BITMAPINFOHEADER); //uint32_t biSize;
bih->biWidth=video->getWidth(); //uint32_t biWidth;
bih->biHeight=video->getHeight(); //uint32_t biHeight;
bih->biPlanes=1; // uint16_t biPlanes;
bih->biBitCount=24; //
bih->biCompression=video->getFCC(); // uint32_t biCompression;
bih->biCompression=fcc; // uint32_t biCompression;
bih->biSizeImage=(bih->biWidth*bih->biHeight*3)>>1;// uint32_t biSizeImage;
bih->biXPelsPerMeter=0;
bih->biYPelsPerMeter=0;
Expand Down Expand Up @@ -82,9 +85,12 @@ void mx_mainHeaderFromVideoStream(MainAVIHeader *header,ADM_videoStream *video)
*/
void mx_streamHeaderFromVideo(AVIStreamHeader *header,ADM_videoStream *video)
{
uint32_t fcc=video->getFCC();
if(fcc==fourCC::get((uint8_t *)"DIB "))
fcc=0;
memset(header,0,sizeof(*header));
header->fccType=fourCC::get((uint8_t *)"vids"); //uint32_t fccType;
header->fccHandler=video->getFCC(); //uint32_t fccHandler;
header->fccHandler=fcc; // uint32_t fccHandler;
header->dwFlags=0; //int32_t dwFlags; /* Contains AVITF_* flags */
header->wPriority=0; //int16_t wPriority; /* dwPriority - splited for audio */
header->wLanguage=0; //int16_t wLanguage;
Expand All @@ -100,4 +106,4 @@ void mx_mainHeaderFromVideoStream(MainAVIHeader *header,ADM_videoStream *video)
header->rcFrame.bottom=video->getHeight();// int32_t dwSampleSize;
}

// EOF
// EOF

0 comments on commit 34975bf

Please sign in to comment.