def extract_common(source):
    segment_timeline = source.find(_add_ns('SegmentTimeline'))
    if (segment_timeline is not None):
        s_e = segment_timeline.findall(_add_ns('S'))
        if s_e:
            ms_info['total_number'] = 0
            ms_info['s'] = []
            for s in s_e:
                r = int(s.get('r', 0))
                ms_info['total_number'] += (1 + r)
                ms_info['s'].append({'t': int(s.get('t', 0)), 'd': int(s.attrib['d']), 'r': r})
    start_number = source.get('startNumber')
    if start_number:
        ms_info['start_number'] = int(start_number)
    timescale = source.get('timescale')
    if timescale:
        ms_info['timescale'] = int(timescale)
    segment_duration = source.get('duration')
    if segment_duration:
        ms_info['segment_duration'] = float(segment_duration)
def extract_common(source):
    segment_timeline = source.find(_add_ns('SegmentTimeline'))
    if (segment_timeline is not None):
        s_e = segment_timeline.findall(_add_ns('S'))
        if s_e:
            ms_info['total_number'] = 0
            ms_info['s'] = []
            for s in s_e:
                r = int(s.get('r', 0))
                ms_info['total_number'] += (1 + r)
                ms_info['s'].append({'t': int(s.get('t', 0)), 'd': int(s.attrib['d']), 'r': r})
    start_number = source.get('startNumber')
    if start_number:
        ms_info['start_number'] = int(start_number)
    timescale = source.get('timescale')
    if timescale:
        ms_info['timescale'] = int(timescale)
    segment_duration = source.get('duration')
    if segment_duration:
        ms_info['segment_duration'] = float(segment_duration)