[FFmpeg-devel] [PATCH 16/17] avformat/assenc: mux an event header if none are found in extradata
Clément Bœsch
u at pkh.me
Sat Sep 27 17:35:16 CEST 2014
On Wed, Sep 24, 2014 at 01:23:08PM +0200, Clément Bœsch wrote:
> On Wed, Sep 24, 2014 at 01:20:36PM +0200, Nicolas George wrote:
> > Le jour de la Raison, an CCXXII, Clément Bœsch a écrit :
> > > ---
> > > libavformat/assenc.c | 2 ++
> > > 1 file changed, 2 insertions(+)
> > >
> > > diff --git a/libavformat/assenc.c b/libavformat/assenc.c
> > > index 236d021..5779e92 100644
> > > --- a/libavformat/assenc.c
> > > +++ b/libavformat/assenc.c
> > > @@ -54,6 +54,8 @@ static int write_header(AVFormatContext *s)
> > > if (avctx->extradata[avctx->extradata_size - 1] != '\n')
> > > avio_write(s->pb, "\r\n", 2);
> > > }
> > > + if (!strstr(avctx->extradata, "\n[Events]"))
> > > + avio_printf(s->pb, "[Events]\r\nFormat: Layer, Start, End, Style, Actor, MarginL, MarginR, MarginV, Effect, Text\r\n");
> > > avio_flush(s->pb);
> > >
> > > return 0;
> >
> > Can you point out in what case it is necessary? Broken input file?
> >
> > Maybe a warning should be printed.
> >
>
> No, this happens when people follow the specifications from matroska:
> these two lines are not supposed to be muxed into the
> CodecPrivate/extradata. That doesn't happen in practice (because you need
> to store the Comments below the Format line, in the CodecPrivate), but it
> can happen, and mkvextract seems to be able to deal with that by doing
> something similar to that.
>
Applied.
--
Clément B.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 473 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20140927/3d7fce6c/attachment.asc>
More information about the ffmpeg-devel
mailing list