mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-10-20 09:23:46 +00:00
qtmux: Update modification times when sending the moov
https://bugzilla.gnome.org/show_bug.cgi?id=779422
This commit is contained in:
parent
f7b1eae3a2
commit
7709920ca3
3 changed files with 18 additions and 4 deletions
|
@ -75,8 +75,8 @@ atoms_context_free (AtomsContext * context)
|
||||||
#define SECS_PER_DAY (24 * 60 * 60)
|
#define SECS_PER_DAY (24 * 60 * 60)
|
||||||
#define LEAP_YEARS_FROM_1904_TO_1970 17
|
#define LEAP_YEARS_FROM_1904_TO_1970 17
|
||||||
|
|
||||||
static guint64
|
guint64
|
||||||
get_current_qt_time (void)
|
atoms_get_current_qt_time (void)
|
||||||
{
|
{
|
||||||
GTimeVal timeval;
|
GTimeVal timeval;
|
||||||
|
|
||||||
|
@ -89,7 +89,7 @@ get_current_qt_time (void)
|
||||||
static void
|
static void
|
||||||
common_time_info_init (TimeInfo * ti)
|
common_time_info_init (TimeInfo * ti)
|
||||||
{
|
{
|
||||||
ti->creation_time = ti->modification_time = get_current_qt_time ();
|
ti->creation_time = ti->modification_time = atoms_get_current_qt_time ();
|
||||||
ti->timescale = 0;
|
ti->timescale = 0;
|
||||||
ti->duration = 0;
|
ti->duration = 0;
|
||||||
}
|
}
|
||||||
|
@ -1143,7 +1143,7 @@ atom_tkhd_init (AtomTKHD * tkhd, AtomsContext * context)
|
||||||
|
|
||||||
atom_full_init (&tkhd->header, FOURCC_tkhd, 0, 0, 0, flags);
|
atom_full_init (&tkhd->header, FOURCC_tkhd, 0, 0, 0, flags);
|
||||||
|
|
||||||
tkhd->creation_time = tkhd->modification_time = get_current_qt_time ();
|
tkhd->creation_time = tkhd->modification_time = atoms_get_current_qt_time ();
|
||||||
tkhd->duration = 0;
|
tkhd->duration = 0;
|
||||||
tkhd->track_ID = 0;
|
tkhd->track_ID = 0;
|
||||||
tkhd->reserved = 0;
|
tkhd->reserved = 0;
|
||||||
|
|
|
@ -903,6 +903,8 @@ struct _AtomInfo
|
||||||
AtomFreeFunc free_func;
|
AtomFreeFunc free_func;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
guint64 atoms_get_current_qt_time (void);
|
||||||
|
|
||||||
guint64 atom_copy_data (Atom *atom, guint8 **buffer,
|
guint64 atom_copy_data (Atom *atom, guint8 **buffer,
|
||||||
guint64 *size, guint64* offset);
|
guint64 *size, guint64* offset);
|
||||||
|
|
||||||
|
|
|
@ -1925,6 +1925,18 @@ gst_qt_mux_send_moov (GstQTMux * qtmux, guint64 * _offset,
|
||||||
guint8 *data;
|
guint8 *data;
|
||||||
GstBuffer *buf;
|
GstBuffer *buf;
|
||||||
GstFlowReturn ret = GST_FLOW_OK;
|
GstFlowReturn ret = GST_FLOW_OK;
|
||||||
|
GSList *walk;
|
||||||
|
guint64 current_time = atoms_get_current_qt_time ();
|
||||||
|
|
||||||
|
/* update modification times */
|
||||||
|
qtmux->moov->mvhd.time_info.modification_time = current_time;
|
||||||
|
for (walk = qtmux->collect->data; walk; walk = g_slist_next (walk)) {
|
||||||
|
GstCollectData *cdata = (GstCollectData *) walk->data;
|
||||||
|
GstQTPad *qtpad = (GstQTPad *) cdata;
|
||||||
|
|
||||||
|
qtpad->trak->mdia.mdhd.time_info.modification_time = current_time;
|
||||||
|
qtpad->trak->tkhd.modification_time = current_time;
|
||||||
|
}
|
||||||
|
|
||||||
/* serialize moov */
|
/* serialize moov */
|
||||||
offset = size = 0;
|
offset = size = 0;
|
||||||
|
|
Loading…
Reference in a new issue