It is currently Wed May 22, 2013 8:49 am

All times are UTC + 1 hour




Post new topic Reply to topic  [ 14 posts ] 
Author Message
 Post subject: LoadMovie still has issues
PostPosted: Thu Jan 24, 2013 4:28 am 
Offline
Addict
Addict

Joined: Tue Feb 22, 2011 1:16 pm
Posts: 1459
Can't post a working snippet, but anyone can see the following error should NOT occur if music=0.
It should show the status message instead. How is it going through when its value is clearly 0?
BTW, this started happening after I switched from XP 32-bit to Windows 7 64-bit, if that helps.

Image

_________________
Microsoft Visual Basic only lasted 7 short years: 1991 to 1998.
PureBasic: Born in 1998 and still going strong to this very day!


Top
 Profile  
 
 Post subject: Re: LoadMovie still has issues
PostPosted: Thu Jan 24, 2013 4:57 am 
Offline
666
666

Joined: Mon Sep 01, 2003 2:33 pm
Posts: 914
on line 6125

Code:
PlayMovie(music,app)


is app the window number or is it actually the WindowID?

Because I have a funny feeling you may have just forgotten to do it as

Code:
PlayMovie(music,WindowID(app))
??


Top
 Profile  
 
 Post subject: Re: LoadMovie still has issues
PostPosted: Thu Jan 24, 2013 6:33 am 
Offline
PureBasic Bullfrog
PureBasic Bullfrog
User avatar

Joined: Wed Jul 06, 2005 5:42 am
Posts: 6465
That would still be the wrong error message though. But there's something weird here, the context variable viewer is clearly showing music = 0 but the PlayMovie command tried to execute- it shouldn't have taken that branch at all.

_________________
Veni, vidi, vici.


Top
 Profile  
 
 Post subject: Re: LoadMovie still has issues
PostPosted: Thu Jan 24, 2013 8:49 am 
Offline
666
666

Joined: Mon Sep 01, 2003 2:33 pm
Posts: 914
netmaestro wrote:
That would still be the wrong error message though. But there's something weird here, the context variable viewer is clearly showing music = 0 but the PlayMovie command tried to execute- it shouldn't have taken that branch at all.


I agree with you mate. it is an odd one. but with a slightly modified PB example... which kinda emulates what MC is upto in his code, this works... I cannot emulate the problems he is having. So unless he is using a thread or something, which PB isn't quite liking somewhere? <shrug>

Code:
app=4

If InitMovie() = 0
  MessageRequester("Error", "Can't initialize movie playback !", 0)
  End
 
EndIf

M$ = OpenFileRequester("Choose the movie to play", "", "Movie/Audio files|*.avi;*.mpg;*.asf;*.mp3;*.wav|All Files|*.*", 0)

