Menu

#10 syntax error in program code output of multitrack DVD

Unstable (example)
open
nobody
None
5
2025-02-17
2025-02-17
Adrian Ho
No

I just noticed that the track array in JSON output is missing intermediate commas:

% lsdvd -Oj my.iso
{
  "device" : "my.iso",
  "title" : "MY DVD",
  "vmg_id" : "DVDVIDEO-VMG",
  "provider_id" : "MY DVD",
  "track" : [
    {
      "ix" : 1,
      "length" : 32.700,
      "vts_id" : "DVDVIDEO-VTS"    }    {
      "ix" : 2,
      "length" : 5778.000,
      "vts_id" : "DVDVIDEO-VTS"    }    {
      "ix" : 3,
      "length" : 5343.800,
      "vts_id" : "DVDVIDEO-VTS"    }    {
      "ix" : 4,
      "length" : 1060.233,
      "vts_id" : "DVDVIDEO-VTS"    }    {
      "ix" : 5,
      "length" : 849.400,
      "vts_id" : "DVDVIDEO-VTS"    }    {
      "ix" : 6,
      "length" : 490.000,
      "vts_id" : "DVDVIDEO-VTS"    }    {
      "ix" : 7,
      "length" : 45.000,
      "vts_id" : "DVDVIDEO-VTS"    }  ],
  "dvddiscid" : "<redacted>",
  "longest_track" : 2
}

This issue is likely related to this commit remark in the JSON checkin:

Restructure all program code output to avoid redundant trailing commas,

and actually breaks all program output (Perl, Python and Ruby output all have the same syntax error).

Discussion

  • Petter Reinholdtsen

    [Adrian Ho]

    I just noticed that the track array in JSON output is missing
    intermediate commas:

    Are you able to extend testsuite/output-json to demonstrate this issue?
    In the example generated to test on, the intermittend commas are
    present, so there is something about your my.iso that is not present in
    the test ISO generated by the test suite.

    --
    Happy hacking
    Petter Reinholdtsen

     
  • Adrian Ho

    Adrian Ho - 2025-02-17

    If you mean "extend testsuite/testdvd-template.xml to specify a multitrack DVD", I'll give it a shot, but it might take a while.

    In the meantime, attached are the output-json and output-xml outputs of the same ISO. xmllint in output-xml returned no errors, while output-json threw jq: parse error: Expected separator between values at line 63, column 10. Essentially, every multi-item array in the JSON (and Ruby/Perl/Python outputs) is missing all the commas that separate each item.

    Oh, and I just noticed I filed this in the wrong category. Sorry.

     

    Last edit: Adrian Ho 2025-02-17
    • Petter Reinholdtsen

      [Adrian Ho]

      If you mean "extend testsuite/testdvd-template.xml to specify a
      multitrack DVD", I'll give it a shot, but it might take a while.

      Yes, that is exactly what I meant. But do not worry, I managed to
      extend it in a way that seem to have triggered the bug you reported, and
      implemented a fix in 9c55bc309d669a21bf0c5ad7317b5442d83daa86. It will
      be included in the next release.

      Oh, and I just noticed I filed this in the wrong category. Sorry.

      No worries. :)

      PS: Your email provider rejects emails from me.

      --
      Happy hacking
      Petter Reinholdtsen

       

Log in to post a comment.

MongoDB Logo MongoDB