Simple seek API
Decoding of multimedia streams

## Functions

BGAV_PUBLIC int | bgav_can_seek (bgav_t *bgav)
| Check if a track is seekabkle. More...
BGAV_PUBLIC void | bgav_seek (bgav_t *bgav, gavl_time_t *time)
| Seek to a specific time. More...
BGAV_PUBLIC void | bgav_seek_scaled (bgav_t *bgav, int64_t *time, int scale)
| Seek to a specific stream position. More...

## Detailed Description

gmerlin_avdecoder supports multiple demultiplexing modes, some are optimized for linear playback, some are optimized for sample accurate random access. By default, the demuxer will be in linear playback mode. The associated seek API is described in this section.

## Function Documentation

## bgav_can_seek()

BGAV_PUBLIC int bgav_can_seek | ( | bgav_t * | bgav | ) |

Check if a track is seekabkle.

Parameters

  bgav | A decoder handle

Returns
  1 if the track is seekable, 0 else.

## bgav_seek()

BGAV_PUBLIC void bgav_seek | ( | bgav_t * | bgav,
|  | gavl_time_t * | time
| ) |  |

Seek to a specific time.

Parameters

  bgav | A decoder handle
  time | The time to seek to.

The time argument is changed to the actually seeked time, which can be different.

## bgav_seek_scaled()

BGAV_PUBLIC void bgav_seek_scaled | ( | bgav_t * | bgav,
|  | int64_t * | time,
|  | int | scale
| ) |  |

Seek to a specific stream position.

Parameters

  bgav | A decoder handle
  time | The time to seek to.
  scale | Timescale

This function allows sample and frame accurate seeking, if the following conditions are met:

- The formats allows sample accurate seeking at all
- For audio streams, scale is equal to the samplerate
- For video streams, scale is equal to the timescale

Typically, only one stream will be positioned accurately. For editing applications, it's recommended, that separate decoder instances are opened for audio and video. They can then be positoned independently.

The time argument might be changed to the actually seeked time, which can be different. For sample accurate formats, it should always be unchanged.

This function allows sample accurate seeking for some cases even in linear decoding mode. For more sophisticated sample accurate access, see Sample accurate seek API.