[PATCH 2/2] When naming services in mpegts look for "service_name" metadata in addition to "title"

Georgi Chorbadzhiyski gf
Thu Oct 21 16:37:35 CEST 2010


In mpegts to name the service until now we would have to set "title"
metadata. This is fine but not very intuitive coupled with the other
metadata "provider_name". So if there is no "title" set, check for
"service_name" also.
---
 libavformat/mpegtsenc.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/libavformat/mpegtsenc.c b/libavformat/mpegtsenc.c
index cdbfb0f..611f0ca 100644
--- a/libavformat/mpegtsenc.c
+++ b/libavformat/mpegtsenc.c
@@ -401,6 +401,8 @@ static int mpegts_write_header(AVFormatContext *s)
     ts->onid = DEFAULT_ONID;
     /* allocate a single DVB service */
     title = av_metadata_get(s->metadata, "title", NULL, 0);
+    if (!title)
+        title = av_metadata_get(s->metadata, "service_name", NULL, 0);
     service_name = title ? title->value : DEFAULT_SERVICE_NAME;
     provider = av_metadata_get(s->metadata, "provider_name", NULL, 0);
     provider_name = provider ? provider->value : DEFAULT_PROVIDER_NAME;
-- 
1.7.1


--=_ns-15956-1295421601-0001-2--



More information about the ffmpeg-devel mailing list