mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-03-30 12:49:40 +00:00
hlsdemux: Set buffer timestamp since we send a TIME segment
This commit is contained in:
parent
8b762708cd
commit
5878f71233
3 changed files with 17 additions and 3 deletions
|
@ -1069,10 +1069,11 @@ gst_hls_demux_get_next_fragment (GstHLSDemux * demux, gboolean retry)
|
|||
guint avail;
|
||||
const gchar *next_fragment_uri;
|
||||
GstClockTime duration;
|
||||
GstClockTime timestamp;
|
||||
gboolean discont;
|
||||
|
||||
if (!gst_m3u8_client_get_next_fragment (demux->client, &discont,
|
||||
&next_fragment_uri, &duration)) {
|
||||
&next_fragment_uri, &duration, ×tamp)) {
|
||||
GST_INFO_OBJECT (demux, "This playlist doesn't contain more fragments");
|
||||
demux->end_of_playlist = TRUE;
|
||||
GST_TASK_SIGNAL (demux->task);
|
||||
|
@ -1087,6 +1088,7 @@ gst_hls_demux_get_next_fragment (GstHLSDemux * demux, gboolean retry)
|
|||
avail = gst_adapter_available (demux->download);
|
||||
buf = gst_adapter_take_buffer (demux->download, avail);
|
||||
GST_BUFFER_DURATION (buf) = duration;
|
||||
GST_BUFFER_TIMESTAMP (buf) = timestamp;
|
||||
|
||||
/* We actually need to do this every time we switch bitrate */
|
||||
if (G_UNLIKELY (demux->do_typefind)) {
|
||||
|
|
|
@ -442,9 +442,11 @@ _find_next (GstM3U8MediaFile * file, GstM3U8Client * client)
|
|||
|
||||
gboolean
|
||||
gst_m3u8_client_get_next_fragment (GstM3U8Client * client,
|
||||
gboolean * discontinuity, const gchar ** uri, GstClockTime * duration)
|
||||
gboolean * discontinuity, const gchar ** uri, GstClockTime * duration,
|
||||
GstClockTime * timestamp)
|
||||
{
|
||||
GList *l;
|
||||
GList *walk;
|
||||
GstM3U8MediaFile *file;
|
||||
|
||||
g_return_val_if_fail (client != NULL, FALSE);
|
||||
|
@ -464,6 +466,15 @@ gst_m3u8_client_get_next_fragment (GstM3U8Client * client,
|
|||
|
||||
*uri = file->uri;
|
||||
*duration = file->duration * GST_SECOND;
|
||||
|
||||
*timestamp = 0;
|
||||
for (walk = client->current->files; walk; walk = walk->next) {
|
||||
if (walk == l)
|
||||
break;
|
||||
*timestamp += GST_M3U8_MEDIA_FILE (walk->data)->duration;
|
||||
}
|
||||
*timestamp *= GST_SECOND;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
|
|
@ -76,7 +76,8 @@ void gst_m3u8_client_free (GstM3U8Client * client);
|
|||
gboolean gst_m3u8_client_update (GstM3U8Client * client, gchar * data);
|
||||
void gst_m3u8_client_set_current (GstM3U8Client * client, GstM3U8 * m3u8);
|
||||
gboolean gst_m3u8_client_get_next_fragment (GstM3U8Client * client,
|
||||
gboolean * discontinuity, const gchar ** uri, GstClockTime * duration);
|
||||
gboolean * discontinuity, const gchar ** uri, GstClockTime * duration,
|
||||
GstClockTime * timestamp);
|
||||
GstClockTime gst_m3u8_client_get_duration (GstM3U8Client * client);
|
||||
const gchar *gst_m3u8_client_get_uri(GstM3U8Client * client);
|
||||
gboolean gst_m3u8_client_has_variant_playlist(GstM3U8Client * client);
|
||||
|
|
Loading…
Reference in a new issue