mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-17 03:35:21 +00:00
qtdemux: Keep sample data from the current fragment only (push mode)
This patch clears the sample table whenever the demuxing of a new fragment begins. This avoids increasing memory usage for long videos. This behavior was already present when upstream_format_is_time; this patch extends it to all push mode operation (e.g. Media Source Extensions). https://bugzilla.gnome.org/show_bug.cgi?id=796899
This commit is contained in:
parent
5ca7a02371
commit
794dcfbfee
1 changed files with 10 additions and 1 deletions
|
@ -4079,8 +4079,17 @@ qtdemux_parse_moof (GstQTDemux * qtdemux, const guint8 * buffer, guint length,
|
|||
|
||||
min_dts = MIN (min_dts, QTSTREAMTIME_TO_GSTTIME (stream, decode_time));
|
||||
|
||||
if (qtdemux->upstream_format_is_time)
|
||||
if (!qtdemux->pullbased) {
|
||||
/* Sample tables can grow enough to be problematic if the system memory
|
||||
* is very low (e.g. embedded devices) and the videos very long
|
||||
* (~8 MiB/hour for 25-30 fps video + typical AAC audio frames).
|
||||
* Fortunately, we can easily discard them for each new fragment when
|
||||
* we know qtdemux will not receive seeks outside of the current fragment.
|
||||
* adaptivedemux honors this assumption.
|
||||
* This optimization is also useful for applications that use qtdemux as
|
||||
* a push-based simple demuxer, like Media Source Extensions. */
|
||||
gst_qtdemux_stream_flush_samples_data (stream);
|
||||
}
|
||||
|
||||
/* initialise moof sample data */
|
||||
stream->n_samples_moof = 0;
|
||||
|
|
Loading…
Reference in a new issue