gst_segment_to_running_time assertion
Shawn Lewis
shlewis at gmail.com
Mon Jul 7 11:06:28 PDT 2014
Has anyone been able to reproduce this with the attached program?
On Thu, Jul 3, 2014 at 2:39 PM, Shawn Lewis <shlewis at gmail.com> wrote:
> Here's a modified appsrc-stream.c that reproduces the problem. "/*
> RAWBUG */" comments in the important places I modified.
>
> I think I'm probably doing something that's not threadsafe.
>
> sample.raw reproduces the problem. It doesn't always print the
> gst_segment_to_running_time assertion, but it never plays the file the
> second time.
>
> If you remove the call to gst_app_src_set_new_caps and pass in a
> regular wav file, the file will place twice as expected.
>
> On Thu, Jul 3, 2014 at 1:45 AM, Sebastian Dröge
> <sebastian at centricular.com> wrote:
>> On Mi, 2014-07-02 at 17:21 -0700, Shawn Lewis wrote:
>>> Hi, I've got appsrc -> playbin, for audio only. I'm trying to reset
>>> the pipeline if the user interrupts playback with a new track, by
>>> setting the state to NULL, setting a new uri ("appsrc://"), and then
>>> setting the state to PAUSED.
>>>
>>> This works if I let playbin detect caps, but I need to manually set
>>> caps on appsrc sometimes.
>>>
>>> If I manually set the caps on appsrc during the source_found callback
>>> ('deep-notify::source') by doing:
>>>
>>> static void
>>> found_source (GObject * object, GObject * orig, GParamSpec * pspec, GstApp * app
>>> )
>>> {
>>> GstCaps* caps;
>>>
>>> g_object_get (orig, pspec->name, &app->appsrc, NULL);
>>>
>>> caps = gst_caps_new_simple("audio/x-raw",
>>> "format", G_TYPE_STRING, "S16LE",
>>> "layout", G_TYPE_STRING, "interleaved",
>>> "rate", G_TYPE_INT, 44100,
>>> "channels", G_TYPE_INT, 2,
>>> NULL);
>>> gst_app_src_set_caps(GST_APP_SRC(gst_app->appsrc), caps);
>>> gst_base_src_set_format(GST_BASE_SRC(gst_app->appsrc), GST_FORMAT_TIME);
>>> gst_caps_unref(caps);
>>>
>>> gst_element_set_state (gst_app->playbin, GST_STATE_PLAYING);
>>> }
>>>
>>> things work the first time through. But when I switch tracks via the
>>> above method (still manually setting caps), I get the following error.
>>> I've seen some references elsewhere on the list to this error but
>>> haven't been able to find a solution.
>>>
>>> GStreamer-CRITICAL **: gst_segment_to_running_time: assertion
>>> `segment->format == format' failed
>>
>> Hi,
>>
>> what you describe there should work in theory. Independent of that, why
>> are you setting the playbin to PLAYING inside the found_source callback?
>>
>> Can you provide a simple testcase that others can run to reproduce the
>> issue? That will make it easier for everybody to find the exact problem
>> other than just guessing.
>>
>> --
>> Sebastian Dröge, Centricular Ltd - http://www.centricular.com
>> Expertise, Straight from the Source
>>
>> _______________________________________________
>> gstreamer-devel mailing list
>> gstreamer-devel at lists.freedesktop.org
>> http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
>>
More information about the gstreamer-devel
mailing list