Wrote my first plugin but I keep getting 'gst_segment_clip' error

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Wrote my first plugin but I keep getting 'gst_segment_clip' error

danielkun

Hello,

I wrote a Gstreamer plugin that converts network byte order to little
endian to be able to play LPCM files.

The plugin works fine except for the error message below that appears
once after execution.
Does anyone know what is causing this?

(test_plugin:7275): GStreamer-CRITICAL **: gst_segment_clip: assertion
'segment->format == format' failed

I pasted the code at the end.

Thank you,
Daniel

--

static GstFlowReturn
gst_endianconvert_chain (GstPad * pad, GstBuffer * buf)
{
  guint32 size;
  guint8 *data;
  Gstendianconvert *filter;

  size = GST_BUFFER_SIZE (buf);
  data = GST_BUFFER_DATA (buf);

  unsigned char c2;
  int i;

  for (i = 0; i < size; i += 2) {
    c2 = data[i + 1];
    data[i + 1] = data[i];
    data[i] = c2;
  }

  filter = GST_ENDIANCONVERT (GST_OBJECT_PARENT (pad));

  return gst_pad_push (filter->srcpad, buf);
}


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Wrote my first plugin but I keep getting 'gst_segment_clip' error

Michael Smith-32
On Thu, 2008-02-28 at 23:41 -0700, [hidden email] wrote:
> Hello,
>
> I wrote a Gstreamer plugin that converts network byte order to little
> endian to be able to play LPCM files.

audioconvert can do that, you don't need to write a new plugin.

>
> The plugin works fine except for the error message below that appears
> once after execution.
> Does anyone know what is causing this?
>
> (test_plugin:7275): GStreamer-CRITICAL **: gst_segment_clip: assertion
> 'segment->format == format' failed

There's other code somewhere that you didn't include; the bug is there.
You need to send a proper new segment event before you start sending
data.

Mike

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel