gst/synaesthesia/gstsynaesthesia.c: check result of gst_pad_push() in _chain.

Original commit message from CVS:
* gst/synaesthesia/gstsynaesthesia.c:
(gst_synaesthesia_class_init), (gst_synaesthesia_init),
(gst_synaesthesia_sink_setcaps), (gst_synaesthesia_src_getcaps),
(gst_synaesthesia_chain), (plugin_init):
check result of gst_pad_push() in _chain.
This commit is contained in:
Stefan Kost 2007-02-09 08:03:09 +00:00
parent 228c0d94c5
commit 9f8cdabb6c
2 changed files with 17 additions and 5 deletions

View file

@ -1,3 +1,11 @@
2007-02-09 Stefan Kost <ensonic@users.sf.net>
* gst/synaesthesia/gstsynaesthesia.c:
(gst_synaesthesia_class_init), (gst_synaesthesia_init),
(gst_synaesthesia_sink_setcaps), (gst_synaesthesia_src_getcaps),
(gst_synaesthesia_chain), (plugin_init):
check result of gst_pad_push() in _chain.
2007-02-09 Stefan Kost <ensonic@users.sf.net>
* gst/synaesthesia/Makefile.am:

View file

@ -412,30 +412,34 @@ gst_synaesthesia_chain (GstPad * pad, GstBuffer * buffer)
ret =
gst_pad_alloc_buffer_and_set_caps (synaesthesia->srcpad,
GST_BUFFER_OFFSET_NONE, synaesthesia->width * synaesthesia->height * 4,
GST_BUFFER_OFFSET_NONE,
synaesthesia->width * synaesthesia->height * 4,
GST_PAD_CAPS (synaesthesia->srcpad), &outbuf);
/* no buffer allocated, we don't care why. */
if (ret != GST_FLOW_OK)
goto done;
break;
GST_BUFFER_TIMESTAMP (outbuf) =
synaesthesia->audio_basetime +
(GST_SECOND * synaesthesia->samples_consumed /
synaesthesia->sample_rate);
GST_BUFFER_DURATION (outbuf) = frame_duration;
GST_BUFFER_SIZE (outbuf) = synaesthesia->width * synaesthesia->height * 4;
out_frame = (guchar *) synaesthesia_update (synaesthesia->datain);
memcpy (GST_BUFFER_DATA (outbuf), out_frame, GST_BUFFER_SIZE (outbuf));
gst_pad_push (synaesthesia->srcpad, outbuf);
ret = gst_pad_push (synaesthesia->srcpad, outbuf);
outbuf = NULL;
if (ret != GST_FLOW_OK)
break;
synaesthesia->samples_consumed += samples_per_frame;
gst_adapter_flush (synaesthesia->adapter, samples_per_frame *
synaesthesia->channels * sizeof (gint16));
}
done:
gst_object_unref (synaesthesia);
return ret;