-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Various fixes #3
Conversation
3de34a4
to
edcc217
Compare
We used to add only the track of the current frame when flushing, so it does not guarantee all tracks inclusion. With current approach we will have in a cluster all tracks on their first frame added.
} | ||
|
||
boolean addCue = !cluster.getTracks().contains(frame.getTrackNo()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The isSeekable
check was removed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed it.
@@ -53,7 +53,7 @@ public class MatroskaFileTrack | |||
private boolean flagEnabled = true; | |||
private boolean flagDefault = true; | |||
private boolean flagForced = false; | |||
private boolean flagLacing = true; | |||
private boolean flagLacing = false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this defaults to true
in the spec, and it seems like a safe default (the track MAY contain blocks using lacing, while false
asserts that it doesn't). Why change it? If we want it false
for our case we should probably set it in jmr
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 will drop the commit.
@@ -53,6 +54,8 @@ public class MatroskaFileWriter implements Closeable | |||
|
|||
private long clusterLen = 0; | |||
|
|||
private long lastDuration = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggest renaming to duration
or segmentDuration
defaultDuration = tr.getDefaultDuration(); | ||
} | ||
|
||
lastDuration = cluster.getLastTimecode() + TimeUnit.NANOSECONDS.toMillis(defaultDuration);; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This assumes that the first timecode is 0, and that frames from all tracks are always added in order (e.g. addFrame(track=1, timecode=1000); addFrame(track=2, timecode=900) is handled incorrectly and we may end up using something like that after buffering in jmr).
I suggest just saving the smallest and largest timecode of all frames added to the segment, then setting duration to the difference. cluster.getLastTimecode()
is always just frame.getTimecode()
, so no need to expose it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed that, thanks.
This pull request includes several updates to the Matroska file format handling in the
src/main/java/org/ebml/matroska
directory. The changes primarily involve the addition and removal of elements in theMatroskaDocType
enum and the correspondingMatroskaDocTypes
class, as well as updates to methods for writing and updating Matroska file elements.