m4myo / python-mplayer

Automatically exported from code.google.com/p/python-mplayer
GNU Lesser General Public License v3.0
0 stars 0 forks source link

GtkPlayerView exits on source change #3

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create  sample program that uses GtkPlayerView (Qt probably also)
2. Use player.loadfile
3. change the loaded file by calling player.loadfile again

What is the expected output? What do you see instead?
Expected is to switch the video file playing.
Insteda the application is closed.

What version of the product are you using? On what operating system?
latest hg clone from today (March 18)

Please provide any additional information below.

Some debugging showed that during changing the files
GtkPlayerView._handle_data is called. It assumes that
once you get "EOF code" this is the end.

In mp_core.h there are the EOF codes:
#define PT_NEXT_ENTRY 1
#define PT_PREV_ENTRY -1
#define PT_NEXT_SRC 2
#define PT_PREV_SRC -2
#define PT_UP_NEXT 3
#define PT_UP_PREV -3
#define PT_STOP 4

I changed the method to check for "EOF code: 4"
which works for me.

Original issue reported on code.google.com by nicknick...@gmail.com on 18 Mar 2011 at 10:30

GoogleCodeExporter commented 9 years ago
Actually, the application will not close unless you connect the 'complete' 
signal to gtk.main_quit(). But I guess that's where the problem lies--what does 
the 'complete' signal actually mean?

First of all, thank you for bringing this up. I haven't really focused on the 
GTK/Qt-integration classes lately. I think a better approach would be to get 
rid of the 'complete' signal altogether and just replace it with seven separate 
signals namely:

1. pt_next_entry
2. pt_prev_entry
3. pt_next_src
4. pt_prev_src
5. pt_up_next
6. pt_up_prev
7. pt_stop

This way, the corresponding signal would be emitted depending on the EOF code.

Original comment by daru...@gmail.com on 19 Mar 2011 at 6:44

GoogleCodeExporter commented 9 years ago
This has been fixed/improved since revision e03cdd3f41e9.
The complete/completed signal has been replaced with the 'eof' signal. The main 
difference is that with the 'eof' signal, the EOF code is passed to its 
callbacks/slots.

Original comment by daru...@gmail.com on 28 Aug 2011 at 3:18