[FFmpeg-cvslog] r15424 - trunk/libavformat/assdec.c
Michael Niedermayer
michaelni
Sat Sep 27 23:27:14 CEST 2008
On Sat, Sep 27, 2008 at 02:41:32PM +0200, Anton Khirnov wrote:
> On Fri, Sep 26, 2008 at 5:24 AM, michael <subversion at mplayerhq.hu> wrote:
> > Author: michael
> > Date: Fri Sep 26 05:24:05 2008
> > New Revision: 15424
> >
> > Log:
> > Do not loose the '\n'.
> >
> >
> > Modified:
> > trunk/libavformat/assdec.c
> >
> > Modified: trunk/libavformat/assdec.c
> > ==============================================================================
> > --- trunk/libavformat/assdec.c (original)
> > +++ trunk/libavformat/assdec.c Fri Sep 26 05:24:05 2008
> > @@ -140,7 +140,7 @@ static int read_header(AVFormatContext *
> > ass->event[i]= p;
> > while(*p && *p != '\n')
> > p++;
> > - *p++ = 0;
> > + p++;
> > }
> >
> > qsort(ass->event, ass->event_count, sizeof(*ass->event), event_cmp);
> > @@ -156,14 +156,15 @@ fail:
> > static int read_packet(AVFormatContext *s, AVPacket *pkt)
> > {
> > ASSContext *ass = s->priv_data;
> > - uint8_t *p;
> > + uint8_t *p, *end;
> >
> > if(ass->event_index >= ass->event_count)
> > return AVERROR(EIO);
> >
> > p= ass->event[ ass->event_index ];
> >
> > - av_new_packet(pkt, strlen(p));
> > + end= strchr(p, '\n');
> > + av_new_packet(pkt, end ? end-p+1 : strlen(p));
> > pkt->flags |= PKT_FLAG_KEY;
> > pkt->pos= p - ass->event_buffer + s->streams[0]->codec->extradata_size;
> > pkt->pts= pkt->dts= get_pts(p);
> >
> I'd say the newlines here are part of the container, not subtitle
> stream so we shouldn't keep them.
The newlines are needed to seperate packets, containers like mpeg-ps/ts would
need them.
besides simply concatenating packets = .ass which matches other things like
h26*/mpeg*
> Besides this is incompatible with
> ASS packets produced by matroskadec.
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
Dictatorship naturally arises out of democracy, and the most aggravated
form of tyranny and slavery out of the most extreme liberty. -- Plato
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-cvslog/attachments/20080927/676fd94a/attachment.pgp>
More information about the ffmpeg-cvslog
mailing list