summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorFlávio Ribeiro <email@flavioribeiro.com>2014-12-04 02:12:08 -0200
committerSebastian Dröge <sebastian@centricular.com>2014-12-04 17:52:08 +0100
commitc306e0dfa74301322cedd7ec9714592bcb583702 (patch)
treece8bb50d7b235964457a93f2f9a0304310fb3913 /ext
parent26d99a6f3ec359c00ee5c19705e1cc120e04ab2b (diff)
downloadgstreamer-plugins-bad-c306e0dfa74301322cedd7ec9714592bcb583702.tar.gz
hlssink: remove unnecessary title on EXTINF tag
According to the HLS spec the remainder of the line following the comma on EXTINF tag is not required. This patch removes the fake title and saves some bytes on the playlist. https://bugzilla.gnome.org/show_bug.cgi?id=741096
Diffstat (limited to 'ext')
-rw-r--r--ext/hls/gsthlssink.c5
-rw-r--r--ext/hls/gstm3u8playlist.c6
2 files changed, 4 insertions, 7 deletions
diff --git a/ext/hls/gsthlssink.c b/ext/hls/gsthlssink.c
index 44093a665..5206e50b6 100644
--- a/ext/hls/gsthlssink.c
+++ b/ext/hls/gsthlssink.c
@@ -253,7 +253,7 @@ gst_hls_sink_handle_message (GstBin * bin, GstMessage * message)
case GST_MESSAGE_ELEMENT:
{
GFile *file;
- const char *filename, *title;
+ const char *filename;
char *playlist_content;
GstClockTime running_time, duration;
gboolean discont = FALSE;
@@ -271,7 +271,6 @@ gst_hls_sink_handle_message (GstBin * bin, GstMessage * message)
sink->last_running_time = running_time;
file = g_file_new_for_path (filename);
- title = "ciao";
GST_INFO_OBJECT (sink, "COUNT %d", sink->index);
if (sink->playlist_root == NULL)
entry_location = g_path_get_basename (filename);
@@ -282,7 +281,7 @@ gst_hls_sink_handle_message (GstBin * bin, GstMessage * message)
}
gst_m3u8_playlist_add_entry (sink->playlist, entry_location, file,
- title, duration, sink->index, discont);
+ NULL, duration, sink->index, discont);
g_free (entry_location);
playlist_content = gst_m3u8_playlist_render (sink->playlist);
if (!g_file_set_contents (sink->playlist_location,
diff --git a/ext/hls/gstm3u8playlist.c b/ext/hls/gstm3u8playlist.c
index f30a66709..075e45fa3 100644
--- a/ext/hls/gstm3u8playlist.c
+++ b/ext/hls/gstm3u8playlist.c
@@ -49,7 +49,6 @@ gst_m3u8_entry_new (const gchar * url, GFile * file, const gchar * title,
GstM3U8Entry *entry;
g_return_val_if_fail (url != NULL, NULL);
- g_return_val_if_fail (title != NULL, NULL);
entry = g_new0 (GstM3U8Entry, 1);
entry->url = g_strdup (url);
@@ -83,12 +82,12 @@ gst_m3u8_entry_render (GstM3U8Entry * entry, guint version)
return g_strdup_printf ("%s" M3U8_INT_INF_TAG,
entry->discontinuous ? M3U8_DISCONTINUITY_TAG : "",
(gint) ((entry->duration + 500 * GST_MSECOND) / GST_SECOND),
- entry->title, entry->url);
+ entry->title ? entry->title : "", entry->url);
return g_strdup_printf ("%s" M3U8_FLOAT_INF_TAG,
entry->discontinuous ? M3U8_DISCONTINUITY_TAG : "",
g_ascii_dtostr (buf, sizeof (buf), (entry->duration / GST_SECOND)),
- entry->title, entry->url);
+ entry->title ? entry->title : "", entry->url);
}
GstM3U8Playlist *
@@ -127,7 +126,6 @@ gst_m3u8_playlist_add_entry (GstM3U8Playlist * playlist,
g_return_val_if_fail (playlist != NULL, FALSE);
g_return_val_if_fail (url != NULL, FALSE);
- g_return_val_if_fail (title != NULL, FALSE);
if (playlist->type == GST_M3U8_PLAYLIST_TYPE_VOD)
return FALSE;