Bug fix for AVI audio when video compressor gives null frames.

This commit is contained in:
mjbudd77 2021-10-01 07:00:10 -04:00
parent b06b7a98c6
commit 52194fdf3d
2 changed files with 7 additions and 4 deletions

View File

@ -2557,7 +2557,7 @@ void AviRecordDiskThread_t::run(void)
{
convertRgb_32_to_24( (const unsigned char*)videoOut, rgb24,
width, height, numPixels, true );
writeAudio = VFW::encode_frame( rgb24, width, height ) > 0;
VFW::encode_frame( rgb24, width, height );
}
#endif
#ifdef _USE_LIBAV

View File

@ -374,9 +374,12 @@ gwavi_t::add_frame( unsigned char *buffer, size_t len, unsigned int flags)
return -1;
}
if ((t = fwrite(buffer, 1, len, out)) != len) {
(void)fprintf(stderr, "gwavi_add_frame: fwrite() failed\n");
return -1;
if ( len > 0 )
{
if ((t = fwrite(buffer, 1, len, out)) != len) {
(void)fprintf(stderr, "gwavi_add_frame: fwrite() failed\n");
return -1;
}
}
for (t = 0; t < maxi_pad; t++)