JLC's Media Player v1.0 Beta 1.2

Developed or developing a new product in PureBasic? Tell the world about it.
User avatar
Joakim Christiansen
Addict
Addict
Posts: 2452
Joined: Wed Dec 22, 2004 4:12 pm
Location: Norway
Contact:

Post by Joakim Christiansen »

That's just insane! :?
And all your other media players works fine?

Anyone else having this problem?
I like logic, hence I dislike humans but love computers.
rsts
Addict
Addict
Posts: 2736
Joined: Wed Aug 24, 2005 8:39 am
Location: Southwest OH - USA

Post by rsts »

Normally just use winamp and it works fine, but have used others with no problems.

If you would like to send a code snippet or whatever I can attempt to determine what's happening, but it just goes away.

cheers
User avatar
Joakim Christiansen
Addict
Addict
Posts: 2452
Joined: Wed Dec 22, 2004 4:12 pm
Location: Norway
Contact:

Post by Joakim Christiansen »

rsts wrote:If you would like to send a code snippet or whatever I can attempt to determine what's happening, but it just goes away.
Hmm, i'm not shure exactly what it could be!
But you could start trying this snippet:

Code: Select all

Define Tag.s{3}, Title.s{30}, Length.s{128}, File.s = OpenFileRequester("Open","","All files (*.*)|*.*",0)
If File
  If mciSendString_("OPEN "+#DQUOTE$+File+#DQUOTE$+" TYPE MPEGVIDEO ALIAS Temp",0,0,0)=0
    
    mciSendString_("STATUS Temp LENGTH",@Length,128,0)
    mciSendString_("CLOSE Temp",0,0,0)
  
    Debug "Filename: " + Left(GetFilePart(File),Len(GetFilePart(File))-4)
    Debug "Length (seconds): " + Str(Val(Length)/1000)
    
    If ReadFile(0,File)
      FileSeek(0,Lof(0)-128)
      ReadData(0,@Tag,3)
      If Tag = "TAG"
        ReadData(0,@Title,30)
        Debug "Title: " + Title
      EndIf
      CloseFile(0)
    EndIf
    
  EndIf
EndIf
I like logic, hence I dislike humans but love computers.
rsts
Addict
Addict
Posts: 2736
Joined: Wed Aug 24, 2005 8:39 am
Location: Southwest OH - USA

Post by rsts »

If mciSendString_("OPEN "+#DQUOTE$+File+#DQUOTE$+" TYPE MPEGVIDEO ALIAS Temp",0,0,0)=0

Invalid memory access.

cheers

File is "V:\MP3\03-sparetime-vschmid.mp3"
other variables are null
User avatar
Flype
Addict
Addict
Posts: 1542
Joined: Tue Jul 22, 2003 5:02 pm
Location: In a long distant galaxy

Post by Flype »

hello,

and if you try to remove the fixed strings {3}, {30}, ... ?

and does it works with file = "c:\test.mp3 ?"
No programming language is perfect. There is not even a single best language.
There are only languages well suited or perhaps poorly suited for particular purposes. Herbert Mayer
rsts
Addict
Addict
Posts: 2736
Joined: Wed Aug 24, 2005 8:39 am
Location: Southwest OH - USA

Post by rsts »

Flype wrote:hello,

and if you try to remove the fixed strings {3}, {30}, ... ?

and does it works with file = "c:\test.mp3 ?"
not quite sure I understand what you mean by removing the fixed strings, but if I attempt to open c:\test.mp3, I get the same memory error as before.

cheers
User avatar
Flype
Addict
Addict
Posts: 1542
Joined: Tue Jul 22, 2003 5:02 pm
Location: In a long distant galaxy

Post by Flype »

Code: Select all

Define Tag.s{3}, Title.s{30}, Length.s{128}, File.s = OpenFileRequester("Open","","All files (*.*)|*.*",0)
If File
  If mciSendString_("OPEN "+#DQUOTE$+File+#DQUOTE$+" TYPE MPEGVIDEO ALIAS Temp",0,0,0)=0
    
    mciSendString_("STATUS Temp LENGTH",@Length,128,0)
    mciSendString_("CLOSE Temp",0,0,0)
  
    Debug "Filename: " + Left(GetFilePart(File),Len(GetFilePart(File))-4)
    Debug "Length (seconds): " + Str(Val(Length)/1000)
    
    If ReadFile(0,File)
      FileSeek(0,Lof(0)-128)
      ReadData(0,@Tag,3)
      If Tag = "TAG"
        ReadData(0,@Title,30)
        Debug "Title: " + Title
      EndIf
      CloseFile(0)
    EndIf
    
  EndIf
EndIf
i mean on the first line of this source code
and using space() instead of {}... maybe who knows :)
No programming language is perfect. There is not even a single best language.
There are only languages well suited or perhaps poorly suited for particular purposes. Herbert Mayer
rsts
Addict
Addict
Posts: 2736
Joined: Wed Aug 24, 2005 8:39 am
Location: Southwest OH - USA

Post by rsts »

Flype wrote: i mean on the first line of this source code
and using space() instead of {}... maybe who knows :)
I thought that might be what you meant, but anything except a number gives me a syntax error.

cheers
User avatar
Joakim Christiansen
Addict
Addict
Posts: 2452
Joined: Wed Dec 22, 2004 4:12 pm
Location: Norway
Contact:

Post by Joakim Christiansen »

Convert Title.s{30} to Title.s = Space(30)
And so on, and try again!

Looks like we found a PB bug?
I like logic, hence I dislike humans but love computers.
rsts
Addict
Addict
Posts: 2736
Joined: Wed Aug 24, 2005 8:39 am
Location: Southwest OH - USA

Post by rsts »

Define Tag.s = Space(3), Title.s = Space(30), length.s{128}, File.s = OpenFileRequester("Open","","All files (*.*)|*.*",0)

give me the same memory access error

Was that what you meant?

cheers
User avatar
Joakim Christiansen
Addict
Addict
Posts: 2452
Joined: Wed Dec 22, 2004 4:12 pm
Location: Norway
Contact:

Post by Joakim Christiansen »

Yes, that's what I meant.
Maybe you have a problem with fixed strings, so try on length also!
If so then it's a PureBasic bug and then I know how to fix my source!
I like logic, hence I dislike humans but love computers.
rsts
Addict
Addict
Posts: 2736
Joined: Wed Aug 24, 2005 8:39 am
Location: Southwest OH - USA

Post by rsts »

Define Tag.s = Space(3), Title.s = Space(30), length.s = Space(128), File.s = OpenFileRequester("Open","","All files (*.*)|*.*",0)
If File
If mciSendString_("OPEN "+#DQUOTE$+File+#DQUOTE$+" TYPE MPEGVIDEO ALIAS Temp",0,0,0)=0


yields same memory access error on the mciSendString statement.

cheers
User avatar
Joakim Christiansen
Addict
Addict
Posts: 2452
Joined: Wed Dec 22, 2004 4:12 pm
Location: Norway
Contact:

Post by Joakim Christiansen »

rsts, then I guess you have to report this as a PB bug?
I like logic, hence I dislike humans but love computers.
rsts
Addict
Addict
Posts: 2736
Joined: Wed Aug 24, 2005 8:39 am
Location: Southwest OH - USA

Post by rsts »

Well, if I'm the only one who experiences any problem, I'll chalk it up to some idiosyncrasy of my system rather than a PB bug:)

cheers
inc.
Enthusiast
Enthusiast
Posts: 406
Joined: Thu May 06, 2004 4:28 pm
Location: Cologne/GER

Post by inc. »

Try to do the approach for finding the error in code part steps, means do a test without the TAG parser.

Code: Select all

Define Tag.s{3}, Title.s{30}, Length.s{128}, File.s = OpenFileRequester("Open","","All files (*.*)|*.*",0)
If File
  If mciSendString_("OPEN "+#DQUOTE$+File+#DQUOTE$+" TYPE MPEGVIDEO ALIAS Temp",0,0,0)=0
   
    mciSendString_("STATUS Temp LENGTH",@Length,128,0)
    mciSendString_("CLOSE Temp",0,0,0)
 
    Debug "Filename: " + Left(GetFilePart(File),Len(GetFilePart(File))-4)
    Debug "Length (seconds): " + Str(Val(Length)/1000)
   
  EndIf
EndIf
also ...

- .... maybe an unicode issue?

- MCI procedures do best work with short path names! ..

shortFilename.s = space(xxxx)
res = GetShortPathName_(@File, @shortFilename, xxxx).


- Also try if the Doublequote constant in here causes problems.
If mciSendString_("OPEN "+File+" TYPE MPEGVIDEO ALIAS Temp",0,0,0)=0

- is this a VBR mp3? mp3s always should be encoded as CBR for compatibility purposes. As this lets often the specific installed mp3 decoder beeing messed up when trying to decode. (VBR = Varaible Bitrate, CBR = Constant bitrate).
Check out OOP support for PB here!
Post Reply