gst_element_query_position is stuck at end position in reverse playback

Gregoire Gentil gregoire at gentil.com
Tue Feb 11 19:00:45 UTC 2020


Hello,

I'm using this tutorial:

https://gstreamer.freedesktop.org/documentation/tutorials/basic/playback-speed.html?gi-language=c

If I add the action advance_frame with the following code:

case 'a': gst_element_send_event(data->pipeline, 
gst_event_new_step(GST_FORMAT_BUFFERS, 1, 1.0, TRUE, FALSE));
gint64 position;
gst_element_query_position(data->pipeline, GST_FORMAT_TIME, &position); 
fprintf(stderr, "position:%ld", position);
break;

It's working properly, one frame is advanced and the position is 
incremented.

If I do 'd' to backward the rate and I do the same action advance_frame, 
the previous frame is shown on screen but the position remains the same. 
I can go back as many frames as I want, the display is correctly updated 
but the position remains stuck at the position when the rate was inverted.

This is happening with multiple containers such as: webm, ps, ts, matroska

To reproduce the issue:

wget http://gentil.com/tmp/a.zip
unzip a.zip
gcc a.c `pkg-config --cflags --libs gstreamer-1.0` && ./a.out

Then press:
P
a
a
a
D
a
a
a
q

That gives the following output:

P
Setting state to PAUSE
a
position:10557831391
a
position:10582000000
a
position:10603000000
D
Current rate: -1
a
position:10625000000
a
position:10625000000
a
position:10625000000
q


Is this a known issue?

Grégoire



More information about the gstreamer-devel mailing list