flat_playlist::entry_t const * flat_playlist::get_entry(index_t const index) const { if (index >= get_num_entries()) return 0; entry_sequence_t const &entry_sequence = entries.get < sequence_tag > (); entry_sequence_t::const_iterator iter = entry_sequence.begin(); iter = iter + index; return &(*iter); }
size_t get_next_ifd_offset(const tiff_handle_t &tiff_handle, size_t this_ifd_offset) { // the pointer to the next ifd is at the end of this ifd // an IFD consists of num_entries, the 12-byte entries, then a 4 byte pointer to the next IFD if (this_ifd_offset == 0) { // ifd offset is out of range return 0; } uint16_t num_entries = get_num_entries(tiff_handle, this_ifd_offset); uint32_t next_ifd_offset_pointer = this_ifd_offset + 2 + (num_entries * 12); try { return tiff_handle.sbuf->get32u(next_ifd_offset_pointer, tiff_handle.byte_order); } catch (sbuf_t::range_exception_t &e) { return 0; } }