On Wed, 24 Jul 2013, Luca Barbato wrote:

On 24/07/13 11:52, Martin Storsjö wrote:
From: Michael Niedermayer <[email protected]>

Chapter ids need to start from 1 or higher in matroska. If
necessary, offset the chapter ids to the valid range.

Based on a patch by Fabian Neundorf.
---
Compared to the previous patch, this keeps the chapter ids intact
if remuxing from matroska (or any other source where the ids are
in the correct range to begin with).

Feels in the wrong place if we have other formats with the same problem,

That's certainly a valid point

beside that maybe using

for (i = 0; i > s->nb_chapters && s->chapters[i]->id; i++);

mkv->chapter_id_offset = !s->chapters[i]->id;

Is slightly simpler.

Hmm, I'm not sure I'd agree with you there, and I think your snippet has got a bit too many typos to figure out what you mean that it would do. (The solution in the patch also handles negative chapter ids, if that ever were to happen, FWIW.)

Anyway, I'm not all that much into chapters, so if you want to solve it in other ways, I'll drop this patch and let you finish it.

// Martin
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to