[FFmpeg-devel] PATCH: mpegtsenc.c

Anton Khirnov anton
Wed Jan 19 08:35:55 CET 2011


On Wed, Jan 19, 2011 at 02:02:59AM +0000, M?ns Rullg?rd wrote:
> JULIAN GARDNER <joolzg at btinternet.com> writes:
> 
> > Hi new user here.
> >
> > I have the following patch which allows the user through the
> > --metadata to also change the provider name on TS files, a bit like
> > the title option changes the service name.
> >
> > Index: libavformat/mpegtsenc.c
> > ===================================================================
> > --- libavformat/mpegtsenc.c	(revision 25941)
> > +++ libavformat/mpegtsenc.c	(working copy)
> > @@ -392,17 +392,22 @@
> >      MpegTSService *service;
> >      AVStream *st, *pcr_st = NULL;
> >      AVMetadataTag *title;
> > +    AVMetadataTag *program;
> >      int i, j;
> >      const char *service_name;
> > +    const char *program_name;
> >      int *pids;
> > +	int default_pid = DEFAULT_START_PID;
> 
> That line doesn't belong.
> 
> >      ts->tsid = DEFAULT_TSID;
> >      ts->onid = DEFAULT_ONID;
> >      /* allocate a single DVB service */
> >      title = av_metadata_get(s->metadata, "title", NULL, 0);
> >      service_name = title ? title->value : DEFAULT_SERVICE_NAME;
> > +    program = av_metadata_get(s->metadata, "program", NULL, 0);
> > +    program_name = program ? program->value : DEFAULT_PROVIDER_NAME;
> >      service = mpegts_add_service(ts, DEFAULT_SID,
> > -                                 DEFAULT_PROVIDER_NAME, service_name);
> > +                                 program_name, service_name);
> >      service->pmt.write_packet = section_write_packet;
> >      service->pmt.opaque = s;
> >      service->pmt.cc = 15;
> 
> This change looks sane as far as the code goes.  However, I'm not
> sure "program" is the best choice of tag name.  Perhaps someone with
> a fresher memory of DVB specs and practices can comment.
> 
Won't one of the existing generic tags be usable for this?
If not, the new tag should be added to the list in avformat.h so people
know it exists without having to read the code.

-- 
Anton Khirnov
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20110119/dc959086/attachment.pgp>



More information about the ffmpeg-devel mailing list