MediaArea / BWFMetaEdit

WAV/BWF metadata editor
https://MediaArea.net/BWFMetaEdit
Other
50 stars 19 forks source link

Missing Null Character on LIST-INFO #42

Closed X-Raym closed 6 years ago

X-Raym commented 6 years ago

Hi,

I'm on Win 10 x64.

When I set a LIST-INFO field like IART (artist name), it appears truncated in windows explorer column display and file properties.

Though, the information seems valid for BWF MetaEdit or other software capable of reading LIST-INFO. But I noticed that adding \x00 may solve the issue (I do that with a python script I made) (and also, size chunk have to be updated).

Here is a demo, using Riffpad to inspect chunks.: demo

Do you think it is a windows issue or a BWF MetaEdit one ?

Cheers !

EDITED: 2018-06-15: new screenshot

X-Raym commented 6 years ago

I confirm there is a missing bytes in BWF Meta Edit LIST- INFO Injection.

Here is from a working file downloaded form there

Original

Here is the same values but passed through BWF Meta Edit

BWF-Meta-Edit Truncated

As you can see there is missing bytes at the end, and size (the highlighted fifth hex number) is -1 smaller after BWFMetaEdit.

(hex preview with https://hexed.it/)

files

EDITED: 2018-06-15: new screenshots and files.

JeromeMartinez commented 6 years ago

@X-Raym sorry about the delay, I check that next week.

X-Raym commented 6 years ago

Oh don't worry take your time ! I'll still add info I found somethings new.

X-Raym commented 6 years ago

@JeromeMartinez I renamed the issue, cause this is in fact not a windows related issue, but a BWF injection one.

X-Raym commented 6 years ago

I tried injecting an extra null characters right in the CLI command doesn't seems to work. I think only an internal fix can do it. :S

JeromeMartinez commented 6 years ago

Apologizes for the delay (paid support has priority) but this is not forgotten.

aaronbrownsound commented 6 years ago

Any updates on this fix? Very excited about the BWFMetaEdit functionality. Would becoming a $30 member give any votes or help push this along?

X-Raym commented 6 years ago

I tried to find where the Set WAV-INFO function was,

I think it is in this function but I'm not sure, https://github.com/MediaArea/BWFMetaEdit/blob/master/Source/Riff/Riff_Chunks_WAVE_INFO_xxxx.cpp#L98

And I don't know how to fix it. Also, I don't know how to compile this code.

This is kind of hardcore level.

X-Raym commented 6 years ago

@JeromeMartinez And I'll sent to you REAPER scripts I'll plan to release (if they are powered by BWFMetaEdit of course) :P They will allow batch processing of wavefiles, with variables.

JeromeMartinez commented 6 years ago

@aaronbrownsound the membership would be appreciated but would not be enough for full sponsoring of the debugging, so it will be on my own "budget" at least for the most part. The issue is important enough so I'll do it, just a matter of time.

@X-Raym sorry about the delay (family has priority), but still on my todo-list.

X-Raym commented 6 years ago

@JeromeMartinez Thanks for your consideration, but I'm also sorry not to be able to debug and propose a fix (that is the interest of open source) ^^ All I was able to do is found the issue and back trace it. The rest is beyond my scope :S

JeromeMartinez commented 6 years ago

We missed a line in specs "Each chunk contains a ZSTR, or null-terminated text string", and Windows is weirdly handling the last char with files not adding this zero byte (it trashes it whatever is the content, i.e. even if it is not a zero, other tools usually just take the last byte if it is not zero).

Please test this snapshot.

X-Raym commented 6 years ago

@JeromeMartinez Thanks for your work on this ! Glad you find the issue !

I tried with the windows GUI version with all fields and it works pretty fine. Windows display fields properly in every of my test.

Though, there is something a bit weird; In some circumstances, adding extra characters to a field and then restore to the initial value create a FLLR chunk, rather than updating wav file as it was before.

Demo

Is it something for the case where LIST-INFO chunks isn't the last chunk ?

JeromeMartinez commented 6 years ago

In some circumstances, adding extra characters to a field and then restore to the initial value create a FLLR chunk, rather than updating wav file as it was before.

I don't remember exactly the reason, but current policy in BWF MetaEdit is to avoid to shrink a file, so a filler is added when you shrink it (file size is increased when you add 1 char, and for second edition of the file a shrink should be done without filling in order to revert to old size so BWF MetaEdit adds filling).

Such policy could be changed, but more code (and more tests), and it is not a bug, so not on free support.

X-Raym commented 6 years ago

@JeromeMartinez Understood ! That's ok, the file is working fine and its metadata also. I think it is good !

Will the version be bumped to v1.3.4 or stay at 1.3.3 ?

JeromeMartinez commented 6 years ago

Will the version be bumped to v1.3.4 or stay at 1.3.3 ?

Currently this is in development snapshot only, so 1.3.3.20180816 style. I'll release a new public version next week, tagged v1.3.4 as it is a major issue (invalid files are produced) so I don't wait for more development before doing a release.

X-Raym commented 6 years ago

@JeromeMartinez Excellent ! Meanwhile I'll continue to experiment with it (especially the CLI version) and I'll report if I find anything.

JeromeMartinez commented 6 years ago

v1.3.5 publicly released.

X-Raym commented 6 years ago

@JeromeMartinez Many thanks ! :)