Skip to content

Commit ea267fe

Browse files
committed
squash: Account for isSeekable when creating void block.
1 parent 1990174 commit ea267fe

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/main/java/org/ebml/matroska/MatroskaFileTags.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public long writeTags(final DataWriter ioDW, boolean checkBlockSize)
4141

4242
long len = tagsElem.writeElement(ioDW);
4343

44-
if (BLOCK_SIZE > tagsElem.getTotalSize())
44+
if (BLOCK_SIZE > tagsElem.getTotalSize() && ioDW.isSeekable())
4545
{
4646
new VoidElement(BLOCK_SIZE - tagsElem.getTotalSize()).writeElement(ioDW);
4747
return BLOCK_SIZE;

src/main/java/org/ebml/matroska/MatroskaFileTracks.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public long writeTracks(final DataWriter ioDW, boolean checkBlockSize)
4141

4242
long size = tracksElem.writeElement(ioDW);
4343

44-
if (BLOCK_SIZE > tracksElem.getTotalSize())
44+
if (BLOCK_SIZE > tracksElem.getTotalSize() && ioDW.isSeekable())
4545
{
4646
new VoidElement(BLOCK_SIZE - tracksElem.getTotalSize()).writeElement(ioDW);
4747
return BLOCK_SIZE;

0 commit comments

Comments
 (0)