mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-09-02 10:13:51 +00:00
hlsdemux: Do not reset the sequence number in a live stream for a normal playlist update.
Only for stream switching
This commit is contained in:
parent
f7553b6b0d
commit
bfd7a52c5d
1 changed files with 7 additions and 6 deletions
|
@ -105,7 +105,8 @@ static gboolean gst_hls_demux_schedule (GstHLSDemux * demux);
|
||||||
static gboolean gst_hls_demux_switch_playlist (GstHLSDemux * demux);
|
static gboolean gst_hls_demux_switch_playlist (GstHLSDemux * demux);
|
||||||
static gboolean gst_hls_demux_get_next_fragment (GstHLSDemux * demux,
|
static gboolean gst_hls_demux_get_next_fragment (GstHLSDemux * demux,
|
||||||
gboolean caching);
|
gboolean caching);
|
||||||
static gboolean gst_hls_demux_update_playlist (GstHLSDemux * demux);
|
static gboolean gst_hls_demux_update_playlist (GstHLSDemux * demux,
|
||||||
|
gboolean update);
|
||||||
static void gst_hls_demux_reset (GstHLSDemux * demux, gboolean dispose);
|
static void gst_hls_demux_reset (GstHLSDemux * demux, gboolean dispose);
|
||||||
static gboolean gst_hls_demux_set_location (GstHLSDemux * demux,
|
static gboolean gst_hls_demux_set_location (GstHLSDemux * demux,
|
||||||
const gchar * uri);
|
const gchar * uri);
|
||||||
|
@ -786,7 +787,7 @@ gst_hls_demux_updates_loop (GstHLSDemux * demux)
|
||||||
}
|
}
|
||||||
/* update the playlist for live sources */
|
/* update the playlist for live sources */
|
||||||
if (gst_m3u8_client_is_live (demux->client)) {
|
if (gst_m3u8_client_is_live (demux->client)) {
|
||||||
if (!gst_hls_demux_update_playlist (demux)) {
|
if (!gst_hls_demux_update_playlist (demux, TRUE)) {
|
||||||
demux->client->update_failed_count++;
|
demux->client->update_failed_count++;
|
||||||
if (demux->client->update_failed_count < DEFAULT_FAILED_COUNT) {
|
if (demux->client->update_failed_count < DEFAULT_FAILED_COUNT) {
|
||||||
GST_WARNING_OBJECT (demux, "Could not update the playlist");
|
GST_WARNING_OBJECT (demux, "Could not update the playlist");
|
||||||
|
@ -859,7 +860,7 @@ gst_hls_demux_cache_fragments (GstHLSDemux * demux)
|
||||||
child = demux->client->main->current_variant->data;
|
child = demux->client->main->current_variant->data;
|
||||||
GST_M3U8_CLIENT_UNLOCK (demux->client);
|
GST_M3U8_CLIENT_UNLOCK (demux->client);
|
||||||
gst_m3u8_client_set_current (demux->client, child);
|
gst_m3u8_client_set_current (demux->client, child);
|
||||||
if (!gst_hls_demux_update_playlist (demux)) {
|
if (!gst_hls_demux_update_playlist (demux, FALSE)) {
|
||||||
GST_ERROR_OBJECT (demux, "Could not fetch the child playlist %s",
|
GST_ERROR_OBJECT (demux, "Could not fetch the child playlist %s",
|
||||||
child->uri);
|
child->uri);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
@ -935,7 +936,7 @@ validate_error:
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
gst_hls_demux_update_playlist (GstHLSDemux * demux)
|
gst_hls_demux_update_playlist (GstHLSDemux * demux, gboolean update)
|
||||||
{
|
{
|
||||||
GstFragment *download;
|
GstFragment *download;
|
||||||
GstBuffer *buf;
|
GstBuffer *buf;
|
||||||
|
@ -962,7 +963,7 @@ gst_hls_demux_update_playlist (GstHLSDemux * demux)
|
||||||
|
|
||||||
/* If it's a live source, do not let the sequence number go beyond
|
/* If it's a live source, do not let the sequence number go beyond
|
||||||
* three fragments before the end of the list */
|
* three fragments before the end of the list */
|
||||||
if (updated && demux->client->current &&
|
if (updated && update == FALSE && demux->client->current &&
|
||||||
gst_m3u8_client_is_live (demux->client)) {
|
gst_m3u8_client_is_live (demux->client)) {
|
||||||
guint last_sequence;
|
guint last_sequence;
|
||||||
|
|
||||||
|
@ -1016,7 +1017,7 @@ gst_hls_demux_change_playlist (GstHLSDemux * demux, gboolean is_fast)
|
||||||
GST_INFO_OBJECT (demux, "Client is %s, switching to bitrate %d",
|
GST_INFO_OBJECT (demux, "Client is %s, switching to bitrate %d",
|
||||||
is_fast ? "fast" : "slow", new_bandwidth);
|
is_fast ? "fast" : "slow", new_bandwidth);
|
||||||
|
|
||||||
if (gst_hls_demux_update_playlist (demux)) {
|
if (gst_hls_demux_update_playlist (demux, FALSE)) {
|
||||||
s = gst_structure_new ("playlist",
|
s = gst_structure_new ("playlist",
|
||||||
"uri", G_TYPE_STRING, gst_m3u8_client_get_current_uri (demux->client),
|
"uri", G_TYPE_STRING, gst_m3u8_client_get_current_uri (demux->client),
|
||||||
"bitrate", G_TYPE_INT, new_bandwidth, NULL);
|
"bitrate", G_TYPE_INT, new_bandwidth, NULL);
|
||||||
|
|
Loading…
Reference in a new issue