[FFmpeg-devel] [PATCH]Fix default stream flag value wrt matroska muxing

Carl Eugen Hoyos cehoyos at ag.or.at
Mon Jan 28 14:31:32 CET 2013

Hendrik Leppkes <h.leppkes <at> gmail.com> writes:

> > Alternative, simpler patch attached that makes 
> > AV_DISPOSITION_DEFAULT the default for new streams 
> > and only resets it in demuxers that set the flag
> > correctly (missing nut tests and changes).
> Both attempts seem not-optimal. The demuxer already 
> behaves as the spec defines it, so it shouldn't be 
> changed.

Does my second patch really change the demuxer's behaviour?
(I completely agree with your argumentation regarding my 
original patch.)

If you think that without the patch, it did set a flag 
that it now does not set anymore, this can be changed:
if (track->flag_default) {
  st->disposition |= AV_DISPOSITION_DEFAULT;
} else {
  st->disposition &= ~AV_DISPOSITION_DEFAULT;

Or do I misunderstand you?

> What i would do is check all input streams in the muxer 
> (ie in mkv_write_tracks), and if none have a default 
> disposition, then mark the first of each type as such 
> (first audio, first video, first subtitle).

I have no strong opinion about this but it seems like a 
mostly unrelated (and radical?) change in the muxers 

> But if one stream is marked as default, then keep that
> flag, and write it as 0 for all other streams.

This would of course also fix the ticket.

Thank you for looking into this, Carl Eugen

More information about the ffmpeg-devel mailing list