Skip to content

Can't parse opus file with TRACKNUMBER equal to "<current>/<total>" #493

@RocketRide9

Description

@RocketRide9

Reproducer

use std::fs::File;

use lofty::config::ParseOptions;
use lofty::file::AudioFile;
use lofty::ogg::{self};
use lofty::tag::Accessor;

fn main() {
    let wrong_opus = "./wrong.opus";
    
    let mut file_content = File::open(wrong_opus).unwrap();
    let opus_file = ogg::OpusFile::read_from(&mut file_content, ParseOptions::new()).unwrap();
    let tag = opus_file.vorbis_comments().track().unwrap();
    
    println!("{tag}");
}

Summary

Previously reported here: https://codeberg.org/edestcroix/Recordbox/issues/72

I did a little investigation and it seems to me that this library attempts tot parse "1/7" as u32 here: https://github.com/Serial-ATA/lofty-rs/blob/main/lofty/src/ogg/tag.rs#L336

Frankly, I don't know well how tags works, but this file was produced by converting mp3 using ffmpeg and apps like Tagger, Rhythmbox and Ear Tag can read this tag properly.

Expected behavior

No response

Assets

opus file with "1/7": https://codeberg.org/attachments/cd2f08e1-a57a-47e6-9769-27820a4e75a6

this and another file inside hex editor:
изображение

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions