PDA

View Full Version : cue file breakage (and patch)



michael
2004-05-18, 14:42

Richard Purdie
2004-05-18, 16:12
michael:
> Today I did my morning "cvs up", I couldn't help but notice that all
> the files referenced by cuesheet had disappeared. After a bit of
> digging I tracked the problem down to updateCaches() and the use of
> typeFromSuffix(). While I truly believe that typeFromSuffix is a
> fundamentally flawed concept, (particularly in the context of container
> formats like ogg and Quicktime,) which deserves to die a horrible
> deletion, I also recognise that that's a separate bug and the current
> crisis can be solved with this simple patch...

Interesting. I agree with what you're saying.

As a bit of background: The typeFromSuffix function is there as there are
(were?) times when it's a very bad idea to access the cached CT (or other)
data within the cache routines themselves. You used to be able to lock the
cache functions into recursive loops if you weren't careful. This bit of
code used to be in such a position where it evidently caused problems.

I've been straightening a lot of the cache functions out and you can
probably get away with calling cache functions from that point in the code
now.

What puzzles me is that the old code in sub updateCacheEntry(...) also used
typeFromSuffix() so I can't see why this should suddenly break things. I'd
be a lot happier knowing why this suddenly broke things as the code is the
same.

Unfortunately I don't have any cue files so I can't look into this here...

--
RP

michael
2004-05-18, 16:54
"Richard Purdie" <rpurdie (AT) rpsys (DOT) net> writes:
....
> What puzzles me is that the old code in sub updateCacheEntry(...) also used
> typeFromSuffix() so I can't see why this should suddenly break things. I'd
> be a lot happier knowing why this suddenly broke things as the code is the
> same.
>
> Unfortunately I don't have any cue files so I can't look into this here...

As far as I can tell, this piece of the code was once part of
updateCacheEntry(), and is now split into a separate function. That
path through the code ( updateCacheEntry() -> updateCaches() ) is
fine. The problem shows up when a line was added to Import.pm that
calls reBuildCaches() which in turn calls updateCaches() (not having
passed through the rest of what is in updateCacheEntry(). )

-michael
--
"I do not go out of my way to boldly split infinitives,
nor do I actively seek prepositions to end sentences with."
-James W. Zubrick