When using WavOptions.*SYNC null terminated PartOfSet fields are not copied
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)
-
repo owner -
reporter There's no stack trace, the exception is ignored so it fails silently - you just end up with an empty field.
-
repo owner Ah, okay if you could fix it that would be great
-
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 insyncToInfoFromId3IfEmpty
- I don't think the overwrite/ifEmpty semantics have any bearing on this. -
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
-
reporter Sure, thanks. I'll try to do this in the coming days and issue a PR.
-
reporter -
repo owner - changed status to resolved
Fixed.
-
repo owner Dan, can you add bug153,wav please
-
reporter Sorry, still getting used to git, thought I'd added the file in the commit, I hadn't.
See pull request #38 .
- Log in to comment
Can you paste the stack trace please