summaryrefslogtreecommitdiffstatshomepage
path: root/src/tools/ldresample.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/tools/ldresample.c')
-rw-r--r--src/tools/ldresample.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/tools/ldresample.c b/src/tools/ldresample.c
index f1718e7297d..26266f064ae 100644
--- a/src/tools/ldresample.c
+++ b/src/tools/ldresample.c
@@ -55,8 +55,8 @@ struct movie_info
int channels;
int interlaced;
bitmap_yuy16 bitmap;
- dynamic_array<INT16> lsound;
- dynamic_array<INT16> rsound;
+ std::vector<INT16> lsound;
+ std::vector<INT16> rsound;
UINT32 samples;
};
@@ -239,10 +239,10 @@ static bool read_chd(chd_file &file, UINT32 field, movie_info &info, UINT32 soun
// configure the codec
avhuff_decompress_config avconfig;
avconfig.video.wrap(info.bitmap, info.bitmap.cliprect());
- avconfig.maxsamples = info.lsound.count();
+ avconfig.maxsamples = info.lsound.size();
avconfig.actsamples = &info.samples;
- avconfig.audio[0] = info.lsound + soundoffs;
- avconfig.audio[1] = info.rsound + soundoffs;
+ avconfig.audio[0] = &info.lsound[soundoffs];
+ avconfig.audio[1] = &info.rsound[soundoffs];
// configure the decompressor for this field
file.codec_configure(CHD_CODEC_AVHUFF, AVHUFF_CODEC_DECOMPRESS_CONFIG, &avconfig);
@@ -267,8 +267,8 @@ static bool read_chd(chd_file &file, UINT32 field, movie_info &info, UINT32 soun
static bool find_edge_near_field(chd_file &srcfile, UINT32 fieldnum, movie_info &info, bool report_best_field, INT32 &delta)
{
// clear the sound buffers
- memset(info.lsound, 0, info.lsound.count() * 2);
- memset(info.rsound, 0, info.rsound.count() * 2);
+ memset(&info.lsound[0], 0, info.lsound.size() * 2);
+ memset(&info.rsound[0], 0, info.rsound.size() * 2);
// read 1 second around the target area
int fields_to_read = info.iframerate / 1000000;
@@ -473,11 +473,11 @@ printf("%5d: start=%10d (%5d.%03d) end=%10d (%5d.%03d)\n",
// assemble the final frame
dynamic_buffer buffer;
- INT16 *sampledata[2] = { m_info.lsound, m_info.rsound };
+ INT16 *sampledata[2] = { &m_info.lsound[0], &m_info.rsound[0] };
avhuff_encoder::assemble_data(buffer, m_info.bitmap, m_info.channels, m_info.samples, sampledata);
- memcpy(dest, buffer, MIN(buffer.count(), datasize));
- if (buffer.count() < datasize)
- memset(&dest[buffer.count()], 0, datasize - buffer.count());
+ memcpy(dest, &buffer[0], MIN(buffer.size(), datasize));
+ if (buffer.size() < datasize)
+ memset(&dest[buffer.size()], 0, datasize - buffer.size());
}