MediaPortal Forums HTPC/MediaCenter

Go Back   MediaPortal Forum » MediaPortal 1 » Help on Development » General Development (no feature request here!)


General Development (no feature request here!) You were able to fix an issue, or improved a feature? Post it here.

Reply
 
LinkBack Thread Tools Display Modes
Old 2007-11-24, 13:51   #1 (permalink)
Portal Member
 
Join Date: Oct 2007
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts

Country:


Smile [patch] Adressed a couple of playlist issues

Hi,

making my first steps in C# (I'm a Delphi and scripting guy), I adressed the bugs reported here and here, being:
- tracks containing special characters in .m3u playlists were skipped as well as not displayed properly
- track lengths in .pls playlists were off by a factor of 1000 seconds
- relative paths in .pls playlists didn't work


Here's what I changed:

Core.PlayList.PlayListM3uIO.cs:
Line 59, old code:
Code:
using (file = new StreamReader(playlistFileName))
new code:
Code:
Encoding fileEncoding = Encoding.Default;
FileStream stream = File.Open(playlistFileName, FileMode.Open, FileAccess.Read, FileShare.Read);
using (file = new StreamReader(stream, fileEncoding, true))
This took care of the problem with special chars in .m3u playlists.


Core.PlayList.PlayListPLSIO.cs:
Commented out line 138
Code:
//duration *= 1000;
This fixed the faulty track length display.

Lines 142-146, old code:
Code:
if (tmp.IndexOf("http:") < 0 && tmp.IndexOf("mms:") < 0 && tmp.IndexOf("rtp:") < 0)
{
  MediaPortal.Util.Utils.GetQualifiedFilename(basePath, ref fileName);
  newItem.Type = PlayListItem.PlayListItemType.AudioStream;
}
New code (just inserted one LOC inbetween):
Code:
if (tmp.IndexOf("http:") < 0 && tmp.IndexOf("mms:") < 0 && tmp.IndexOf("rtp:") < 0)
{
  MediaPortal.Util.Utils.GetQualifiedFilename(basePath, ref fileName);
  newItem.FileName = fileName;
  newItem.Type = PlayListItem.PlayListItemType.AudioStream;
}
This fixed the handling of relative paths.

BTW I'm not sure if the assignment of the newItem.Type is correct in this last piece of code. But since it's been working for me so far, I left it alone. Someone with more inside knowledge may verify this.

Cheers...
enco is offline   Reply With Quote
Old 2007-11-24, 17:25   #2 (permalink)
Retired Team Member
 
tomtom21000's Avatar
 
Join Date: Apr 2004
Location: Germany
Posts: 978
Thanks: 3
Thanked 4 Times in 4 Posts

My System

Default

sounds great. I am no programmer, so I can´t say much to your changes.

But it is always appreciated if you:

# explain the changes on the forums (done! )
# upload your changes as full files to the sourceforge patches section: http://sourceforge.net/tracker/?atid...97&func=browse

tomtom
__________________
tomtom21000 is offline   Reply With Quote
Old 2007-11-24, 20:06   #3 (permalink)
Portal Member
 
Join Date: Oct 2007
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts

Country:


Default

Whoops, I see... thanks for the hint.
I uploaded the two source files to the patches section on SF.net now. Hope it helps
enco is offline   Reply With Quote
Reply

Bookmarks

Tags
adressed, couple, patch, playlist

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Couple of bugs/issues Noelix Get Support 1 2007-03-07 19:59
A couple of issues that won't go away (yet) emphatic 0.2.0.0 Final and SVN Builds 0 2006-12-23 01:32
A couple of UI issues with B2 Wide Doodles 0.2.0.0 Final and SVN Builds 4 2006-10-30 18:38
Please help me to stop this tearing+a couple of other issues slayer General Support 67 2006-03-22 23:05
Video navigation and playlist issues FullMoon 0.2.0.0 Release Candidate 1 0 2005-09-17 00:02


All times are GMT +1. The time now is 07:53.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0 Protected by Akismet Blog with WordPress