mirror of
https://github.com/obsproject/obs-studio.git
synced 2026-09-24 23:31:36 +08:00
media-playback: Unbuffered Media Source
When using an IP camera on a local network, we wanted to minimize delay. In order to achieve minimum delay, we allowed Media Source to set BufferingMB to 0, and when it is 0, also enable AVFMT_FLAG_NOBUFFER in the AVFormatContext flags.
This commit is contained in:
+3
@@ -585,6 +585,9 @@ static bool init_avformat(mp_media_t *m)
|
||||
av_dict_set_int(&opts, "buffer_size", m->buffering, 0);
|
||||
|
||||
m->fmt = avformat_alloc_context();
|
||||
if (m->buffering == 0) {
|
||||
m->fmt->flags |= AVFMT_FLAG_NOBUFFER;
|
||||
}
|
||||
if (!m->is_local_file) {
|
||||
m->fmt->interrupt_callback.callback = interrupt_callback;
|
||||
m->fmt->interrupt_callback.opaque = m;
|
||||
|
||||
@@ -163,7 +163,7 @@ static obs_properties_t *ffmpeg_source_getproperties(void *data)
|
||||
obs_module_text("RestartWhenActivated"));
|
||||
|
||||
prop = obs_properties_add_int_slider(props, "buffering_mb",
|
||||
obs_module_text("BufferingMB"), 1,
|
||||
obs_module_text("BufferingMB"), 0,
|
||||
16, 1);
|
||||
obs_property_int_set_suffix(prop, " MB");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user