1
0
Fork 0
mirror of synced 2025-03-07 03:53:26 +01:00

mfreadwrite/reader: Adjust min_buffer_size to be 1s of audio data.

This commit is contained in:
Rémi Bernon 2024-01-29 18:19:11 +01:00 committed by Alexandre Julliard
parent 7865026f53
commit bf800b5e76

View file

@ -1912,9 +1912,14 @@ static HRESULT source_reader_create_transform(struct source_reader *reader, BOOL
list_init(&entry->entry);
entry->category = category;
if (IsEqualGUID(&out_type.guidMajorType, &MFMediaType_Audio))
IMFMediaType_GetUINT32(output_type, &MF_MT_AUDIO_BLOCK_ALIGNMENT,
&entry->min_buffer_size);
if (IsEqualGUID(&out_type.guidMajorType, &MFMediaType_Audio)
&& SUCCEEDED(IMFMediaType_GetUINT32(output_type, &MF_MT_AUDIO_BLOCK_ALIGNMENT, &entry->min_buffer_size)))
{
UINT32 bytes_per_second;
if (SUCCEEDED(IMFMediaType_GetUINT32(output_type, &MF_MT_AUDIO_AVG_BYTES_PER_SECOND, &bytes_per_second)))
entry->min_buffer_size = max(entry->min_buffer_size, bytes_per_second);
}
count = 0;
if (SUCCEEDED(hr = MFTEnum(category, 0, &in_type, allow_processor ? NULL : &out_type, NULL, &classes, &count)))