Function ogg_magic::utils::find_packet_by_type
source · pub fn find_packet_by_type(
ogg_vorbis_file: &[OggVorbisPageResult],
packet_type: &str,
) -> Option<(usize, usize)>Expand description
Finds a packet of a specified type in an Ogg Vorbis file.
This function searches through the provided ogg_vorbis_file for a packet of the specified type
(“identification”, “comment”, or “setup”) and returns its position as a tuple of page and packet indices.
§Arguments
ogg_vorbis_file- A slice ofOggVorbisPageResultrepresenting the Ogg Vorbis file.packet_type- A string specifying the type of packet to find (“identification”, “comment”, or “setup”).
§Returns
An option containing a tuple of page and packet indices if the packet is found, or None if not found.