[mythtv-commits] Ticket #10766: Music import fails due to open files not closed

MythTV noreply at mythtv.org
Wed May 30 00:06:54 UTC 2012

#10766: Music import fails due to open files not closed
 Reporter:  mayfields@…         |          Owner:  stuartm
     Type:  Patch - Bug Fix     |         Status:  accepted
 Priority:  major               |      Milestone:  0.25.1
Component:  Plugin - MythMusic  |        Version:  0.25-fixes
 Severity:  medium              |     Resolution:
 Keywords:                      |  Ticket locked:  0

Comment (by mayfields@…):

 I suspect this ticket and 10757 are effectively the same, with this ticket
 being only a partial fix of open files not being closed. 10757 seems to
 stem from MetaIOID3 not closing files correctly, where this ticket notes
 files not being closed but only noting MetaIOOggVorbis and MetaIOWavPack.
 The logs from the previous two comments relate to MetaIOID3 but the end
 result is the same ie files not being closed and the scan ultimately

 The logs are revealing. The mp3 files are being handled without issue, but
 the FLAC files aren't being closed. Then, once the number of open files
 builds up the mp3 files are also having issues, but probably only because
 there are so many flac files still open.

 I suspect there is some strange behaviour going on where the file that is
 currently open is being treated as though it is an mp3 file, because the
 first file opened was an mp3 file. Is m_file being implicitly cast by the
 first file opened (in this case to TagLib::MPEG::File)
         case kMPEG :
             m_file = new TagLib::MPEG::File(fname.constData());
         case kFLAC :
             m_file = new TagLib::FLAC::File(fname.constData());

 hence when m_file is deleted the call is being made to TagLib::MPEG::File
 rather than TagLib::FLAC::File?

 When reading the tags, there is a static cast:
         case kMPEG :
             tag =
         case kFLAC :
             tag =

 Does this also need to be done for other references to m_file, including
 when deleting?

Ticket URL: <http://code.mythtv.org/trac/ticket/10766#comment:3>
MythTV <http://code.mythtv.org/trac>
MythTV Media Center

More information about the mythtv-commits mailing list