ext/mikmod/gstmikmod.*: make mikmod's loop function not loop infinitely and call gst_element_yield anymore
Original commit message from CVS: * ext/mikmod/gstmikmod.c: (gst_mikmod_init), (gst_mikmod_loop), (gst_mikmod_change_state): * ext/mikmod/gstmikmod.h: make mikmod's loop function not loop infinitely and call gst_element_yield anymore * gst/modplug/gstmodplug.cc: fix pad negotiation
This commit is contained in:
parent
1e292a5bd3
commit
3faf623b27
10
ChangeLog
10
ChangeLog
@ -1,3 +1,13 @@
|
|||||||
|
2004-03-09 Benjamin Otte <otte@gnome.org>
|
||||||
|
|
||||||
|
* ext/mikmod/gstmikmod.c: (gst_mikmod_init), (gst_mikmod_loop),
|
||||||
|
(gst_mikmod_change_state):
|
||||||
|
* ext/mikmod/gstmikmod.h:
|
||||||
|
make mikmod's loop function not loop infinitely and call
|
||||||
|
gst_element_yield anymore
|
||||||
|
* gst/modplug/gstmodplug.cc:
|
||||||
|
fix pad negotiation
|
||||||
|
|
||||||
2004-03-09 David Schleef <ds@schleef.org>
|
2004-03-09 David Schleef <ds@schleef.org>
|
||||||
|
|
||||||
* ext/lcs/Makefile.am: Fix so that the lcs colorspace plugin
|
* ext/lcs/Makefile.am: Fix so that the lcs colorspace plugin
|
||||||
|
@ -230,6 +230,8 @@ gst_mikmod_init (GstMikMod *filter)
|
|||||||
filter->sndfxvolume = 128;
|
filter->sndfxvolume = 128;
|
||||||
filter->songname = NULL;
|
filter->songname = NULL;
|
||||||
filter->modtype = NULL;
|
filter->modtype = NULL;
|
||||||
|
|
||||||
|
filter->initialized = FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static GstCaps *
|
static GstCaps *
|
||||||
@ -288,60 +290,55 @@ gst_mikmod_loop (GstElement *element)
|
|||||||
srcpad = mikmod->srcpad;
|
srcpad = mikmod->srcpad;
|
||||||
mikmod->Buffer = NULL;
|
mikmod->Buffer = NULL;
|
||||||
|
|
||||||
while ((buffer_in = GST_BUFFER (gst_pad_pull( mikmod->sinkpad )))) {
|
if (!mikmod->initialized) {
|
||||||
if ( GST_IS_EVENT (buffer_in) ) {
|
while ((buffer_in = GST_BUFFER (gst_pad_pull( mikmod->sinkpad )))) {
|
||||||
GstEvent *event = GST_EVENT (buffer_in);
|
if ( GST_IS_EVENT (buffer_in) ) {
|
||||||
|
GstEvent *event = GST_EVENT (buffer_in);
|
||||||
|
|
||||||
if (GST_EVENT_TYPE (event) == GST_EVENT_EOS)
|
if (GST_EVENT_TYPE (event) == GST_EVENT_EOS)
|
||||||
break;
|
break;
|
||||||
}
|
} else {
|
||||||
else
|
if ( mikmod->Buffer ) {
|
||||||
{
|
GstBuffer *merge;
|
||||||
if ( mikmod->Buffer ) {
|
merge = gst_buffer_merge( mikmod->Buffer, buffer_in );
|
||||||
GstBuffer *merge;
|
gst_buffer_unref( buffer_in );
|
||||||
merge = gst_buffer_merge( mikmod->Buffer, buffer_in );
|
gst_buffer_unref( mikmod->Buffer );
|
||||||
gst_buffer_unref( buffer_in );
|
mikmod->Buffer = merge;
|
||||||
gst_buffer_unref( mikmod->Buffer );
|
} else {
|
||||||
mikmod->Buffer = merge;
|
mikmod->Buffer = buffer_in;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
}
|
||||||
mikmod->Buffer = buffer_in;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!GST_PAD_CAPS (mikmod->srcpad)) {
|
if (!GST_PAD_CAPS (mikmod->srcpad)) {
|
||||||
if (GST_PAD_LINK_SUCCESSFUL (gst_pad_renegotiate (mikmod->srcpad))) {
|
if (GST_PAD_LINK_SUCCESSFUL (gst_pad_renegotiate (mikmod->srcpad))) {
|
||||||
GST_ELEMENT_ERROR (mikmod, CORE, NEGOTIATION, (NULL), (NULL));
|
GST_ELEMENT_ERROR (mikmod, CORE, NEGOTIATION, (NULL), (NULL));
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
MikMod_RegisterDriver(&drv_gst);
|
||||||
|
MikMod_RegisterAllLoaders();
|
||||||
|
|
||||||
|
MikMod_Init("");
|
||||||
|
reader = GST_READER_new( mikmod );
|
||||||
|
module = Player_LoadGeneric ( reader, 64, 0 );
|
||||||
|
|
||||||
|
gst_buffer_unref (mikmod->Buffer);
|
||||||
|
|
||||||
|
if ( ! Player_Active() )
|
||||||
|
Player_Start(module);
|
||||||
|
|
||||||
|
mikmod->initialized = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
MikMod_RegisterDriver(&drv_gst);
|
|
||||||
MikMod_RegisterAllLoaders();
|
|
||||||
|
|
||||||
MikMod_Init("");
|
if ( Player_Active() ) {
|
||||||
reader = GST_READER_new( mikmod );
|
timestamp = ( module->sngtime / 1024.0 ) * GST_SECOND;
|
||||||
module = Player_LoadGeneric ( reader, 64, 0 );
|
drv_gst.Update();
|
||||||
|
} else {
|
||||||
gst_buffer_unref (mikmod->Buffer);
|
gst_element_set_eos (GST_ELEMENT (mikmod));
|
||||||
|
gst_pad_push (mikmod->srcpad, GST_DATA (gst_event_new (GST_EVENT_EOS)));
|
||||||
if ( ! Player_Active() )
|
}
|
||||||
Player_Start(module);
|
|
||||||
|
|
||||||
do {
|
|
||||||
if ( Player_Active() ) {
|
|
||||||
|
|
||||||
timestamp = ( module->sngtime / 1024.0 ) * GST_SECOND;
|
|
||||||
drv_gst.Update();
|
|
||||||
gst_element_yield (element);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
gst_element_set_eos (GST_ELEMENT (mikmod));
|
|
||||||
gst_pad_push (mikmod->srcpad, GST_DATA (gst_event_new (GST_EVENT_EOS)));
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
while ( 1 );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -405,7 +402,7 @@ GstMikMod *mikmod;
|
|||||||
Player_TogglePause();
|
Player_TogglePause();
|
||||||
Player_SetPosition( 0 );
|
Player_SetPosition( 0 );
|
||||||
}
|
}
|
||||||
|
mikmod->initialized = FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (GST_STATE_PENDING (element) == GST_STATE_PLAYING)
|
if (GST_STATE_PENDING (element) == GST_STATE_PLAYING)
|
||||||
|
@ -63,6 +63,8 @@ struct _GstMikMod {
|
|||||||
gboolean soft_music;
|
gboolean soft_music;
|
||||||
gboolean soft_sndfx;
|
gboolean soft_sndfx;
|
||||||
gboolean stereo;
|
gboolean stereo;
|
||||||
|
|
||||||
|
gboolean initialized;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct _GstMikModClass {
|
struct _GstMikModClass {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user