Skip to content

Commit

Permalink
Audio and Video subdirectories
Browse files Browse the repository at this point in the history
  • Loading branch information
njovic committed Aug 31, 2024
1 parent 615493e commit ea42c4f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Source/com/drew/metadata/mkv/MkvReader.java
Original file line number Diff line number Diff line change
Expand Up @@ -138,9 +138,11 @@ private void createDirectories(Map<Integer, Object> data, Metadata metadata)
{
case 1:
dir = new VideoDirectory();
mapToDirectory(dir, (Map<Integer, Object>) data.get(ElementIDs.VIDEO));
break;
case 2:
dir = new AudioDirectory();
mapToDirectory(dir, (Map<Integer, Object>) data.get(ElementIDs.AUDIO));
break;
}
if (dir != null)
Expand Down Expand Up @@ -219,6 +221,7 @@ private void extractSubContext(final SequentialReader reader, Map<Integer, Objec
long size = decodeInteger(reader);
Object value = null;
EbmlElement element = ELEMENTS.get(eid);

if (element == null)
{
element = new EbmlElement(String.format("0x%02X [ unknown ]", eid), UNKNOWN);
Expand All @@ -230,6 +233,10 @@ private void extractSubContext(final SequentialReader reader, Map<Integer, Objec
break;
case INTEGER:
value = DataParser.getLong(reader, size);
if (eid == ElementIDs.DISPLAY_WIDTH)
{
System.out.println("VALUE " + value);
}
break;
case BINARY:
value = DataParser.getByteArray(reader, size);
Expand Down
1 change: 1 addition & 0 deletions Source/com/drew/metadata/mkv/VideoDirectory.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ public class VideoDirectory extends Directory
_tagNameMap.put(RANGE, "Color range");
_tagNameMap.put(DISPLAY_WIDTH, "Display width");
_tagNameMap.put(DISPLAY_HEIGHT, "Display height");
_tagNameMap.put(DISPLAY_UNIT, "Display unit");
}

public VideoDirectory()
Expand Down

0 comments on commit ea42c4f

Please sign in to comment.