If M$
 
  music=LoadMovie(#PB_Any, M$)
 
  Debug music
 
  If music = 0
    MessageRequester("Error", "Can't load the movie...", 0)
   
  Else
    OpenWindow(app, 100, 150, MovieWidth(music), MovieHeight(music), "PureBasic - Movie")
    PlayMovie(music,WindowID(app))
   
    Repeat:Until WaitWindowEvent() = #PB_Event_CloseWindow
   
  EndIf
 
EndIf


Top
 Profile  
 
 Post subject: Re: LoadMovie still has issues
PostPosted: Thu Jan 24, 2013 9:01 am 
Offline
PureBasic Bullfrog
PureBasic Bullfrog
User avatar

Joined: Wed Jul 06, 2005 5:42 am
Posts: 6465
I've been playing around with this a bit too and I have a question for you. Your code plays a movie successfully, right? I assume so, anyway. When it plays a video, when you move the window around does the video move with it? 'Cause it doesn't here. I can't even use a callback and call ResizeMovie() on WM_MOVING, WM_MOVE to get it to follow the window. It just won't. Now, if you don't specify a valid WindowID and just pass 0 to the PlayMovie command for the window, a new player window will open and that one can move the video around.

_________________
Veni, vidi, vici.


Top
 Profile  
 
 Post subject: Re: LoadMovie still has issues
PostPosted: Thu Jan 24, 2013 9:09 am 
Offline
666
666

Joined: Mon Sep 01, 2003 2:33 pm
Posts: 914
with the code I just posted, it plays movies just fine. Even with moving the window. (Win 7 - 64bit btw), only time it fails is if I move the window into my second monitor hehe. But I am not experiencing what you described though dude (although we are going a little OT in MC's bug report ;))


Top
 Profile  
 
 Post subject: Re: LoadMovie still has issues
PostPosted: Thu Jan 24, 2013 2:44 pm 
Offline
Addict
Addict

Joined: Tue Feb 22, 2011 1:16 pm
Posts: 1459
LuCiFeR[SD] wrote:
is app the window number or is it actually the WindowID?

The global variable "app" is the Window ID. It's the result of: app=OpenWindow(#PB_Any,).

Also, I'm playing MP3s with this code, not an actual video. Sometimes they play (mostly), but now, since Win 7 64-bit, I'm getting errors like the above.

netmaestro is right, too. The variable "app" has nothing to do with it. Why is the value of "music", being 0, getting into the wrong part of the decision? The status message should show instead. And no, "music" is not used in a thread and getting changed anywhere else.

_________________
Microsoft Visual Basic only lasted 7 short years: 1991 to 1998.
PureBasic: Born in 1998 and still going strong to this very day!


Top
 Profile  
 
 Post subject: Re: LoadMovie still has issues
PostPosted: Thu Jan 24, 2013 3:49 pm 
Offline
666
666

Joined: Mon Sep 01, 2003 2:33 pm
Posts: 914
MachineCode wrote:
The global variable "app" is the Window ID. It's the result of: app=OpenWindow(#PB_Any,).


My mistake, I meant to put is app the window handle or the Unique ID created by OpenWindow(), but somehow I kinda put a garbled mess :). but in the case of the PlayMovie() (according to the manual), app should be the window handle eg. PlayMovie(music,WindowID(app)). not the identifier created by open window alone.

MachineCode wrote:
Also, I'm playing MP3s with this code, not an actual video. Sometimes they play (mostly), but now, since Win 7 64-bit, I'm getting errors like the above.


I knew that already... contrary to popular belief I can read... :lol: it is possible that you have a bad codec, but that wouldn't explain your other problems... or maybe it would? That is something I cannot answer without being sat at your desk :)

MachineCode wrote:
netmaestro is right, too. The variable "app" has nothing to do with it. Why is the value of "music", being 0, getting into the wrong part of the decision? The status message should show instead. And no, "music" is not used in a thread and getting changed anywhere else.


I didn't disagree with either of you on the point of the if music=0 thang... Now, that is the part which I didn't understand myself. I could not reproduce it. The only obvious thing that stood out to me was app wasn't wrapped in WindowID(app). but it still didn't explain that particular problem.

But I am sorry my contributions aren't useful to you. I'll keep quiet next time.


Top
 Profile  
 
 Post subject: Re: LoadMovie still has issues
PostPosted: Thu Jan 24, 2013 4:36 pm 
Offline
Addict
Addict

Joined: Tue Feb 22, 2011 1:16 pm
Posts: 1459
LuCiFeR[SD] wrote:
in the case of the PlayMovie() (according to the manual), app should be the window handle eg. PlayMovie(music,WindowID(app)). not the identifier created by open window alone.

WindowID(app)? No, that's invalid. The manual for PlayMovie() just says to use the WindowID of the window, which is either "app" or WindowID(0), because they're the same:

Code:
app=OpenWindow(0,0,0,0,0,"")
Debug app
Debug WindowID(0)
Debug WindowID(app) ; Error.

It's never been valid to use WindowID(app) in PureBasic. :shock: It always raises an error if you try.

_________________
Microsoft Visual Basic only lasted 7 short years: 1991 to 1998.
PureBasic: Born in 1998 and still going strong to this very day!


Top
 Profile  
 
 Post subject: Re: LoadMovie still has issues
PostPosted: Thu Jan 24, 2013 4:50 pm 
Offline
Addict
Addict
User avatar

Joined: Thu Jun 24, 2004 2:44 pm
Posts: 4715
Location: Berlin - Germany
Code:
app=OpenWindow(#PB_Any,0,0,0,0,"")
Debug app
Debug WindowID(app)
Debug WindowID(0) ; Error.
:wink:

_________________
PureBasic 5.11 | Windows 7 SP1 (x64) | Linux Mint 14 (x64) | RealSource

The use of EnableExplicit is free of charge and avoids errors.


Top
 Profile  
 
 Post subject: Re: LoadMovie still has issues
PostPosted: Thu Jan 24, 2013 4:53 pm 
Offline
666
666

Joined: Mon Sep 01, 2003 2:33 pm
Posts: 914
-- Profanity removed--


Last edited by LuCiFeR[SD] on Thu Jan 24, 2013 4:59 pm, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: LoadMovie still has issues
PostPosted: Thu Jan 24, 2013 4:55 pm 
Offline
Addict
Addict

Joined: Tue Feb 22, 2011 1:16 pm
Posts: 1459
[Edit] Lucifer, chill. I made a mistake, I even misread your post. I'm to blame. Post edited because it's invalid. :)

_________________
Microsoft Visual Basic only lasted 7 short years: 1991 to 1998.
PureBasic: Born in 1998 and still going strong to this very day!


Last edited by MachineCode on Thu Jan 24, 2013 5:15 pm, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: LoadMovie still has issues
PostPosted: Thu Jan 24, 2013 5:04 pm 
Offline
666
666

Joined: Mon Sep 01, 2003 2:33 pm
Posts: 914
nah, if there is one thing that today has taught me is I reeeeealllly just need to shut the hell up. Don't worry MC, I'm a bit wound up, but i'll get over it ;)

But I am going to go back to my old "Never post" ways. For some reason or another, I just get under peoples skin. And then I rare up like some kind of monster. I am really just getting to old for this shit.

Back to radio silence... that should please Fred anyway :).


Top
 Profile  
 
 Post subject: Re: LoadMovie still has issues
PostPosted: Thu Jan 24, 2013 5:14 pm 
Offline
Addict
Addict

Joined: Tue Feb 22, 2011 1:16 pm
Posts: 1459
No problem, Lucifer. I just can't work out what I'm doing wrong here anyway. Using "PlayMovie(music,app)" is indeed valid, I've done nothing wrong. Can't figure this out. Need to come back another day.

_________________
Microsoft Visual Basic only lasted 7 short years: 1991 to 1998.
PureBasic: Born in 1998 and still going strong to this very day!


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 14 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye