Various changes and cleanups.

Original commit message from CVS:
Various changes and cleanups.
This commit is contained in:
Wim Taymans 2001-12-22 21:18:53 +00:00
parent 540911c0ad
commit 7d8f9d559f

View file

@ -159,18 +159,14 @@ gst_mad_input (void *user_data,
mad = GST_MAD (user_data); mad = GST_MAD (user_data);
// HACK HACK HACK HACK because mad's API is fragged, we have to try to /* we yield here because the loop function doesn't return */
// trap COTHREAD_STOPPING here gst_element_yield (GST_ELEMENT (mad));
if (GST_ELEMENT_IS_COTHREAD_STOPPING (mad)) {
GST_DEBUG(0, "HACK HACK HACK, switching to cothread zero on COTHREAD_STOPPING\n");
cothread_switch(cothread_current_main());
}
do { do {
GstBuffer *inbuf; GstBuffer *inbuf;
inbuf = gst_pad_pull (mad->sinkpad); inbuf = gst_pad_pull (mad->sinkpad);
// deal with events /* deal with events */
if (GST_IS_EVENT (inbuf)) { if (GST_IS_EVENT (inbuf)) {
GstEvent *event = GST_EVENT (inbuf); GstEvent *event = GST_EVENT (inbuf);
@ -375,14 +371,13 @@ static void
gst_mad_loop (GstElement *element) gst_mad_loop (GstElement *element)
{ {
GstMad *mad; GstMad *mad;
gint ret;
mad = GST_MAD (element); mad = GST_MAD (element);
do { GST_DEBUG (0, "decoder_run\n");
GST_DEBUG (0, "decoder_run\n"); ret = mad_decoder_run (&mad->decoder, MAD_DECODER_MODE_SYNC);
mad_decoder_run (&mad->decoder, MAD_DECODER_MODE_SYNC); GST_DEBUG (0, "decoder_run done %d\n", ret);
GST_DEBUG (0, "decoder_run done\n");
} while (!GST_ELEMENT_IS_COTHREAD_STOPPING (element));
} }