APP is hang when reverse direction

hungbattran tranhung93.it at gmail.com
Sun Apr 2 14:18:14 UTC 2017


I'm a newbee of gstreamer program. I tried to create a Player to play .MKV
file. I met a issue, when I call rewind function that reverse direction then
my app is hanging. This is my function:

/gboolean Player::trickplay(gint64 position, gdouble rate)
{
    gint64 duration;
    gint64 start, stop;
    if (!this->pipeline) {
        PRINT_ERR("[Player][Error] There isn't a pipeline.\n");
    return FALSE;
}

/* Get duration to encure the position can not be out of the stream */
    if (!getDuration(&duration)) {
        PRINT_ERR ("[Player][Info] Failed get duration.\n");
        return FALSE;0
    }
    if (position < 0)
        position = 0;
    else if (position > duration)
        position = duration;

    if ( rate > 0 ) { /* Run forward from current position to end (positon
-> -1) */
        start = position;
        stop = -1;
    } else { /* Run backward from current position to start (positon -> 0)
*/
        start = 0;
        stop = position;
    }
    if (!gst_element_seek(this->pipeline, rate, GST_FORMAT_TIME,
            (GstSeekFlags)(GST_SEEK_FLAG_FLUSH | GST_SEEK_FLAG_ACCURATE),
                        GST_SEEK_TYPE_SET, start, GST_SEEK_TYPE_SET, stop))
{
        PRINT_ERR("[Player][Error] Seeking error.\n");
        return FALSE;
    }
    PRINT_INF("trickplay: start=%" GST_TIME_FORMAT "
stop=%"GST_TIME_FORMAT"\n",
    GST_TIME_ARGS(start), GST_TIME_ARGS(stop));
    return TRUE;
}/
When I tried to play backward from current position to start: rate = -2,
start = 0 and stop = position then app is hang and can't start again. App
play .MKV file.

Anyone know root cause, please explain to me in advance. Thank so much.



--
View this message in context: http://gstreamer-devel.966125.n4.nabble.com/APP-is-hang-when-reverse-direction-tp4682489.html
Sent from the GStreamer-devel mailing list archive at Nabble.com.


More information about the gstreamer-devel mailing list