02442: -aviwrite produces faulty files

This commit is contained in:
Aaron Giles 2008-09-27 22:48:52 +00:00
parent 2a3301d0b9
commit 6c05b835a2
2 changed files with 10 additions and 10 deletions

View File

@ -2539,8 +2539,8 @@ void video_avi_begin_recording(running_machine *machine, const char *name)
info.video_depth = 24;
info.audio_format = 0;
info.audio_timescale = 1;
info.audio_sampletime = machine->sample_rate;
info.audio_timescale = machine->sample_rate;
info.audio_sampletime = 1;
info.audio_numsamples = 0;
info.audio_channels = 2;
info.audio_samplebits = 16;

View File

@ -643,14 +643,6 @@ avi_error avi_close(avi_file *file)
if (avierr == AVIERR_NONE && file->riffbase == 0)
avierr = write_idx1_chunk(file);
/* close the RIFF chunk */
if (avierr == AVIERR_NONE)
avierr = chunk_close(file);
/* update the avih chunk */
if (avierr == AVIERR_NONE)
avierr = write_avih_chunk(file, FALSE);
/* update the strh and indx chunks for each stream */
for (strnum = 0; strnum < file->streams; strnum++)
{
@ -659,6 +651,14 @@ avi_error avi_close(avi_file *file)
if (avierr == AVIERR_NONE)
avierr = write_indx_chunk(file, &file->stream[strnum], FALSE);
}
/* update the avih chunk */
if (avierr == AVIERR_NONE)
avierr = write_avih_chunk(file, FALSE);
/* close the RIFF chunk */
if (avierr == AVIERR_NONE)
avierr = chunk_close(file);
}
/* close the file */