After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 599389 - Appsrc & playbin2 reading too much data,
Appsrc & playbin2 reading too much data,
Status: RESOLVED NOTABUG
Product: GStreamer
Classification: Platform
Component: gst-plugins-base
0.10.23
Other Windows
: Normal normal
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2009-10-23 10:22 UTC by Adam
Modified: 2009-10-27 11:07 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Adam 2009-10-23 10:22:42 UTC
Hi, using version 0.10.23 of the base plugins, I am attempting to use appsrc & playbin2 to stream some music files.

All works fine until I attempt to seek to a position in the song.

I register my seek-data & need-data callbacks as follows:
g_signal_connect (app->appsrc, "need-data", G_CALLBACK (feed_data), app);
g_signal_connect (app->appsrc, "seek-data", G_CALLBACK (seek_data), app);

I have a seek to time function which makes a call to gst_element_seek as follows:
gst_element_seek (pipeline, 1.0, GST_FORMAT_TIME, (GstSeekFlags)GST_SEEK_FLAG_FLUSH, GST_SEEK_TYPE_SET, offset, GST_SEEK_TYPE_NONE, GST_CLOCK_TIME_NONE)

When I attempt to seek to a position, I see my call to seek-data called with the correct offset, my feed-data is then called as expected, but, I then see a massive loop of seek_data & feed_data.

The amount of loops seems related to the position I am seeking to, i.e if I seek to byte 100 (Illustrative) I seek direct to byte 100 then read a further 100 bytes! If my file is only 150 bytes, I get an EOS and stop.

Is this a bug or am I using these functions incorrectly?
Thanks.
Comment 1 Jan Schmidt 2009-10-23 10:35:03 UTC
Have you set the 'stream-type' property on appsrc?

  stream-type         : the type of the stream
                        flags: readable, writable
                        Enum "GstAppStreamType" Default: 0, "stream" Current: 0, "stream"
                           (0): stream           - Stream
                           (1): seekable         - Seekable
                           (2): random-access    - Random Access
Comment 2 Adam 2009-10-23 11:03:42 UTC
I am using stream-type: "seekable".
gst_util_set_object_arg (G_OBJECT (app->appsrc), "stream-type", "seekable");

I also tried "random-access" but can't even get a song to play, I get an 
error: internal data flow error. To be honest  I havent played much with 
the random-access option.
Comment 3 Wim Taymans 2009-10-27 11:07:17 UTC
did you try with the examples in gst-plugins-base/tests/examples/app/ ? the appsrc-ra.c example should show how to deal with random access sources.

Reopen if those example fail for you.