gst_dash_demux_wait_stop (demux);
/* select the requested Period in the Media Presentation */
- target_pos = (GstClockTime) demux->segment.start;
+ if (demux->segment.rate > 0.0)
+ target_pos = (GstClockTime) demux->segment.start;
+ else
+ target_pos = (GstClockTime) demux->segment.stop;
GST_DEBUG_OBJECT (demux, "Seeking to target %" GST_TIME_FORMAT,
GST_TIME_ARGS (target_pos));
current_period = 0;
}
g_mutex_lock (&stream->fragment_download_lock);
- if (gst_mpd_client_get_next_fragment (demux->client, stream_idx, fragment)) {
+ if (gst_mpd_client_get_next_fragment (demux->client, stream_idx, fragment,
+ stream->demux->segment.rate > 0.0)) {
GST_INFO_OBJECT (stream->pad,
"Fetching next fragment %s ts:%" GST_TIME_FORMAT " dur:%"
GST_TIME_FORMAT " Range:%" G_GINT64_FORMAT "-%" G_GINT64_FORMAT,
gboolean
gst_mpd_client_get_next_fragment (GstMpdClient * client,
- guint indexStream, GstMediaFragmentInfo * fragment)
+ guint indexStream, GstMediaFragmentInfo * fragment, gboolean forward)
{
GstActiveStream *stream = NULL;
GstMediaSegment currentChunk;
}
}
- gst_mpd_client_set_segment_index (stream, segment_idx + 1);
+ gst_mpd_client_set_segment_index (stream,
+ forward ? segment_idx + 1 : segment_idx - 1);
GST_MPD_CLIENT_UNLOCK (client);
GST_DEBUG ("Loading chunk with URL %s", fragment->uri);
GstClockTime gst_mpd_client_get_media_presentation_duration (GstMpdClient *client);
gboolean gst_mpd_client_get_last_fragment_timestamp (GstMpdClient * client, guint stream_idx, GstClockTime * ts);
gboolean gst_mpd_client_get_next_fragment_timestamp (GstMpdClient * client, guint stream_idx, GstClockTime * ts);
-gboolean gst_mpd_client_get_next_fragment (GstMpdClient *client, guint indexStream, GstMediaFragmentInfo * fragment);
+gboolean gst_mpd_client_get_next_fragment (GstMpdClient *client, guint indexStream, GstMediaFragmentInfo * fragment, gboolean forward);
gboolean gst_mpd_client_get_next_header (GstMpdClient *client, gchar **uri, guint stream_idx, gint64 * range_start, gint64 * range_end);
gboolean gst_mpd_client_get_next_header_index (GstMpdClient *client, gchar **uri, guint stream_idx, gint64 * range_start, gint64 * range_end);
gboolean gst_mpd_client_is_live (GstMpdClient * client);