MULTITRACKREAD is supplied an empty buffer. The size is determined by ulLength, and it is pointed to by pBuffer. MULTITRACKREAD processes the data by reading ulLength bytes of data into the buffer, and then parsing the data in the buffer by media type (audio or video) into records. A pointer to the data in the buffer is placed in the appropriate record table.
Note: A record is a contiguous buffer containing data of the same media type.
During the processing of MULTITRACKREAD in extended mode, pBuffer points to the beginning of the buffer on the first call to MULTITRACKREAD and ulLength indicates the number of bytes to be read into the buffer. With each call to MULTITRACKREAD, ulBufferLength (the actual total buffer length) is reduced by ulLength bytes, and pBuffer points to the current location in the buffer. Subsequent calls to MULTITRACKREAD reads ulLength bytes of data into the buffer starting at pBuffer and repeats the process until ulBufferLength is reached.
This implementation of MULTITRACKREAD allows smaller amounts of data to be read at one time while allowing frames greater than the ulLength of the read. For example, if the program wanted to fill a 128KB buffer while doing 32KB reads, the calling sequence to MULTITRACKREAD would be (32KB, 128KB), (32KB, 96KB), (32KB, 64KB), and (32KB, 32KB) for (ulLength, ulBufferLength). With this setup, MULTITRACKREAD can span frames across the 32KB buffers and know the size of the 128KB buffer.
During MULTITRACKREAD processing in regular mode, pBuffer always points to the beginning of the buffer and ulLength indicates the number of bytes to be read into the buffer. The buffer is filled completely with each call to MULTITRACKREAD and subsequent calls, to MULTITRACKREAD, read ulLength bytes of data into the buffer starting at the beginning of the buffer (pointed to by pBuffer).
Note: If the MULTITRACKREAD_EXTENDED bit flag is set, the calling routine has passed the extended MMMULTITRACKREAD structure with the new ulBufferLength field in this structure.