Appsink misses last buffer

dingoegret sephvelut at gmail.com
Tue Jul 4 19:27:23 UTC 2017


I have a simple pipeline of the following:

/udpsrc -> rtppcmudepay -> appsink/

I am grabbing buffers from appsink via:

/g_signal_connect(appsink, "new-sample", G_CALLBACK(new_sample), NULL);/

and my callback is:

/static GstFlowReturn new_sample(GstElement *sink) {
    GstSample *sample;
    g_signal_emit_by_name(sink, "pull-sample", &sample, NULL);
    if (sample) {
        GstBuffer *buffer = gst_sample_get_buffer(sample);
        GstBuffer *app_buffer = gst_buffer_copy (buffer);

        gst_sample_unref(sample);

        GstMapInfo info;
        gst_buffer_map(app_buffer , &info, GST_MAP_READ);

        fwrite(info.data, sizeof(unsigned char), info.size, file);

        gst_buffer_unmap(app_buffer, &info);
    }

    return GST_FLOW_OK;
}/

I send a stream of audio to this pipeline via:

/gst-launch-1.0 filesrc location=sample.wav ! wavparse ! audioconvert !
mulawenc ! rtppcmupay ! udpsink host=127.0.0.1 port=6000/

I am able to open the saved file from /fwrite/ and it plays fine, but it is
always missing the last second of audio. It cuts off. But if I include a
mulawdec in my pipeline:

/udpsrc -> rtppcmudepay -> mulawdec -> appsink/

Then I get that very last second of audio that was missing in the raw mulaw
attempt. What is going on?



--
View this message in context: http://gstreamer-devel.966125.n4.nabble.com/Appsink-misses-last-buffer-tp4683680.html
Sent from the GStreamer-devel mailing list archive at Nabble.com.


More information about the gstreamer-devel mailing list