1. Victor Stinner
  2. hachoir
Issue #44 resolved

hachoir-metadata/video.py violates mkv spec on language tag

jimmy_kloss
created an issue

According to spec (http://matroska.org/technical/specs/index.html) Track:Language defaults to "eng", meaning a not set Language Tag should be interpreted as Language="eng"

This is not respected in video.py (class MkvMetadata):

def trackCommon(self, track, meta):
    if "Name/unicode" in track:
        meta.title = track["Name/unicode"].value
    if "Language/string" in track \
    and track["Language/string"].value not in ("mis", "und"):
        meta.language = track["Language/string"].value

The following should fix that:

def trackCommon(self, track, meta):
    if "Name/unicode" in track:
        meta.title = track["Name/unicode"].value
    if "Language/string" in track:
        if track["Language/string"].value not in ("mis", "und"):
            meta.language = track["Language/string"].value
    else:
        meta.language = "eng"

Comments (4)

  1. Log in to comment