New upstream version 24.0.1+dfsg1
This commit is contained in:
parent
b14f9eae6d
commit
5a730d6ec3
842 changed files with 42245 additions and 33385 deletions
|
|
@ -4,11 +4,13 @@
|
|||
#include <util/platform.h>
|
||||
#include <util/dstr.h>
|
||||
|
||||
#define do_log(level, format, ...) \
|
||||
#define do_log(level, format, ...) \
|
||||
blog(level, "[vlc_source: '%s'] " format, \
|
||||
obs_source_get_name(ss->source), ##__VA_ARGS__)
|
||||
obs_source_get_name(ss->source), ##__VA_ARGS__)
|
||||
|
||||
#define warn(format, ...) do_log(LOG_WARNING, format, ##__VA_ARGS__)
|
||||
#define warn(format, ...) do_log(LOG_WARNING, format, ##__VA_ARGS__)
|
||||
|
||||
/* clang-format off */
|
||||
|
||||
#define S_PLAYLIST "playlist"
|
||||
#define S_LOOP "loop"
|
||||
|
|
@ -35,6 +37,8 @@
|
|||
#define T_SUBTITLE_ENABLE T_("SubtitleEnable")
|
||||
#define T_SUBTITLE_TRACK T_("SubtitleTrack")
|
||||
|
||||
/* clang-format on */
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
||||
struct media_file_data {
|
||||
|
|
@ -94,8 +98,8 @@ static libvlc_media_t *get_media(struct darray *array, const char *path)
|
|||
static inline libvlc_media_t *create_media_from_file(const char *file)
|
||||
{
|
||||
return (file && strstr(file, "://") != NULL)
|
||||
? libvlc_media_new_location_(libvlc, file)
|
||||
: libvlc_media_new_path_(libvlc, file);
|
||||
? libvlc_media_new_location_(libvlc, file)
|
||||
: libvlc_media_new_path_(libvlc, file);
|
||||
}
|
||||
|
||||
static void free_files(struct darray *array)
|
||||
|
|
@ -113,25 +117,26 @@ static void free_files(struct darray *array)
|
|||
|
||||
static inline bool chroma_is(const char *chroma, const char *val)
|
||||
{
|
||||
return *(uint32_t*)chroma == *(uint32_t*)val;
|
||||
return *(uint32_t *)chroma == *(uint32_t *)val;
|
||||
}
|
||||
|
||||
static enum video_format convert_vlc_video_format(char *chroma, bool *full)
|
||||
{
|
||||
*full = false;
|
||||
|
||||
#define CHROMA_TEST(val, ret) \
|
||||
if (chroma_is(chroma, val)) return ret
|
||||
#define CHROMA_CONV(val, new_val, ret) \
|
||||
do { \
|
||||
if (chroma_is(chroma, val)) { \
|
||||
*(uint32_t*)chroma = *(uint32_t*)new_val; \
|
||||
return ret; \
|
||||
} \
|
||||
#define CHROMA_TEST(val, ret) \
|
||||
if (chroma_is(chroma, val)) \
|
||||
return ret
|
||||
#define CHROMA_CONV(val, new_val, ret) \
|
||||
do { \
|
||||
if (chroma_is(chroma, val)) { \
|
||||
*(uint32_t *)chroma = *(uint32_t *)new_val; \
|
||||
return ret; \
|
||||
} \
|
||||
} while (false)
|
||||
#define CHROMA_CONV_FULL(val, new_val, ret) \
|
||||
do { \
|
||||
*full = true; \
|
||||
#define CHROMA_CONV_FULL(val, new_val, ret) \
|
||||
do { \
|
||||
*full = true; \
|
||||
CHROMA_CONV(val, new_val, ret); \
|
||||
} while (false)
|
||||
|
||||
|
|
@ -205,12 +210,12 @@ static enum video_format convert_vlc_video_format(char *chroma, bool *full)
|
|||
#undef CHROMA_CONV
|
||||
#undef CHROMA_TEST
|
||||
|
||||
*(uint32_t*)chroma = *(uint32_t*)"BGRA";
|
||||
*(uint32_t *)chroma = *(uint32_t *)"BGRA";
|
||||
return VIDEO_FORMAT_BGRA;
|
||||
}
|
||||
|
||||
static inline unsigned get_format_lines(enum video_format format,
|
||||
unsigned height, size_t plane)
|
||||
unsigned height, size_t plane)
|
||||
{
|
||||
switch (format) {
|
||||
case VIDEO_FORMAT_I420:
|
||||
|
|
@ -225,7 +230,9 @@ static inline unsigned get_format_lines(enum video_format format,
|
|||
case VIDEO_FORMAT_BGRX:
|
||||
case VIDEO_FORMAT_Y800:
|
||||
return height;
|
||||
case VIDEO_FORMAT_NONE:;
|
||||
case VIDEO_FORMAT_NONE:
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
|
@ -233,14 +240,15 @@ static inline unsigned get_format_lines(enum video_format format,
|
|||
|
||||
static enum audio_format convert_vlc_audio_format(char *format)
|
||||
{
|
||||
#define AUDIO_TEST(val, ret) \
|
||||
if (chroma_is(format, val)) return ret
|
||||
#define AUDIO_CONV(val, new_val, ret) \
|
||||
do { \
|
||||
if (chroma_is(format, val)) { \
|
||||
*(uint32_t*)format = *(uint32_t*)new_val; \
|
||||
return ret; \
|
||||
} \
|
||||
#define AUDIO_TEST(val, ret) \
|
||||
if (chroma_is(format, val)) \
|
||||
return ret
|
||||
#define AUDIO_CONV(val, new_val, ret) \
|
||||
do { \
|
||||
if (chroma_is(format, val)) { \
|
||||
*(uint32_t *)format = *(uint32_t *)new_val; \
|
||||
return ret; \
|
||||
} \
|
||||
} while (false)
|
||||
|
||||
AUDIO_TEST("S16N", AUDIO_FORMAT_16BIT);
|
||||
|
|
@ -262,7 +270,7 @@ static enum audio_format convert_vlc_audio_format(char *format)
|
|||
#undef AUDIO_CONV
|
||||
#undef AUDIO_TEST
|
||||
|
||||
*(uint32_t*)format = *(uint32_t*)"FL32";
|
||||
*(uint32_t *)format = *(uint32_t *)"FL32";
|
||||
return AUDIO_FORMAT_FLOAT;
|
||||
}
|
||||
|
||||
|
|
@ -286,7 +294,7 @@ static void vlcs_destroy(void *data)
|
|||
libvlc_media_player_release_(c->media_player);
|
||||
}
|
||||
|
||||
bfree((void*)c->audio.data[0]);
|
||||
bfree((void *)c->audio.data[0]);
|
||||
obs_source_frame_free(&c->frame);
|
||||
|
||||
free_files(&c->files.da);
|
||||
|
|
@ -312,7 +320,8 @@ static void vlcs_video_display(void *data, void *picture)
|
|||
}
|
||||
|
||||
static unsigned vlcs_video_format(void **p_data, char *chroma, unsigned *width,
|
||||
unsigned *height, unsigned *pitches, unsigned *lines)
|
||||
unsigned *height, unsigned *pitches,
|
||||
unsigned *lines)
|
||||
{
|
||||
struct vlc_source *c = *p_data;
|
||||
enum video_format new_format;
|
||||
|
|
@ -334,25 +343,24 @@ static unsigned vlcs_video_format(void **p_data, char *chroma, unsigned *width,
|
|||
libvlc_video_get_size_(c->media_player, 0, &new_width, &new_height);
|
||||
|
||||
if (new_width && new_height) {
|
||||
*width = new_width;
|
||||
*width = new_width;
|
||||
*height = new_height;
|
||||
}
|
||||
|
||||
/* don't allocate a new frame if format/width/height hasn't changed */
|
||||
if (c->frame.format != new_format ||
|
||||
c->frame.width != *width ||
|
||||
if (c->frame.format != new_format || c->frame.width != *width ||
|
||||
c->frame.height != *height) {
|
||||
obs_source_frame_free(&c->frame);
|
||||
obs_source_frame_init(&c->frame, new_format, *width, *height);
|
||||
|
||||
c->frame.format = new_format;
|
||||
c->frame.full_range = new_range;
|
||||
range = c->frame.full_range ?
|
||||
VIDEO_RANGE_FULL : VIDEO_RANGE_PARTIAL;
|
||||
range = c->frame.full_range ? VIDEO_RANGE_FULL
|
||||
: VIDEO_RANGE_PARTIAL;
|
||||
video_format_get_parameters(VIDEO_CS_DEFAULT, range,
|
||||
c->frame.color_matrix,
|
||||
c->frame.color_range_min,
|
||||
c->frame.color_range_max);
|
||||
c->frame.color_matrix,
|
||||
c->frame.color_range_min,
|
||||
c->frame.color_range_max);
|
||||
}
|
||||
|
||||
while (c->frame.data[i]) {
|
||||
|
|
@ -365,17 +373,17 @@ static unsigned vlcs_video_format(void **p_data, char *chroma, unsigned *width,
|
|||
}
|
||||
|
||||
static void vlcs_audio_play(void *data, const void *samples, unsigned count,
|
||||
int64_t pts)
|
||||
int64_t pts)
|
||||
{
|
||||
struct vlc_source *c = data;
|
||||
size_t size = get_audio_size(c->audio.format, c->audio.speakers, count);
|
||||
|
||||
if (c->audio_capacity < count) {
|
||||
c->audio.data[0] = brealloc((void*)c->audio.data[0], size);
|
||||
c->audio.data[0] = brealloc((void *)c->audio.data[0], size);
|
||||
c->audio_capacity = count;
|
||||
}
|
||||
|
||||
memcpy((void*)c->audio.data[0], samples, size);
|
||||
memcpy((void *)c->audio.data[0], samples, size);
|
||||
c->audio.timestamp = (uint64_t)pts * 1000ULL - time_start;
|
||||
c->audio.frames = count;
|
||||
|
||||
|
|
@ -383,7 +391,7 @@ static void vlcs_audio_play(void *data, const void *samples, unsigned count,
|
|||
}
|
||||
|
||||
static int vlcs_audio_setup(void **p_data, char *format, unsigned *rate,
|
||||
unsigned *channels)
|
||||
unsigned *channels)
|
||||
{
|
||||
struct vlc_source *c = *p_data;
|
||||
enum audio_format new_audio_format;
|
||||
|
|
@ -395,22 +403,22 @@ static int vlcs_audio_setup(void **p_data, char *format, unsigned *rate,
|
|||
/* don't free audio data if the data is the same format */
|
||||
if (c->audio.format == new_audio_format &&
|
||||
c->audio.samples_per_sec == *rate &&
|
||||
c->audio.speakers == (enum speaker_layout)*channels)
|
||||
c->audio.speakers == (enum speaker_layout) * channels)
|
||||
return 0;
|
||||
|
||||
c->audio_capacity = 0;
|
||||
bfree((void*)c->audio.data[0]);
|
||||
bfree((void *)c->audio.data[0]);
|
||||
|
||||
memset(&c->audio, 0, sizeof(c->audio));
|
||||
c->audio.speakers = (enum speaker_layout)*channels;
|
||||
c->audio.speakers = (enum speaker_layout) * channels;
|
||||
c->audio.samples_per_sec = *rate;
|
||||
c->audio.format = new_audio_format;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void add_file(struct vlc_source *c, struct darray *array,
|
||||
const char *path, int network_caching, int track_index,
|
||||
int subtitle_index, bool subtitle_enable)
|
||||
const char *path, int network_caching, int track_index,
|
||||
int subtitle_index, bool subtitle_enable)
|
||||
{
|
||||
DARRAY(struct media_file_data) new_files;
|
||||
struct media_file_data data;
|
||||
|
|
@ -438,21 +446,20 @@ static void add_file(struct vlc_source *c, struct darray *array,
|
|||
if (is_url) {
|
||||
struct dstr network_caching_option = {0};
|
||||
dstr_catf(&network_caching_option,
|
||||
":network-caching=%d", network_caching);
|
||||
":network-caching=%d", network_caching);
|
||||
libvlc_media_add_option_(new_media,
|
||||
network_caching_option.array);
|
||||
network_caching_option.array);
|
||||
dstr_free(&network_caching_option);
|
||||
}
|
||||
struct dstr track_option = { 0 };
|
||||
dstr_catf(&track_option,
|
||||
":audio-track=%d", track_index - 1);
|
||||
struct dstr track_option = {0};
|
||||
dstr_catf(&track_option, ":audio-track=%d", track_index - 1);
|
||||
libvlc_media_add_option_(new_media, track_option.array);
|
||||
dstr_free(&track_option);
|
||||
|
||||
struct dstr sub_option = {0};
|
||||
if (subtitle_enable) {
|
||||
dstr_catf(&sub_option,
|
||||
":sub-track=%d", subtitle_index - 1);
|
||||
dstr_catf(&sub_option, ":sub-track=%d",
|
||||
subtitle_index - 1);
|
||||
}
|
||||
libvlc_media_add_option_(new_media, sub_option.array);
|
||||
dstr_free(&sub_option);
|
||||
|
|
@ -481,8 +488,10 @@ static bool valid_extension(const char *ext)
|
|||
e = strchr(b, ';');
|
||||
|
||||
for (;;) {
|
||||
if (e) dstr_ncopy(&test, b, e - b);
|
||||
else dstr_copy(&test, b);
|
||||
if (e)
|
||||
dstr_ncopy(&test, b, e - b);
|
||||
else
|
||||
dstr_copy(&test, b);
|
||||
|
||||
if (dstr_cmp(&test, ext) == 0) {
|
||||
valid = true;
|
||||
|
|
@ -569,17 +578,15 @@ static void vlcs_update(void *data, obs_data_t *settings)
|
|||
dstr_cat_ch(&dir_path, '/');
|
||||
dstr_cat(&dir_path, ent->d_name);
|
||||
add_file(c, &new_files.da, dir_path.array,
|
||||
network_caching, track_index,
|
||||
subtitle_index,
|
||||
subtitle_enable);
|
||||
network_caching, track_index,
|
||||
subtitle_index, subtitle_enable);
|
||||
}
|
||||
|
||||
dstr_free(&dir_path);
|
||||
os_closedir(dir);
|
||||
} else {
|
||||
add_file(c, &new_files.da, path, network_caching,
|
||||
track_index, subtitle_index,
|
||||
subtitle_enable);
|
||||
track_index, subtitle_index, subtitle_enable);
|
||||
}
|
||||
|
||||
obs_data_release(item);
|
||||
|
|
@ -634,19 +641,19 @@ static void vlcs_update(void *data, obs_data_t *settings)
|
|||
libvlc_media_list_lock_(media_list);
|
||||
for (size_t i = 0; i < c->files.num; i++)
|
||||
libvlc_media_list_add_media_(media_list,
|
||||
c->files.array[i].media);
|
||||
c->files.array[i].media);
|
||||
libvlc_media_list_unlock_(media_list);
|
||||
|
||||
libvlc_media_list_player_set_media_list_(c->media_list_player,
|
||||
media_list);
|
||||
media_list);
|
||||
libvlc_media_list_release_(media_list);
|
||||
|
||||
libvlc_media_list_player_set_playback_mode_(c->media_list_player,
|
||||
c->loop ? libvlc_playback_mode_loop :
|
||||
libvlc_playback_mode_default);
|
||||
libvlc_media_list_player_set_playback_mode_(
|
||||
c->media_list_player, c->loop ? libvlc_playback_mode_loop
|
||||
: libvlc_playback_mode_default);
|
||||
|
||||
if (c->files.num &&
|
||||
(c->behavior == BEHAVIOR_ALWAYS_PLAY || obs_source_active(c->source)))
|
||||
if (c->files.num && (c->behavior == BEHAVIOR_ALWAYS_PLAY ||
|
||||
obs_source_active(c->source)))
|
||||
libvlc_media_list_player_play_(c->media_list_player);
|
||||
else
|
||||
obs_source_output_video(c->source, NULL);
|
||||
|
|
@ -701,7 +708,7 @@ static void vlcs_playlist_prev(void *data)
|
|||
}
|
||||
|
||||
static void vlcs_play_pause_hotkey(void *data, obs_hotkey_id id,
|
||||
obs_hotkey_t *hotkey, bool pressed)
|
||||
obs_hotkey_t *hotkey, bool pressed)
|
||||
{
|
||||
UNUSED_PARAMETER(id);
|
||||
UNUSED_PARAMETER(hotkey);
|
||||
|
|
@ -713,7 +720,7 @@ static void vlcs_play_pause_hotkey(void *data, obs_hotkey_id id,
|
|||
}
|
||||
|
||||
static void vlcs_restart_hotkey(void *data, obs_hotkey_id id,
|
||||
obs_hotkey_t *hotkey, bool pressed)
|
||||
obs_hotkey_t *hotkey, bool pressed)
|
||||
{
|
||||
UNUSED_PARAMETER(id);
|
||||
UNUSED_PARAMETER(hotkey);
|
||||
|
|
@ -724,8 +731,8 @@ static void vlcs_restart_hotkey(void *data, obs_hotkey_id id,
|
|||
vlcs_restart(c);
|
||||
}
|
||||
|
||||
static void vlcs_stop_hotkey(void *data, obs_hotkey_id id,
|
||||
obs_hotkey_t *hotkey, bool pressed)
|
||||
static void vlcs_stop_hotkey(void *data, obs_hotkey_id id, obs_hotkey_t *hotkey,
|
||||
bool pressed)
|
||||
{
|
||||
UNUSED_PARAMETER(id);
|
||||
UNUSED_PARAMETER(hotkey);
|
||||
|
|
@ -737,7 +744,7 @@ static void vlcs_stop_hotkey(void *data, obs_hotkey_id id,
|
|||
}
|
||||
|
||||
static void vlcs_playlist_next_hotkey(void *data, obs_hotkey_id id,
|
||||
obs_hotkey_t *hotkey, bool pressed)
|
||||
obs_hotkey_t *hotkey, bool pressed)
|
||||
{
|
||||
UNUSED_PARAMETER(id);
|
||||
UNUSED_PARAMETER(hotkey);
|
||||
|
|
@ -749,7 +756,7 @@ static void vlcs_playlist_next_hotkey(void *data, obs_hotkey_id id,
|
|||
}
|
||||
|
||||
static void vlcs_playlist_prev_hotkey(void *data, obs_hotkey_id id,
|
||||
obs_hotkey_t *hotkey, bool pressed)
|
||||
obs_hotkey_t *hotkey, bool pressed)
|
||||
{
|
||||
UNUSED_PARAMETER(id);
|
||||
UNUSED_PARAMETER(hotkey);
|
||||
|
|
@ -765,30 +772,25 @@ static void *vlcs_create(obs_data_t *settings, obs_source_t *source)
|
|||
struct vlc_source *c = bzalloc(sizeof(*c));
|
||||
c->source = source;
|
||||
|
||||
c->play_pause_hotkey = obs_hotkey_register_source(source,
|
||||
"VLCSource.PlayPause",
|
||||
obs_module_text("PlayPause"),
|
||||
vlcs_play_pause_hotkey, c);
|
||||
c->play_pause_hotkey = obs_hotkey_register_source(
|
||||
source, "VLCSource.PlayPause", obs_module_text("PlayPause"),
|
||||
vlcs_play_pause_hotkey, c);
|
||||
|
||||
c->restart_hotkey = obs_hotkey_register_source(source,
|
||||
"VLCSource.Restart",
|
||||
obs_module_text("Restart"),
|
||||
vlcs_restart_hotkey, c);
|
||||
c->restart_hotkey = obs_hotkey_register_source(
|
||||
source, "VLCSource.Restart", obs_module_text("Restart"),
|
||||
vlcs_restart_hotkey, c);
|
||||
|
||||
c->stop_hotkey = obs_hotkey_register_source(source,
|
||||
"VLCSource.Stop",
|
||||
obs_module_text("Stop"),
|
||||
vlcs_stop_hotkey, c);
|
||||
c->stop_hotkey = obs_hotkey_register_source(source, "VLCSource.Stop",
|
||||
obs_module_text("Stop"),
|
||||
vlcs_stop_hotkey, c);
|
||||
|
||||
c->playlist_next_hotkey = obs_hotkey_register_source(source,
|
||||
"VLCSource.PlaylistNext",
|
||||
obs_module_text("PlaylistNext"),
|
||||
vlcs_playlist_next_hotkey, c);
|
||||
c->playlist_next_hotkey = obs_hotkey_register_source(
|
||||
source, "VLCSource.PlaylistNext",
|
||||
obs_module_text("PlaylistNext"), vlcs_playlist_next_hotkey, c);
|
||||
|
||||
c->playlist_prev_hotkey = obs_hotkey_register_source(source,
|
||||
"VLCSource.PlaylistPrev",
|
||||
obs_module_text("PlaylistPrev"),
|
||||
vlcs_playlist_prev_hotkey, c);
|
||||
c->playlist_prev_hotkey = obs_hotkey_register_source(
|
||||
source, "VLCSource.PlaylistPrev",
|
||||
obs_module_text("PlaylistPrev"), vlcs_playlist_prev_hotkey, c);
|
||||
|
||||
pthread_mutex_init_value(&c->mutex);
|
||||
if (pthread_mutex_init(&c->mutex, NULL) != 0)
|
||||
|
|
@ -806,23 +808,22 @@ static void *vlcs_create(obs_data_t *settings, obs_source_t *source)
|
|||
goto error;
|
||||
|
||||
libvlc_media_list_player_set_media_player_(c->media_list_player,
|
||||
c->media_player);
|
||||
c->media_player);
|
||||
|
||||
libvlc_video_set_callbacks_(c->media_player,
|
||||
vlcs_video_lock, NULL, vlcs_video_display,
|
||||
c);
|
||||
libvlc_video_set_format_callbacks_(c->media_player,
|
||||
vlcs_video_format, NULL);
|
||||
libvlc_video_set_callbacks_(c->media_player, vlcs_video_lock, NULL,
|
||||
vlcs_video_display, c);
|
||||
libvlc_video_set_format_callbacks_(c->media_player, vlcs_video_format,
|
||||
NULL);
|
||||
|
||||
libvlc_audio_set_callbacks_(c->media_player,
|
||||
vlcs_audio_play, NULL, NULL, NULL, NULL, c);
|
||||
libvlc_audio_set_format_callbacks_(c->media_player,
|
||||
vlcs_audio_setup, NULL);
|
||||
libvlc_audio_set_callbacks_(c->media_player, vlcs_audio_play, NULL,
|
||||
NULL, NULL, NULL, c);
|
||||
libvlc_audio_set_format_callbacks_(c->media_player, vlcs_audio_setup,
|
||||
NULL);
|
||||
|
||||
libvlc_event_manager_t *event_manager;
|
||||
event_manager = libvlc_media_player_event_manager_(c->media_player);
|
||||
libvlc_event_attach_(event_manager, libvlc_MediaPlayerEndReached,
|
||||
vlcs_stopped, c);
|
||||
vlcs_stopped, c);
|
||||
|
||||
obs_source_update(source, NULL);
|
||||
|
||||
|
|
@ -864,7 +865,7 @@ static void vlcs_defaults(obs_data_t *settings)
|
|||
obs_data_set_default_bool(settings, S_LOOP, true);
|
||||
obs_data_set_default_bool(settings, S_SHUFFLE, false);
|
||||
obs_data_set_default_string(settings, S_BEHAVIOR,
|
||||
S_BEHAVIOR_STOP_RESTART);
|
||||
S_BEHAVIOR_STOP_RESTART);
|
||||
obs_data_set_default_int(settings, S_NETWORK_CACHING, 400);
|
||||
obs_data_set_default_int(settings, S_TRACK, 1);
|
||||
obs_data_set_default_bool(settings, S_SUBTITLE_ENABLE, false);
|
||||
|
|
@ -900,13 +901,14 @@ static obs_properties_t *vlcs_properties(void *data)
|
|||
}
|
||||
|
||||
p = obs_properties_add_list(ppts, S_BEHAVIOR, T_BEHAVIOR,
|
||||
OBS_COMBO_TYPE_LIST, OBS_COMBO_FORMAT_STRING);
|
||||
OBS_COMBO_TYPE_LIST,
|
||||
OBS_COMBO_FORMAT_STRING);
|
||||
obs_property_list_add_string(p, T_BEHAVIOR_STOP_RESTART,
|
||||
S_BEHAVIOR_STOP_RESTART);
|
||||
S_BEHAVIOR_STOP_RESTART);
|
||||
obs_property_list_add_string(p, T_BEHAVIOR_PAUSE_UNPAUSE,
|
||||
S_BEHAVIOR_PAUSE_UNPAUSE);
|
||||
S_BEHAVIOR_PAUSE_UNPAUSE);
|
||||
obs_property_list_add_string(p, T_BEHAVIOR_ALWAYS_PLAY,
|
||||
S_BEHAVIOR_ALWAYS_PLAY);
|
||||
S_BEHAVIOR_ALWAYS_PLAY);
|
||||
|
||||
dstr_cat(&filter, "Media Files (");
|
||||
dstr_copy(&exts, EXTENSIONS_MEDIA);
|
||||
|
|
@ -930,18 +932,18 @@ static obs_properties_t *vlcs_properties(void *data)
|
|||
dstr_cat(&filter, ")");
|
||||
|
||||
obs_properties_add_editable_list(ppts, S_PLAYLIST, T_PLAYLIST,
|
||||
OBS_EDITABLE_LIST_TYPE_FILES_AND_URLS,
|
||||
filter.array, path.array);
|
||||
OBS_EDITABLE_LIST_TYPE_FILES_AND_URLS,
|
||||
filter.array, path.array);
|
||||
dstr_free(&path);
|
||||
dstr_free(&filter);
|
||||
dstr_free(&exts);
|
||||
|
||||
obs_properties_add_int(ppts, S_NETWORK_CACHING, T_NETWORK_CACHING,
|
||||
100, 60000, 10);
|
||||
obs_properties_add_int(ppts, S_NETWORK_CACHING, T_NETWORK_CACHING, 100,
|
||||
60000, 10);
|
||||
obs_properties_add_int(ppts, S_TRACK, T_TRACK, 1, 10, 1);
|
||||
obs_properties_add_bool(ppts, S_SUBTITLE_ENABLE, T_SUBTITLE_ENABLE);
|
||||
obs_properties_add_int(ppts, S_SUBTITLE_TRACK, T_SUBTITLE_TRACK,
|
||||
1, 10, 1);
|
||||
obs_properties_add_int(ppts, S_SUBTITLE_TRACK, T_SUBTITLE_TRACK, 1, 10,
|
||||
1);
|
||||
|
||||
return ppts;
|
||||
}
|
||||
|
|
@ -949,9 +951,8 @@ static obs_properties_t *vlcs_properties(void *data)
|
|||
struct obs_source_info vlc_source_info = {
|
||||
.id = "vlc_source",
|
||||
.type = OBS_SOURCE_TYPE_INPUT,
|
||||
.output_flags = OBS_SOURCE_ASYNC_VIDEO |
|
||||
OBS_SOURCE_AUDIO |
|
||||
OBS_SOURCE_DO_NOT_DUPLICATE,
|
||||
.output_flags = OBS_SOURCE_ASYNC_VIDEO | OBS_SOURCE_AUDIO |
|
||||
OBS_SOURCE_DO_NOT_DUPLICATE,
|
||||
.get_name = vlcs_get_name,
|
||||
.create = vlcs_create,
|
||||
.destroy = vlcs_destroy,
|
||||
|
|
@ -959,5 +960,5 @@ struct obs_source_info vlc_source_info = {
|
|||
.get_defaults = vlcs_defaults,
|
||||
.get_properties = vlcs_properties,
|
||||
.activate = vlcs_activate,
|
||||
.deactivate = vlcs_deactivate
|
||||
.deactivate = vlcs_deactivate,
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue