Skip to content

Commit

Permalink
Add a first message counter value
Browse files Browse the repository at this point in the history
Simplest fix for #481
  • Loading branch information
nigelmegitt committed May 8, 2018
1 parent 7a595d4 commit 00a94c9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
5 changes: 3 additions & 2 deletions ebu_tt_live/carriage/filesystem.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,20 +72,21 @@ def __init__(self,
file_name_pattern = CFG_FILENAME_PATTERN,
message_file_name_pattern = CFG_MESSAGE_PATTERN,
circular_buf_size = 0,
suppress_manifest = False):
suppress_manifest = False,
first_msg_counter = 0):
self._dirpath = dirpath
if not os.path.exists(self._dirpath):
os.makedirs(self._dirpath)
self._file_name_pattern = file_name_pattern
self._message_file_name_pattern = message_file_name_pattern
self._counter = 0
self._msg_counter = first_msg_counter
self._circular_buf_size = circular_buf_size
if circular_buf_size > 0 :
self._circular_buf = RotatingFileBuffer(maxlen=circular_buf_size)
self._suppress_manifest = suppress_manifest
# Get a set of default clocks
self._default_clocks = {}
self._msg_counter = 0

def _get_default_clock(self, sequence_identifier, time_base, clock_mode=None):
clock_obj = self._default_clocks.get(sequence_identifier, None)
Expand Down
7 changes: 6 additions & 1 deletion ebu_tt_live/config/carriage.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,10 @@ class FilesystemOutput(ConfigurableComponent):
default=False,
doc='Suppress output of a manifest file (default false)'
)
required_config.add_option(
'begin_count',
default=0,
doc='Value to begin counting at for patterns including {counter}; the first output value will be this plus 1.')

def __init__(self, config, local_config):
super(FilesystemOutput, self).__init__(config, local_config)
Expand All @@ -83,7 +87,8 @@ def __init__(self, config, local_config):
file_name_pattern=self.config.filename_pattern,
message_file_name_pattern=self.config.message_filename_pattern,
circular_buf_size=self.config.rotating_buf,
suppress_manifest=self.config.suppress_manifest)
suppress_manifest=self.config.suppress_manifest,
first_msg_counter=self.config.begin_count)



Expand Down

0 comments on commit 00a94c9

Please sign in to comment.