[PATCH 1/2] Set provider_name in SDT if metadata exists

Georgi Chorbadzhiyski gf
Thu Oct 21 16:30:13 CEST 2010


With this patch mpegts muxer uses provider_name metadata to set
provider name field in SDT instead of always using the default one
---
 libavformat/mpegtsenc.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/libavformat/mpegtsenc.c b/libavformat/mpegtsenc.c
index 2d1fd40..cdbfb0f 100644
--- a/libavformat/mpegtsenc.c
+++ b/libavformat/mpegtsenc.c
@@ -391,9 +391,10 @@ static int mpegts_write_header(AVFormatContext *s)
     MpegTSWriteStream *ts_st;
     MpegTSService *service;
     AVStream *st, *pcr_st = NULL;
-    AVMetadataTag *title;
+    AVMetadataTag *title, *provider;
     int i, j;
     const char *service_name;
+    const char *provider_name;
     int *pids;
 
     ts->tsid = DEFAULT_TSID;
@@ -401,8 +402,9 @@ static int mpegts_write_header(AVFormatContext *s)
     /* allocate a single DVB service */
     title = av_metadata_get(s->metadata, "title", NULL, 0);
     service_name = title ? title->value : DEFAULT_SERVICE_NAME;
-    service = mpegts_add_service(ts, DEFAULT_SID,
-                                 DEFAULT_PROVIDER_NAME, service_name);
+    provider = av_metadata_get(s->metadata, "provider_name", NULL, 0);
+    provider_name = provider ? provider->value : DEFAULT_PROVIDER_NAME;
+    service = mpegts_add_service(ts, DEFAULT_SID, provider_name, service_name);
     service->pmt.write_packet = section_write_packet;
     service->pmt.opaque = s;
     service->pmt.cc = 15;
-- 
1.7.1


--=_ns-15956-1295421601-0001-2
Content-Type: text/plain; name="0002-When-naming-services-in-mpegts-look-for-service_name.patch"; charset=iso-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename*0="0002-When-naming-services-in-mpegts-look-for-service_name.pa";
 filename*1="tch"




More information about the ffmpeg-devel mailing list