mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-06-07 16:08:51 +00:00
qtmux: In prefill mode, only pad buffers with > 0 sized memories as needed
Adding a 0-byte memory has not much effect. Also add some debug output.
This commit is contained in:
parent
63492ee141
commit
10f4693163
1 changed files with 12 additions and 7 deletions
|
@ -4096,6 +4096,10 @@ gst_qt_mux_add_buffer (GstQTMux * qtmux, GstQTPad * pad, GstBuffer * buf)
|
||||||
goto bail;
|
goto bail;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (fill_size > 0) {
|
||||||
|
GST_DEBUG_OBJECT (qtmux,
|
||||||
|
"Padding buffer by %u bytes to reach required %u bytes", fill_size,
|
||||||
|
required_buffer_size);
|
||||||
mem = gst_allocator_alloc (NULL, fill_size, NULL);
|
mem = gst_allocator_alloc (NULL, fill_size, NULL);
|
||||||
gst_memory_map (mem, &map, GST_MAP_WRITE);
|
gst_memory_map (mem, &map, GST_MAP_WRITE);
|
||||||
memset (map.data, 0, map.size);
|
memset (map.data, 0, map.size);
|
||||||
|
@ -4104,6 +4108,7 @@ gst_qt_mux_add_buffer (GstQTMux * qtmux, GstQTPad * pad, GstBuffer * buf)
|
||||||
gst_buffer_append_memory (last_buf, mem);
|
gst_buffer_append_memory (last_buf, mem);
|
||||||
buffer_size = required_buffer_size;
|
buffer_size = required_buffer_size;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* duration actually means time delta between samples, so we calculate
|
/* duration actually means time delta between samples, so we calculate
|
||||||
* the duration based on the difference in DTS or PTS, falling back
|
* the duration based on the difference in DTS or PTS, falling back
|
||||||
|
|
Loading…
Reference in a new issue