[FFmpeg-cvslog] r17406 - trunk/libavformat/mpegtsenc.c
aurel
subversion
Wed Feb 18 01:00:40 CET 2009
Author: aurel
Date: Wed Feb 18 01:00:38 2009
New Revision: 17406
Log:
use new metadata API in mpegts muxer
Modified:
trunk/libavformat/mpegtsenc.c
Modified: trunk/libavformat/mpegtsenc.c
==============================================================================
--- trunk/libavformat/mpegtsenc.c Wed Feb 18 00:59:53 2009 (r17405)
+++ trunk/libavformat/mpegtsenc.c Wed Feb 18 01:00:38 2009 (r17406)
@@ -216,6 +216,7 @@ static void mpegts_write_pmt(AVFormatCon
for(i = 0; i < s->nb_streams; i++) {
AVStream *st = s->streams[i];
MpegTSWriteStream *ts_st = st->priv_data;
+ AVMetadataTag *lang = av_metadata_get(st->metadata, "language", NULL,0);
switch(st->codec->codec_id) {
case CODEC_ID_MPEG1VIDEO:
case CODEC_ID_MPEG2VIDEO:
@@ -252,21 +253,19 @@ static void mpegts_write_pmt(AVFormatCon
/* write optional descriptors here */
switch(st->codec->codec_type) {
case CODEC_TYPE_AUDIO:
- if (strlen(st->language) == 3) {
+ if (lang && strlen(lang->value) == 3) {
*q++ = 0x0a; /* ISO 639 language descriptor */
*q++ = 4;
- *q++ = st->language[0];
- *q++ = st->language[1];
- *q++ = st->language[2];
+ *q++ = lang->value[0];
+ *q++ = lang->value[1];
+ *q++ = lang->value[2];
*q++ = 0; /* undefined type */
}
break;
case CODEC_TYPE_SUBTITLE:
{
const char *language;
- language = st->language;
- if (strlen(language) != 3)
- language = "eng";
+ language = lang && strlen(lang->value)==3 ? lang->value : "eng";
*q++ = 0x59;
*q++ = 8;
*q++ = language[0];
@@ -383,6 +382,7 @@ static int mpegts_write_header(AVFormatC
MpegTSWriteStream *ts_st;
MpegTSService *service;
AVStream *st;
+ AVMetadataTag *title;
int i, total_bit_rate;
const char *service_name;
uint64_t sdt_size, pat_pmt_size, pos;
@@ -390,9 +390,8 @@ static int mpegts_write_header(AVFormatC
ts->tsid = DEFAULT_TSID;
ts->onid = DEFAULT_ONID;
/* allocate a single DVB service */
- service_name = s->title;
- if (service_name[0] == '\0')
- service_name = DEFAULT_SERVICE_NAME;
+ 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);
service->pmt.write_packet = section_write_packet;
More information about the ffmpeg-cvslog
mailing list