When using WavOptions.*SYNC null terminated PartOfSet fields are not copied

Issue #153 resolved
Dan Gravell created an issue

As described in #152 , INFO fields can sometimes come null terminated. It appears this is to support Windows Explorer, which only shows the entire field if it is null terminated, otherwise truncating the last character.

When using one of the WavOptions "SYNC" options, and the fields are null terminated, the copying of PartOfSet fields does not work.

This is because a NumberFormatException occurs when parsing the number with a null terminator in. See PartOfSetValue.setCount.

Comments (10)

  1. Dan Gravell reporter

    There's no stack trace, the exception is ignored so it fails silently - you just end up with an empty field.

  2. Dan Gravell reporter

    I'll just write a simple filter to remove null terminators at the WavTag.syncToId3FromInfo* methods then.

    Ah, I've just noticed this is already done in syncToId3FromInfoOverwrite! So I propose just doing it in syncToInfoFromId3IfEmpty - I don't think the overwrite/ifEmpty semantics have any bearing on this.

  3. IJabz repo owner

    Ah yes, you mean syncToInfoFromId3IfEmpty() but also syncToInfoFromId3IfEmpty() is missing the addition of nulls that are added in synToInfoFromId3Overwrite() if you want to do that at same time

  4. Log in to comment