summaryrefslogtreecommitdiffstatshomepage
path: root/src/lib
diff options
context:
space:
mode:
author Aaron Giles <aaron@aarongiles.com>2008-08-01 02:23:26 +0000
committer Aaron Giles <aaron@aarongiles.com>2008-08-01 02:23:26 +0000
commit776b251aa23217f866ea1f592abe5ed2c7550df1 (patch)
treee952bd3ebc1a310a5fa86300c607c8b481337a4c /src/lib
parentc43a103858359c60a71aad43fd901ed47c5f1162 (diff)
Removed per-frame metadata support from chdman. Creating an A/V
now simply requires an AVI file input. Relaxed VBI Manchester code clocking to allow for a little bit of wiggle when finding the clock. Changed laserdisc support to parse white flags and other data from the VBI data directly, rather than relying on the textual metadata. Expanded video frame cache to 3. Changed the way frames are assembled to decrease the likelihood of getting an interlaced weave. Fixed sound creation so that it is done at reset time instead of device start, when the sound devices aren't yet live. Fixed bug in winwork that caused the creation of single work items to return NULL, and thus lead to massive memory leaks when using A/V CHDs.
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/util/chd.c6
-rw-r--r--src/lib/util/chd.h2
-rw-r--r--src/lib/util/vbiparse.c10
3 files changed, 13 insertions, 5 deletions
diff --git a/src/lib/util/chd.c b/src/lib/util/chd.c
index d9083fc73e1..e8fda05e2ad 100644
--- a/src/lib/util/chd.c
+++ b/src/lib/util/chd.c
@@ -2827,7 +2827,7 @@ static chd_error av_codec_config(chd_file *chd, int param, void *config)
static chd_error av_codec_postinit(chd_file *chd)
{
- int fps, fpsfrac, width, height, interlaced, channels, rate, metabytes;
+ int fps, fpsfrac, width, height, interlaced, channels, rate;
UINT32 fps_times_1million, max_samples_per_frame, bytes_per_frame;
av_codec_data *data = chd->codecdata;
char metadata[256];
@@ -2843,13 +2843,13 @@ static chd_error av_codec_postinit(chd_file *chd)
return err;
/* extract the info */
- if (sscanf(metadata, AV_METADATA_FORMAT, &fps, &fpsfrac, &width, &height, &interlaced, &channels, &rate, &metabytes) != 8)
+ if (sscanf(metadata, AV_METADATA_FORMAT, &fps, &fpsfrac, &width, &height, &interlaced, &channels, &rate) != 7)
return CHDERR_INVALID_METADATA;
/* compute the bytes per frame */
fps_times_1million = fps * 1000000 + fpsfrac;
max_samples_per_frame = ((UINT64)rate * 1000000 + fps_times_1million - 1) / fps_times_1million;
- bytes_per_frame = 12 + metabytes + channels * max_samples_per_frame * 2 + width * height * 2;
+ bytes_per_frame = 12 + channels * max_samples_per_frame * 2 + width * height * 2;
if (bytes_per_frame > chd->header.hunkbytes)
return CHDERR_INVALID_METADATA;
diff --git a/src/lib/util/chd.h b/src/lib/util/chd.h
index f6aef5d8da3..0e3af6f94f5 100644
--- a/src/lib/util/chd.h
+++ b/src/lib/util/chd.h
@@ -126,7 +126,7 @@
/* standard A/V metadata */
#define AV_METADATA_TAG 0x41564156 /* 'AVAV' */
-#define AV_METADATA_FORMAT "FPS:%d.%06d WIDTH:%d HEIGHT:%d INTERLACED:%d CHANNELS:%d SAMPLERATE:%d META:%d"
+#define AV_METADATA_FORMAT "FPS:%d.%06d WIDTH:%d HEIGHT:%d INTERLACED:%d CHANNELS:%d SAMPLERATE:%d"
/* CHD open values */
#define CHD_OPEN_READ 1
diff --git a/src/lib/util/vbiparse.c b/src/lib/util/vbiparse.c
index b11941cb71f..0c3b7847e85 100644
--- a/src/lib/util/vbiparse.c
+++ b/src/lib/util/vbiparse.c
@@ -101,7 +101,15 @@ int vbi_parse_manchester_code(const UINT16 *source, int sourcewidth, int sources
if (srcabs[curbit + 1 + 0] != srcabs[curbit + 1 + 1] || srcabs[curbit - 1 + 0] != srcabs[curbit - 1 + 1])
{
/* only continue if we're still in the running */
- if (++error < besterr)
+ if ((error += 1) < besterr)
+ continue;
+ }
+
+ /* off-by-two? */
+ if (srcabs[curbit + 2 + 0] != srcabs[curbit + 2 + 1] || srcabs[curbit - 2 + 0] != srcabs[curbit - 2 + 1])
+ {
+ /* only continue if we're still in the running */
+ if ((error += 2) < besterr)
continue;
}