Bug 499 - content type is being stomped (again) for flac w/ cuesheets
: content type is being stomped (again) for flac w/ cuesheets
Status: CLOSED FIXED
Product: Logitech Media Server
Classification: Unclassified
Component: Formats
: unspecified
: PC All
: P2 normal (vote)
: ---
Assigned To: KDF
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2004-08-12 16:26 UTC by michael
Modified: 2008-12-15 11:57 UTC (History)
1 user (show)

See Also:
Category: ---


Attachments
preserve content type (1.11 KB, patch)
2004-08-12 16:27 UTC, michael
Details | Diff
combined patch (1.49 KB, patch)
2004-08-18 16:38 UTC, KDF
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description michael 2004-08-12 16:26:53 UTC
readTags() is again stomping on content type when it's different than file type.
When using flac files with embedded cuesheets, this causes the base flac file to
show up as a No Artist -> No Album track.
Comment 1 michael 2004-08-12 16:27:59 UTC
Created attachment 100 [details]
preserve content type

here's a fix
Comment 2 KDF 2004-08-18 15:48:21 UTC
this patch wont work becuase the artwork routines need the CT defined prior to
the check for artwork.  If CT does not exist, it will lock into deep recursion
and lock the server.
Comment 3 KDF 2004-08-18 16:00:57 UTC
perhaps the proposed fix for bug469 will avoid the infinite loop here as well?
if not, perhaps an assumed CT will work within the readCoverartFiles() and
infoFormat.
Comment 4 KDF 2004-08-18 16:05:02 UTC
sorry...that's bug468.  also, in regards to the patch for this bug, attachment
100 [details], I think the added CT line is redundant since the CT is cached if not
defined only a few lines above where this is proposed to be added.
Comment 5 KDF 2004-08-18 16:38:52 UTC
Created attachment 109 [details]
combined patch

This seems to work for me.  no deep recursion on cover art.  hopefully this
allows flac cue sheets to work and without artwork interference (bug468)
Comment 6 michael 2004-08-18 19:11:50 UTC
> this patch wont work becuase the artwork routines need the CT defined prior to
> the check for artwork.

CT is still defined before the artwork routines are called. We just don't need
to do it twice.

The combined patch you posted (109) still removes one of the redundant settings
of CT (which is good) but loses the conditional 
$tempCacheEntry->{'CT'} = $type unless defined $tempCacheEntry->{'CT'};
(not so good).

the problem here is that flac files with embedded cuesheets are acting as both a
playlist and as audio data. Part of the process for dealing with this split
personality involves setting their CT as something different than a straight
flac file. This means that in this case CT is defined as something different
than what $type is set to. ($type as its used here is set based solely on the
files .flac suffix.) Blindly using
$tempCacheEntry->{'CT'} = $type;
will break things. It needs the "... unless defined ..." (or something
equivalent) added onto the end to avoid stomping on an existing value.

Please try it with the conditional as used in attachment 100 [details]. I don't believe it
breaks anything. If you find problems with it, let me know and we can look for
an alternate solution.

Thanks,

-michael
Comment 7 KDF 2004-08-18 23:26:57 UTC
odd...in my copy of Info.pm I have 
	if (!defined($tempCacheEntry->{'CT'})) {
		$tempCacheEntry->{'CT'} = $type;
	}
at line 2181, which does exactly the same thing as the unless defined.
Comment 8 michael 2004-08-19 12:01:56 UTC
yes, that one is just fine. but look at the one on line 2140.
Comment 9 KDF 2004-08-19 18:39:04 UTC
yes, and I already agreed that 2140 needs to be removed, but your patch adds
another place for assigning CT when there is already an if !defined assignment
done at 2181. I'm sure dean will sort it out.
Comment 10 michael 2004-08-20 13:43:15 UTC
it sounds like we might be arguing the same points and just not communicating it
very well. :)

just to summarize the intent of the original patch, in case I screwed it up
somehow, and to help out whoever gets to sort this all out...
(line numbers based on unmodified current cvs co of Info.pm)

parsing of flacs with embedded cue sheets results in setting a CT that is
different than the file suffix derived $type, and this should be preserved.

on line 2132 there is an unconditional setting of CT that should be removed.

on line 2143 there in an unconditional setting of CT that should be converted
into a conditional (... unless defined ...)

on line 2185 there is a conditional setting of CT that is fine as it is.

I hope this helps clear up some of the confusion.

Thanks!
Comment 11 KDF 2004-08-20 13:51:22 UTC
right, with you now :)
Comment 12 Blackketter Dean 2004-08-20 14:37:41 UTC
Me confused.  Is this the final patch?
Comment 13 KDF 2004-08-20 14:41:31 UTC
michael's patch is the right one for this bug.
Comment 14 Blackketter Dean 2004-08-20 15:26:29 UTC
Ok, looks good to me.  Please apply.
Comment 15 KDF 2004-08-20 15:28:15 UTC
righty ho.  I'll take care of this and 468 shortly.
Comment 16 KDF 2004-08-20 17:55:48 UTC
committed 20/08/04. Michael, can you please confirm this works as you exepct and
if so, close this off.
Comment 17 michael 2004-08-20 18:12:26 UTC
it looks correct (in current cvs). it seems to be behaving properly again.

Thanks!
Comment 18 James Richardson 2008-12-15 11:57:06 UTC
This bug has been fixed in the latest release of SqueezeCenter!

Please download the new version from http://www.slimdevices.com/su_downloads.html if you haven't already.  

If you are still experiencing this problem, feel free to reopen the bug with your new comments and we'll have another look.