| 7151 | } |
| 7152 | |
| 7153 | avifBool avifDecoderIsKeyframe(const avifDecoder * decoder, uint32_t frameIndex) |
| 7154 | { |
| 7155 | if (!decoder->data || (decoder->data->tiles.count == 0)) { |
| 7156 | // Nothing has been parsed yet |
| 7157 | return AVIF_FALSE; |
| 7158 | } |
| 7159 | |
| 7160 | // *All* tiles for the requested frameIndex must be keyframes in order for |
| 7161 | // avifDecoderIsKeyframe() to return true, otherwise we may seek to a frame in which the color |
| 7162 | // planes are a keyframe but the alpha plane isn't a keyframe, which will cause an alpha plane |
| 7163 | // decode failure. |
| 7164 | for (unsigned int i = 0; i < decoder->data->tiles.count; ++i) { |
| 7165 | const avifTile * tile = &decoder->data->tiles.tile[i]; |
| 7166 | if ((frameIndex >= tile->input->samples.count) || !tile->input->samples.sample[frameIndex].sync) { |
| 7167 | return AVIF_FALSE; |
| 7168 | } |
| 7169 | } |
| 7170 | return AVIF_TRUE; |
| 7171 | } |
| 7172 | |
| 7173 | uint32_t avifDecoderNearestKeyframe(const avifDecoder * decoder, uint32_t frameIndex) |
| 7174 | { |
no outgoing calls