[FFmpeg-devel] [PATCH]Basic XSUB encoder (take 5)

Reimar Döffinger Reimar.Doeffinger
Fri Jun 19 10:28:49 CEST 2009


On Thu, Jun 18, 2009 at 03:52:41PM +0200, Michael Niedermayer wrote:
> On Sat, May 23, 2009 at 11:03:31PM +0200, Reimar D?ffinger wrote:
> > On Sat, May 23, 2009 at 06:54:55PM +0200, Diego Biurrun wrote:
> > > On Sat, May 23, 2009 at 05:22:44PM +0200, Reimar D?ffinger wrote:
> > > > 
> > > > Haven't done anything on the muxer code part, but I fixed the trivial
> > > > stuff pointed out here and one or two more simplifications and updated
> > > > to SVN.
> > > 
> > > > --- libavcodec/xsubenc.c	(revision 0)
> > > > +++ libavcodec/xsubenc.c	(revision 0)
> > > > @@ -0,0 +1,224 @@
> > > > +    if (xsub_encode_rle(&pb,
> > > > +                h->rects[0]->pict.data[0],
> > > > +                h->rects[0]->pict.linesize[0]*2,
> > > > +                h->rects[0]->w, (h->rects[0]->h + 1) >> 1))
> > > > +
> > > > +    if (xsub_encode_rle(&pb,
> > > > +            h->rects[0]->pict.data[0] + h->rects[0]->pict.linesize[0],
> > > > +            h->rects[0]->pict.linesize[0]*2,
> > > > +            h->rects[0]->w, h->rects[0]->h >> 1))
> > > 
> > > This looks weirdly indented.
> > > 
> > > > --- libavformat/avienc.c	(revision 18911)
> > > > +++ libavformat/avienc.c	(working copy)
> > > > @@ -212,8 +215,10 @@
> > > > -        if(stream->codec_type == CODEC_TYPE_VIDEO)
> > > > +        if(stream->codec_type == CODEC_TYPE_VIDEO
> > > > +                || stream->codec_type == CODEC_TYPE_SUBTITLE)
> > > 
> > > If you keep the || on the first line, you can align this nicely.
> > 
> > Both changed, avi muxer and pts handling parts unchanged (those are
> > hopefully the only parts that need to be changed still).
> 
> [...]
> > Index: ffmpeg.c
> > ===================================================================
> > --- ffmpeg.c	(revision 18911)
> > +++ ffmpeg.c	(working copy)
> > @@ -818,6 +818,7 @@
> >          nb = 1;
> >  
> >      for(i = 0; i < nb; i++) {
> > +        sub->pts = av_rescale_q(pts, ist->st->time_base, AV_TIME_BASE_Q);
> >          subtitle_out_size = avcodec_encode_subtitle(enc, subtitle_out,
> >                                                      subtitle_out_max_size, sub);
> >  
> [...]
> > Index: libavcodec/avcodec.h
> > ===================================================================
> > --- libavcodec/avcodec.h	(revision 18915)
> > +++ libavcodec/avcodec.h	(working copy)
> > @@ -30,7 +30,7 @@
> >  #include "libavutil/avutil.h"
> >  
> >  #define LIBAVCODEC_VERSION_MAJOR 52
> > -#define LIBAVCODEC_VERSION_MINOR 29
> > +#define LIBAVCODEC_VERSION_MINOR 30
> >  #define LIBAVCODEC_VERSION_MICRO  0
> >  
> >  #define LIBAVCODEC_VERSION_INT  AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
> > @@ -2721,6 +2721,7 @@
> >      uint32_t end_display_time; /* relative to packet pts, in ms */
> >      unsigned num_rects;
> >      AVSubtitleRect **rects;
> > +    int64_t pts;    ///< Same as packet pts, in AV_TIME_BASE
> >  } AVSubtitle;
> >  
> >  /* packet functions */
> 
> these are ok as seperate commit

Applied, with an (hopefully correct) entry to APIchanges



More information about the ffmpeg-devel mailing list