mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-10-22 10:23:47 +00:00
some state change fixes
Original commit message from CVS: some state change fixes
This commit is contained in:
parent
0edcf0eccb
commit
3c1f0c5a8e
2 changed files with 15 additions and 2 deletions
|
@ -370,6 +370,8 @@ gst_modplug_init (GstModPlug *modplug)
|
||||||
modplug->_16bit = TRUE;
|
modplug->_16bit = TRUE;
|
||||||
modplug->channel = 2;
|
modplug->channel = 2;
|
||||||
modplug->frequency = 44100;
|
modplug->frequency = 44100;
|
||||||
|
modplug->audiobuffer = NULL;
|
||||||
|
modplug->buffer_in = NULL;
|
||||||
|
|
||||||
modplug->state = MODPLUG_STATE_NEED_TUNE;
|
modplug->state = MODPLUG_STATE_NEED_TUNE;
|
||||||
}
|
}
|
||||||
|
@ -688,6 +690,7 @@ gst_modplug_loop (GstElement *element)
|
||||||
}
|
}
|
||||||
|
|
||||||
modplug->mSoundFile->Create (modplug->buffer_in, modplug->song_size);
|
modplug->mSoundFile->Create (modplug->buffer_in, modplug->song_size);
|
||||||
|
modplug->opened = TRUE;
|
||||||
|
|
||||||
gst_bytestream_flush (modplug->bs, modplug->song_size);
|
gst_bytestream_flush (modplug->bs, modplug->song_size);
|
||||||
modplug->buffer_in = NULL;
|
modplug->buffer_in = NULL;
|
||||||
|
@ -783,8 +786,13 @@ gst_modplug_change_state (GstElement *element)
|
||||||
break;
|
break;
|
||||||
case GST_STATE_PAUSED_TO_READY:
|
case GST_STATE_PAUSED_TO_READY:
|
||||||
gst_bytestream_destroy (modplug->bs);
|
gst_bytestream_destroy (modplug->bs);
|
||||||
|
modplug->bs = NULL;
|
||||||
|
if (modplug->opened)
|
||||||
|
{
|
||||||
modplug->mSoundFile->Destroy ();
|
modplug->mSoundFile->Destroy ();
|
||||||
g_free (modplug->audiobuffer);
|
modplug->opened = FALSE;
|
||||||
|
}
|
||||||
|
if (modplug->audiobuffer) g_free (modplug->audiobuffer);
|
||||||
modplug->buffer_in = NULL;
|
modplug->buffer_in = NULL;
|
||||||
modplug->audiobuffer = NULL;
|
modplug->audiobuffer = NULL;
|
||||||
gst_caps_unref (modplug->streaminfo);
|
gst_caps_unref (modplug->streaminfo);
|
||||||
|
@ -955,3 +963,7 @@ GstPluginDesc plugin_desc = {
|
||||||
"modplug",
|
"modplug",
|
||||||
plugin_init
|
plugin_init
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -78,6 +78,7 @@ struct _GstModPlug {
|
||||||
guint64 song_size;
|
guint64 song_size;
|
||||||
|
|
||||||
CSoundFile *mSoundFile;
|
CSoundFile *mSoundFile;
|
||||||
|
gboolean opened; /* set to TRUE when mSoundFile is created */
|
||||||
};
|
};
|
||||||
|
|
||||||
struct _GstModPlugClass {
|
struct _GstModPlugClass {
|
||||||
|
|
Loading…
Reference in a new issue