mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-19 08:11:16 +00:00
hlssink: Use floats for the EXTINF duration values
https://bugzilla.gnome.org/show_bug.cgi?id=708851
This commit is contained in:
parent
203f527653
commit
a1cc9ca4de
1 changed files with 6 additions and 6 deletions
|
@ -33,7 +33,7 @@
|
|||
#define M3U8_MEDIA_SEQUENCE_TAG "#EXT-X-MEDIA-SEQUENCE:%d\n"
|
||||
#define M3U8_DISCONTINUITY_TAG "#EXT-X-DISCONTINUITY\n"
|
||||
#define M3U8_INT_INF_TAG "#EXTINF:%d,%s\n%s\n"
|
||||
#define M3U8_FLOAT_INF_TAG "#EXTINF:%.2f,%s\n%s\n"
|
||||
#define M3U8_FLOAT_INF_TAG "#EXTINF:%s,%s\n%s\n"
|
||||
#define M3U8_ENDLIST_TAG "#EXT-X-ENDLIST"
|
||||
|
||||
enum
|
||||
|
@ -75,12 +75,11 @@ gst_m3u8_entry_free (GstM3U8Entry * entry)
|
|||
static gchar *
|
||||
gst_m3u8_entry_render (GstM3U8Entry * entry, guint version)
|
||||
{
|
||||
gchar buf[G_ASCII_DTOSTR_BUF_SIZE];
|
||||
|
||||
g_return_val_if_fail (entry != NULL, NULL);
|
||||
|
||||
/* FIXME: Ensure the radix is always a '.' and not a ',' when printing
|
||||
* floating point number, but for now only use integers*/
|
||||
/* if (version < 3) */
|
||||
if (TRUE)
|
||||
if (version < 3)
|
||||
return g_strdup_printf ("%s" M3U8_INT_INF_TAG,
|
||||
entry->discontinuous ? M3U8_DISCONTINUITY_TAG : "",
|
||||
(gint) ((entry->duration + 500 * GST_MSECOND) / GST_SECOND),
|
||||
|
@ -88,7 +87,8 @@ gst_m3u8_entry_render (GstM3U8Entry * entry, guint version)
|
|||
|
||||
return g_strdup_printf ("%s" M3U8_FLOAT_INF_TAG,
|
||||
entry->discontinuous ? M3U8_DISCONTINUITY_TAG : "",
|
||||
(entry->duration / GST_SECOND), entry->title, entry->url);
|
||||
g_ascii_dtostr (buf, sizeof (buf), (entry->duration / GST_SECOND)),
|
||||
entry->title, entry->url);
|
||||
}
|
||||
|
||||
GstM3U8Playlist *
|
||||
|
|
Loading…
Reference in a new issue