Commit 6937002f authored by norvell's avatar norvell
Browse files

Fix frame count in cut_bs.py

parent 7d16ead2
Loading
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -75,10 +75,11 @@ def cut_from_start(fp, fp_out, start_frame=0, length=-1, start_with_sid=False):
        while not found and not eof:
            (sync_word, n_bits, data, eof) = get_next_frame(fp)
            if not eof:
                fr_cnt += 1
                if n_bits in SID_BITS:
                    found = True
                    fp.seek(-(4 + n_bits * 2), 1)  # Found SID, rewind
                else:
                    fr_cnt += 1
    # transfer frames
    while length != 0 and not eof:
        (sync_word, n_bits, data, eof) = get_next_frame(fp)