MikeMoolenaar / MkvDefaultTrackChanger

Cross platform application to change the default subtitle and audio tracks in MKV video files.
https://mkvdefaulttrackchanger.pages.dev
GNU General Public License v3.0
46 stars 3 forks source link

Error - Byte Length Mismatch #18

Open IcedLemondrops opened 2 days ago

IcedLemondrops commented 2 days ago

Framework: .NET 8.0.2 RuntimeIdentifier: win-x64 OS: Microsoft Windows 10.0.19045

{ "filePath": "", "tracks": [ { "trackLengthByteNumber": 4386, "number": 1, "flagDefault": false, "flagDefaultByteNumber": 0, "flagForced": false, "flagForcedByteNumber": 0, "flagTypebytenumber": 4395, "type": "video", "name": "The Big Bang Theory | Season 02 (2008-2009) | 01: The Bad Fish Paradigm", "language": "eng" }, { "trackLengthByteNumber": 4576, "number": 2, "flagDefault": false, "flagDefaultByteNumber": 0, "flagForced": false, "flagForcedByteNumber": 0, "flagTypebytenumber": 4592, "type": "audio", "name": "DD 5.1 @ 640 kbps (Kuraj-Bambey \u043F\u043E \u0437\u0430\u043A\u0430\u0437\u0443 Paramount Comedy)", "language": "rus" }, { "trackLengthByteNumber": 4704, "number": 3, "flagDefault": true, "flagDefaultByteNumber": 4719, "flagForced": false, "flagForcedByteNumber": 0, "flagTypebytenumber": 4716, "type": "audio", "name": "DD 5.1 @ 640 kbps", "language": "eng" }, { "trackLengthByteNumber": 4774, "number": 4, "flagDefault": false, "flagDefaultByteNumber": 4793, "flagForced": false, "flagForcedByteNumber": 0, "flagTypebytenumber": 4790, "type": "subtitle", "name": "rus-sub", "language": "rus" }, { "trackLengthByteNumber": 4835, "number": 5, "flagDefault": false, "flagDefaultByteNumber": 4850, "flagForced": false, "flagForcedByteNumber": 0, "flagTypebytenumber": 4847, "type": "subtitle", "name": "eng-sub", "language": "eng" } ], "seekList": [ { "seekId": 357149030, "seekPosition": 4099, "seekPositionByteNumber": 70, "elementLength": 2 }, { "seekId": 374648427, "seekPosition": 4325, "seekPositionByteNumber": 85, "elementLength": 2 }, { "seekId": 475249515, "seekPosition": 2002361120, "seekPositionByteNumber": 100, "elementLength": 4 }, { "seekId": 307544935, "seekPosition": 2002386675, "seekPositionByteNumber": 117, "elementLength": 4 }, { "seekId": 272869232, "seekPosition": 6048, "seekPositionByteNumber": 134, "elementLength": 2 } ], "seekHeadCheckSum": null, "tracksCheckSum": null, "voidPosition": 136, "endPosition": 4883, "tracksPosition": 4383, "beginHeaderPosition": 4151 }

System.InvalidOperationException: New length bytes are not the same length as the old ones. Old length: 1, new length: 2 at MatroskaLib.ByteHelper.ChangeLength(List1 lsBytes, Int32 position, List1 lsLengthBytes, Int32 newAdition) at MatroskaLib.ByteHelper.ChangeLength(List1 lsBytes, Int32 position, UInt64 elementId, Int32 newAdition) at MatroskaLib.MatroskaWriter._ChangeTrackElements(List1 tracks, List1 lsBytes, Int32& offset) at MatroskaLib.MatroskaWriter.WriteMkvFile(MkvFile mkfFile, Boolean dryRun) at MatroskaLib.MkvFilesContainer.WriteChanges(Action1 setDefaultIfSelected) at MkvDefaultTrackChanger.MainForm.BtnApplyClicked(Object sender, EventArgs e)

MikeMoolenaar commented 2 days ago

Will look into this soon, thank you for reporting!

MikeMoolenaar commented 3 hours ago

I can't reproduce it unfortunately, could you share me the link to the file or the file itself via Email if you feel comfortable doing so? My email is in my Github profile.