Vorbisfile documentation | vorbisfile version 1.68 - 20030307

# ov_crosslap()

declared in "vorbis/vorbisfile.h";

ov_crosslap overlaps and blends the boundary at a transition between two separate streams represented by separate OggVorbis_File structures. For lapping transitions due to seeking within a single stream represented by a single OggVorbis_File structure, consider using the lapping versions of the vorbisfile seeking functions instead.

ov_crosslap is used between the last (usually ov_read) call on the old stream and the first ov_read from the new stream. Any desired positioning of the new stream must occur before the call to ov_crosslap() as a seek dumps all prior lapping information from a stream's decode state. Crosslapping does not introduce or remove any extraneous samples; positioning works exactly as if ov_crosslap was not called.

ov_crosslap will lap between streams of differing numbers of channels. Any extra channels from the old stream are ignored; playback of these channels simply ends. Extra channels in the new stream are lapped from silence. ov_crosslap will also lap between streams links of differing sample rates. In this case, the sample rates are ignored (no implicit resampling is done to match playback). It is up to the application developer to decide if this behavior makes any sense in a given context; in practical use, these default behaviors perform sensibly.

    long ov_crosslap(OggVorbis_File *old, OggVorbis_File *new);

### Parameters

old
  A pointer to the OggVorbis_File structure representing the origin stream from which to transition playback.
new
  A pointer to the OggVorbis_File structure representing the stream with which playback continues.

### Return Values

> OV_EINVAL
>   crosslap called with an OggVorbis_File structure that isn't open.
> OV_EFAULT
>   internal error; implies a library bug or external heap corruption.
> OV_EREAD
>   A read from media returned an error.
> OV_EOF
>   indicates stream `vf2` is at end of file, or that `vf1` is at end of file immediately after a seek (making crosslap impossible as there's no preceding decode state to crosslap).
> 0
>   success.

copyright © 2003 Xiph.org | Ogg Vorbis
Vorbisfile documentation | vorbisfile version 1.68 - 20030307