mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-19 16:21:17 +00:00
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:
parent
228c0d94c5
commit
9f8cdabb6c
2 changed files with 17 additions and 5 deletions
|
@ -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>
|
2007-02-09 Stefan Kost <ensonic@users.sf.net>
|
||||||
|
|
||||||
* gst/synaesthesia/Makefile.am:
|
* gst/synaesthesia/Makefile.am:
|
||||||
|
|
|
@ -412,30 +412,34 @@ gst_synaesthesia_chain (GstPad * pad, GstBuffer * buffer)
|
||||||
|
|
||||||
ret =
|
ret =
|
||||||
gst_pad_alloc_buffer_and_set_caps (synaesthesia->srcpad,
|
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);
|
GST_PAD_CAPS (synaesthesia->srcpad), &outbuf);
|
||||||
|
|
||||||
/* no buffer allocated, we don't care why. */
|
/* no buffer allocated, we don't care why. */
|
||||||
if (ret != GST_FLOW_OK)
|
if (ret != GST_FLOW_OK)
|
||||||
goto done;
|
break;
|
||||||
|
|
||||||
GST_BUFFER_TIMESTAMP (outbuf) =
|
GST_BUFFER_TIMESTAMP (outbuf) =
|
||||||
synaesthesia->audio_basetime +
|
synaesthesia->audio_basetime +
|
||||||
(GST_SECOND * synaesthesia->samples_consumed /
|
(GST_SECOND * synaesthesia->samples_consumed /
|
||||||
synaesthesia->sample_rate);
|
synaesthesia->sample_rate);
|
||||||
GST_BUFFER_DURATION (outbuf) = frame_duration;
|
GST_BUFFER_DURATION (outbuf) = frame_duration;
|
||||||
GST_BUFFER_SIZE (outbuf) = synaesthesia->width * synaesthesia->height * 4;
|
|
||||||
|
|
||||||
out_frame = (guchar *) synaesthesia_update (synaesthesia->datain);
|
out_frame = (guchar *) synaesthesia_update (synaesthesia->datain);
|
||||||
memcpy (GST_BUFFER_DATA (outbuf), out_frame, GST_BUFFER_SIZE (outbuf));
|
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;
|
synaesthesia->samples_consumed += samples_per_frame;
|
||||||
gst_adapter_flush (synaesthesia->adapter, samples_per_frame *
|
gst_adapter_flush (synaesthesia->adapter, samples_per_frame *
|
||||||
synaesthesia->channels * sizeof (gint16));
|
synaesthesia->channels * sizeof (gint16));
|
||||||
}
|
}
|
||||||
|
|
||||||
done:
|
|
||||||
gst_object_unref (synaesthesia);
|
gst_object_unref (synaesthesia);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
|
Loading…
Reference in a new issue