mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-06-06 23:48:53 +00:00
matroska-mux: update for GstTocSetter changes
This commit is contained in:
parent
dff2fec970
commit
2c04c30ec3
1 changed files with 13 additions and 9 deletions
|
@ -647,7 +647,7 @@ gst_matroska_mux_reset (GstElement * element)
|
||||||
mux->tags_pos = 0;
|
mux->tags_pos = 0;
|
||||||
|
|
||||||
/* reset chapters */
|
/* reset chapters */
|
||||||
gst_toc_setter_reset_toc (GST_TOC_SETTER (mux));
|
gst_toc_setter_reset (GST_TOC_SETTER (mux));
|
||||||
|
|
||||||
mux->chapters_pos = 0;
|
mux->chapters_pos = 0;
|
||||||
}
|
}
|
||||||
|
@ -798,7 +798,7 @@ gst_matroska_mux_handle_sink_event (GstCollectPads * pads,
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case GST_EVENT_TOC:{
|
case GST_EVENT_TOC:{
|
||||||
GstToc *toc;
|
GstToc *toc, *old_toc;
|
||||||
|
|
||||||
if (mux->chapters_pos > 0)
|
if (mux->chapters_pos > 0)
|
||||||
break;
|
break;
|
||||||
|
@ -807,9 +807,11 @@ gst_matroska_mux_handle_sink_event (GstCollectPads * pads,
|
||||||
gst_event_parse_toc (event, &toc, NULL);
|
gst_event_parse_toc (event, &toc, NULL);
|
||||||
|
|
||||||
if (toc != NULL) {
|
if (toc != NULL) {
|
||||||
if (gst_toc_setter_get_toc (GST_TOC_SETTER (mux)) != NULL) {
|
old_toc = gst_toc_setter_get_toc (GST_TOC_SETTER (mux));
|
||||||
gst_toc_setter_reset_toc (GST_TOC_SETTER (mux));
|
if (old_toc != NULL) {
|
||||||
GST_INFO_OBJECT (pad, "Replacing TOC with a new one");
|
if (old_toc != toc)
|
||||||
|
GST_INFO_OBJECT (pad, "Replacing TOC with a new one");
|
||||||
|
gst_toc_unref (old_toc);
|
||||||
}
|
}
|
||||||
|
|
||||||
gst_toc_setter_set_toc (GST_TOC_SETTER (mux), toc);
|
gst_toc_setter_set_toc (GST_TOC_SETTER (mux), toc);
|
||||||
|
@ -2468,6 +2470,7 @@ gst_matroska_mux_start (GstMatroskaMux * mux)
|
||||||
GstClockTime duration = 0;
|
GstClockTime duration = 0;
|
||||||
guint32 segment_uid[4];
|
guint32 segment_uid[4];
|
||||||
GTimeVal time = { 0, 0 };
|
GTimeVal time = { 0, 0 };
|
||||||
|
GstToc *toc;
|
||||||
|
|
||||||
/* if not streaming, check if downstream is seekable */
|
/* if not streaming, check if downstream is seekable */
|
||||||
if (!mux->streamable) {
|
if (!mux->streamable) {
|
||||||
|
@ -2620,17 +2623,15 @@ gst_matroska_mux_start (GstMatroskaMux * mux)
|
||||||
gst_ebml_write_master_finish (ebml, master);
|
gst_ebml_write_master_finish (ebml, master);
|
||||||
|
|
||||||
/* chapters */
|
/* chapters */
|
||||||
if (gst_toc_setter_get_toc (GST_TOC_SETTER (mux)) != NULL && !mux->streamable) {
|
toc = gst_toc_setter_get_toc (GST_TOC_SETTER (mux));
|
||||||
|
if (toc != NULL && !mux->streamable) {
|
||||||
guint64 master_chapters = 0;
|
guint64 master_chapters = 0;
|
||||||
GstTocEntry *toc_entry;
|
GstTocEntry *toc_entry;
|
||||||
const GstToc *toc;
|
|
||||||
GList *cur, *to_write = NULL;
|
GList *cur, *to_write = NULL;
|
||||||
gint64 start, stop;
|
gint64 start, stop;
|
||||||
|
|
||||||
GST_DEBUG ("Writing chapters");
|
GST_DEBUG ("Writing chapters");
|
||||||
|
|
||||||
toc = gst_toc_setter_get_toc (GST_TOC_SETTER (mux));
|
|
||||||
|
|
||||||
/* check whether we have editions or chapters at the root level */
|
/* check whether we have editions or chapters at the root level */
|
||||||
toc_entry = toc->entries->data;
|
toc_entry = toc->entries->data;
|
||||||
|
|
||||||
|
@ -2683,6 +2684,9 @@ gst_matroska_mux_start (GstMatroskaMux * mux)
|
||||||
|
|
||||||
/* lastly, flush the cache */
|
/* lastly, flush the cache */
|
||||||
gst_ebml_write_flush_cache (ebml, FALSE, 0);
|
gst_ebml_write_flush_cache (ebml, FALSE, 0);
|
||||||
|
|
||||||
|
if (toc != NULL)
|
||||||
|
gst_toc_unref (toc);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
Loading…
Reference in a new issue