update dev300-m57
[ooovba.git] / applied_patches / 0502-gstreamer-avmedia-loopingetc.diff
blob3e9f9359e58b91e9b54af5b837c2b665e1218423
1 diff -ru avmedia.orig/source/gstreamer/gstplayer.cxx avmedia/source/gstreamer/gstplayer.cxx
2 --- avmedia.orig/source/gstreamer/gstplayer.cxx 2009-04-28 09:15:14.000000000 +0100
3 +++ avmedia/source/gstreamer/gstplayer.cxx 2009-04-28 09:11:50.000000000 +0100
4 @@ -67,6 +67,7 @@
5 mpPlaybin( NULL ),
6 mbFakeVideo (sal_False ),
7 mnUnmutedVolume( 0 ),
8 + mbPlayPending ( false ),
9 mbMuted( false ),
10 mbLooping( false ),
11 mbInitialized( false ),
12 @@ -140,6 +141,9 @@
13 case GST_MESSAGE_EOS:
14 //DBG( "EOS, reset state to NULL" );
15 gst_element_set_state( mpPlaybin, GST_STATE_READY );
16 + mbPlayPending = false;
17 + if (mbLooping)
18 + start();
19 break;
20 case GST_MESSAGE_STATE_CHANGED:
21 if( message->src == GST_OBJECT( mpPlaybin ) ) {
22 @@ -151,6 +155,9 @@
23 pendingstate == GST_STATE_VOID_PENDING &&
24 mpXOverlay )
25 gst_x_overlay_expose( mpXOverlay );
27 + if (mbPlayPending)
28 + mbPlayPending = ((newstate == GST_STATE_READY) || (newstate == GST_STATE_PAUSED));
30 default:
31 break;
32 @@ -250,6 +257,7 @@
34 if( mpPlaybin != NULL ) {
35 gst_element_set_state( mpPlaybin, GST_STATE_NULL );
36 + mbPlayPending = false;
37 g_object_unref( mpPlaybin );
40 @@ -281,6 +289,7 @@
41 preparePlaybin( rURL, true );
43 gst_element_set_state( mpPlaybin, GST_STATE_PAUSED );
44 + mbPlayPending = false;
46 bRet = true;
48 @@ -305,6 +314,7 @@
49 if( mbInitialized && NULL != mpPlaybin )
51 gst_element_set_state( mpPlaybin, GST_STATE_PLAYING );
52 + mbPlayPending = true;
56 @@ -317,6 +327,7 @@
57 if( mpPlaybin )
58 gst_element_set_state( mpPlaybin, GST_STATE_PAUSED );
60 + mbPlayPending = false;
61 DBG( "stop %p", mpPlaybin );
64 @@ -325,10 +336,10 @@
65 sal_Bool SAL_CALL Player::isPlaying()
66 throw (uno::RuntimeException)
68 - bool bRet = false;
69 + bool bRet = mbPlayPending;
71 // return whether the pipeline is in PLAYING STATE or not
72 - if( mbInitialized && mpPlaybin )
73 + if( !mbPlayPending && mbInitialized && mpPlaybin )
75 bRet = GST_STATE_PLAYING == GST_STATE( mpPlaybin );
77 diff -ru avmedia.orig/source/gstreamer/gstplayer.hxx avmedia/source/gstreamer/gstplayer.hxx
78 --- avmedia.orig/source/gstreamer/gstplayer.hxx 2009-04-28 09:15:14.000000000 +0100
79 +++ avmedia/source/gstreamer/gstplayer.hxx 2009-04-28 09:11:01.000000000 +0100
80 @@ -101,6 +101,7 @@
81 sal_Bool mbFakeVideo;
83 gdouble mnUnmutedVolume;
84 + sal_Bool mbPlayPending;
85 sal_Bool mbMuted;
86 sal_Bool mbLooping;
87 sal_Bool mbInitialized;