Skip to content

Commit

Permalink
WavePlayer now less picky with fileformats
Browse files Browse the repository at this point in the history
  • Loading branch information
joreg committed Apr 24, 2012
1 parent 16d3790 commit 77ed859
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
Binary file modified vvvv45/lib/nodes/directshowfilter/WavePlayer.ax
Binary file not shown.
17 changes: 8 additions & 9 deletions vvvv45/src/nodes/directshowfilter/WavePlayer/Main.pas
Expand Up @@ -1521,9 +1521,8 @@ function TMVoice.ReadTheFile(AFileName: String): Boolean;
OutputDebugString('waveplayer error 5');
MMIOClose(hmm, 0);
Exit;
end;

if mmiSub.cksize = sizeof(PCMWAVEFORMAT) then
end
else if mmiSub.cksize = sizeof(PCMWAVEFORMAT) then
begin
mmioRead(hmm, @FFWaveFormat, sizeof(PCMWAVEFORMAT));

Expand All @@ -1533,20 +1532,20 @@ function TMVoice.ReadTheFile(AFileName: String): Boolean;
MMIOClose(hmm, 0);
Exit;
end;
end;

if mmiSub.cksize > sizeof(PCMWAVEFORMAT) then
end
else
begin

mmioRead(hmm, @FFWaveFormat, sizeof(WAVEFORMATEXTENSIBLE));

if FFWaveFormat.Format.wFormatTag <> WAVE_FORMAT_EXTENSIBLE then
//seems even if cksize > sizeof(PCMWAVEFORMAT)
//wFormatTag may still be WAVE_FORMAT_PCM for some files
if (FFWaveFormat.Format.wFormatTag <> WAVE_FORMAT_EXTENSIBLE)
and (FFWaveFormat.Format.wFormatTag <> WAVE_FORMAT_PCM) then
begin
OutputDebugString('WavePlayer: unknown format');
MMIOClose(hmm, 0);
Exit;
end;

end;

mmres := mmioAscend(hmm, @mmiSub, 0);
Expand Down

0 comments on commit 77ed859

Please sign in to comment.