# Positioning yourself in a file

The library stores a seperate position identifier for each video track and each audio track in a file. The position identifiers are independant of each other and advance independantly when you read data. Video tracks advance independantly, but audio tracks are tricky. When you read audio data, the channel positions are not independant. Since all the channels are on track 0, reading audio data advances all the channel positions. You need to manually set the audio position every time you want to read a different audio channel.

There is no positioning support while writing because this is write-only.

The positioning routines are as follows:

`int quicktime_seek_end(quicktime_t *file);
int quicktime_seek_start(quicktime_t *file);
int quicktime_set_audio_position(quicktime_t *file, long sample, int track);
int quicktime_set_video_position(quicktime_t *file, long frame, int track);
`

The seek_end and seek_start seek all tracks to their ends or starts. The set_position commands seek one track to the desired position. The track parameter for audio is always going to be 0.