My previous VBR patch used LAME's lame_mp3_tags_fid function which is bad when dynamically linked. I should have known better, but I hadn't planned on writing any tag support. It was required to get VBR files to be reasonable functional in a player (correct duration, working slider, etc.)
This patch started out as a rewrite using LAME's lame_get_lametag_frame function which is reliable even with dynamic linking. Looking at a few functions in the LAME sources showed what was required. Specifically, I referred to lame_mp3_tags_fid, PutVbrTag, skipId3v2. As usual what I thought I needed didn't take that long, but the unexpected did. Testing showed idigdoug's cool patch, "Write ID3 tags to newly-created MP3 files", was causing files to show the wrong duration. Apparently when using the tempo effect (or any effect that changes time) the wrong value (0xFFFFFFFF) is used to calculate the TLEN tag and in Windows Media Player this takes precedence over a correct VBR header.
Now with this patch, if possible, when stopwrite is called both the ID3 and VBR headers are rewritten with correct durations for mp3 file output.
Log in to post a comment.