Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions data/locale/en-US.ini
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ SubtitleEnabled="Subtitles Enabled"
SubtitleTrack="Subtitle Track"
SelectFile="Select File"
NoFileSelected="No File Selected"
UseHardwareDecoding="Use hardware decoding when available"
CloseFileWhenInactive="Close file when inactive"
CloseFileWhenInactive.Tooltip="Closes the file when the source is not being displayed on the stream or\nrecording. This allows the file to be changed when the source isn't active,\nbut there may be some startup delay when the source reactivates."
CurrentFileName="Current File"
Expand Down
6 changes: 6 additions & 0 deletions src/media-playlist-source.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ with this program. If not, see <https://www.gnu.org/licenses/>
#define S_FFMPEG_LOCAL_FILE "local_file"
#define S_FFMPEG_INPUT "input"
#define S_FFMPEG_IS_LOCAL_FILE "is_local_file"
#define S_FFMPEG_HW_DECODE "hw_decode"
#define S_FFMPEG_CLOSE_WHEN_INACTIVE "close_when_inactive"

#define T_(text) obs_module_text(text)
Expand All @@ -53,6 +54,7 @@ with this program. If not, see <https://www.gnu.org/licenses/>
#define T_CURRENT_FILE_NAME T_("CurrentFileName")
#define T_SELECT_FILE T_("SelectFile")
#define T_NO_FILE_SELECTED T_("NoFileSelected")
#define T_USE_HARDWARE_DECODING T_("UseHardwareDecoding")
#define T_FFMPEG_CLOSE_WHEN_INACTIVE T_("CloseFileWhenInactive")
#define T_FFMPEG_CLOSE_WHEN_INACTIVE_TOOLTIP T_("CloseFileWhenInactive.Tooltip")
#define T_SPEED T_("Speed")
Expand Down Expand Up @@ -986,6 +988,8 @@ static obs_properties_t *mps_properties(void *data)
obs_property_list_add_int(p, T_RESTART_BEHAVIOR_CURRENT_FILE, RESTART_BEHAVIOR_CURRENT_FILE);
obs_property_list_add_int(p, T_RESTART_BEHAVIOR_FIRST_FILE, RESTART_BEHAVIOR_FIRST_FILE);

obs_properties_add_bool(props, S_FFMPEG_HW_DECODE, T_USE_HARDWARE_DECODING);

p = obs_properties_add_bool(props, S_FFMPEG_CLOSE_WHEN_INACTIVE, T_FFMPEG_CLOSE_WHEN_INACTIVE);
obs_property_set_long_description(p, T_FFMPEG_CLOSE_WHEN_INACTIVE_TOOLTIP);

Expand Down Expand Up @@ -1133,8 +1137,10 @@ static void mps_update(void *data, obs_data_t *settings)
mps->speed = new_speed;

/* Internal media source settings */
mps->use_hw_decoding = obs_data_get_bool(settings, S_FFMPEG_HW_DECODE);
mps->close_when_inactive = obs_data_get_bool(settings, S_FFMPEG_CLOSE_WHEN_INACTIVE);
obs_data_t *media_source_settings = obs_data_create();
obs_data_set_bool(media_source_settings, S_FFMPEG_HW_DECODE, mps->use_hw_decoding);
obs_data_set_bool(media_source_settings, S_FFMPEG_CLOSE_WHEN_INACTIVE, mps->close_when_inactive);
obs_data_set_int(media_source_settings, S_SPEED, mps->speed);
obs_source_update(mps->current_media_source, media_source_settings);
Expand Down
1 change: 1 addition & 0 deletions src/media-playlist-source.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ struct media_playlist_source {
bool loop;
bool paused;
bool user_stopped;
bool use_hw_decoding;
bool close_when_inactive;
pthread_mutex_t mutex;
DARRAY(struct media_file_data) files;
Expand Down
Loading