[trak] Handle nSizes=0 and 1
This commit is contained in:
parent
451f3de521
commit
3d7dea6dfd
|
@ -93,7 +93,9 @@ struct TrackData
|
||||||
Fixed fixed_size;
|
Fixed fixed_size;
|
||||||
fixed_size.set_float (csspx);
|
fixed_size.set_float (csspx);
|
||||||
|
|
||||||
/* XXX Clean this up. Make it work with nSizes==1 and 0. */
|
/*
|
||||||
|
* Choose track.
|
||||||
|
*/
|
||||||
|
|
||||||
const TrackTableEntry *trackTableEntry = nullptr;
|
const TrackTableEntry *trackTableEntry = nullptr;
|
||||||
unsigned int count = nTracks;
|
unsigned int count = nTracks;
|
||||||
|
@ -112,8 +114,15 @@ struct TrackData
|
||||||
}
|
}
|
||||||
if (!trackTableEntry) return 0.;
|
if (!trackTableEntry) return 0.;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Choose size.
|
||||||
|
*/
|
||||||
|
|
||||||
unsigned int sizes = nSizes;
|
unsigned int sizes = nSizes;
|
||||||
|
|
||||||
|
if (!sizes) return 0.;
|
||||||
|
if (sizes == 1) return trackTableEntry->get_value (base, 0, sizes);
|
||||||
|
|
||||||
/* TODO bfind() */
|
/* TODO bfind() */
|
||||||
unsigned int size_index;
|
unsigned int size_index;
|
||||||
UnsizedArrayOf<Fixed> size_table = base+sizeTable;
|
UnsizedArrayOf<Fixed> size_table = base+sizeTable;
|
||||||
|
|
Loading…
Reference in New Issue